From c51f69382fc7fc53e3146bbc2b4142e93cca6ea3 Mon Sep 17 00:00:00 2001 From: Scott Elliott Date: Sat, 30 May 2026 22:55:30 -0700 Subject: [PATCH 01/13] complete assignment 5: load testing, monitoring endpoint, scoring tests, config docs --- assignment-5-common-issues.md | 27 + assignment-5-configurations.md | 40 + mock-project/Dockerfile | 6 + mock-project/backend/app.py | 423 + mock-project/backend/requirements.txt | 5 + .../backend/unit_tests/test_scoring.py | 37 + mock-project/docker-compose.yml | 5 + mock-project/load_tests/locustfile.py | 18 + mock-project/node_modules/.bin/playwright | 1 + .../node_modules/.bin/playwright-core | 1 + mock-project/node_modules/.package-lock.json | 53 + .../node_modules/@playwright/test/LICENSE | 202 + .../node_modules/@playwright/test/NOTICE | 5 + .../node_modules/@playwright/test/README.md | 318 + .../node_modules/@playwright/test/cli.js | 19 + .../node_modules/@playwright/test/index.d.ts | 18 + .../node_modules/@playwright/test/index.js | 17 + .../node_modules/@playwright/test/index.mjs | 18 + .../@playwright/test/package.json | 35 + .../@playwright/test/reporter.d.ts | 17 + .../node_modules/@playwright/test/reporter.js | 17 + .../@playwright/test/reporter.mjs | 17 + .../node_modules/playwright-core/LICENSE | 202 + .../node_modules/playwright-core/NOTICE | 5 + .../node_modules/playwright-core/README.md | 3 + .../playwright-core/ThirdPartyNotices.txt | 13 + .../bin/install_media_pack.ps1 | 5 + .../bin/install_webkit_wsl.ps1 | 33 + .../bin/reinstall_chrome_beta_linux.sh | 42 + .../bin/reinstall_chrome_beta_mac.sh | 13 + .../bin/reinstall_chrome_beta_win.ps1 | 24 + .../bin/reinstall_chrome_stable_linux.sh | 42 + .../bin/reinstall_chrome_stable_mac.sh | 12 + .../bin/reinstall_chrome_stable_win.ps1 | 24 + .../bin/reinstall_msedge_beta_linux.sh | 48 + .../bin/reinstall_msedge_beta_mac.sh | 11 + .../bin/reinstall_msedge_beta_win.ps1 | 23 + .../bin/reinstall_msedge_dev_linux.sh | 48 + .../bin/reinstall_msedge_dev_mac.sh | 11 + .../bin/reinstall_msedge_dev_win.ps1 | 23 + .../bin/reinstall_msedge_stable_linux.sh | 48 + .../bin/reinstall_msedge_stable_mac.sh | 11 + .../bin/reinstall_msedge_stable_win.ps1 | 24 + .../playwright-core/browsers.json | 81 + .../node_modules/playwright-core/cli.js | 21 + .../node_modules/playwright-core/index.d.ts | 17 + .../node_modules/playwright-core/index.js | 32 + .../node_modules/playwright-core/index.mjs | 28 + .../node_modules/playwright-core/package.json | 34 + .../playwright-core/types/protocol.d.ts | 24565 ++++++++++++++++ .../playwright-core/types/structs.d.ts | 45 + .../playwright-core/types/types.d.ts | 24518 +++++++++++++++ mock-project/node_modules/playwright/LICENSE | 202 + mock-project/node_modules/playwright/NOTICE | 5 + .../node_modules/playwright/README.md | 318 + .../playwright/ThirdPartyNotices.txt | 14 + mock-project/node_modules/playwright/cli.js | 19 + .../node_modules/playwright/index.d.ts | 17 + mock-project/node_modules/playwright/index.js | 17 + .../node_modules/playwright/index.mjs | 18 + .../node_modules/playwright/jsx-runtime.js | 42 + .../node_modules/playwright/jsx-runtime.mjs | 21 + .../node_modules/playwright/package.json | 61 + .../node_modules/playwright/test.d.ts | 18 + mock-project/node_modules/playwright/test.js | 24 + mock-project/node_modules/playwright/test.mjs | 35 + .../node_modules/playwright/types/test.d.ts | 10411 +++++++ .../playwright/types/testReporter.d.ts | 824 + mock-project/run-load-test.sh | 4 + mock-project/test-results/.last-run.json | 4 + 70 files changed, 63359 insertions(+) create mode 100644 assignment-5-common-issues.md create mode 100644 assignment-5-configurations.md create mode 100644 mock-project/Dockerfile create mode 100644 mock-project/backend/app.py create mode 100644 mock-project/backend/requirements.txt create mode 100644 mock-project/backend/unit_tests/test_scoring.py create mode 100644 mock-project/docker-compose.yml create mode 100644 mock-project/load_tests/locustfile.py create mode 120000 mock-project/node_modules/.bin/playwright create mode 120000 mock-project/node_modules/.bin/playwright-core create mode 100644 mock-project/node_modules/.package-lock.json create mode 100644 mock-project/node_modules/@playwright/test/LICENSE create mode 100644 mock-project/node_modules/@playwright/test/NOTICE create mode 100644 mock-project/node_modules/@playwright/test/README.md create mode 100755 mock-project/node_modules/@playwright/test/cli.js create mode 100644 mock-project/node_modules/@playwright/test/index.d.ts create mode 100644 mock-project/node_modules/@playwright/test/index.js create mode 100644 mock-project/node_modules/@playwright/test/index.mjs create mode 100644 mock-project/node_modules/@playwright/test/package.json create mode 100644 mock-project/node_modules/@playwright/test/reporter.d.ts create mode 100644 mock-project/node_modules/@playwright/test/reporter.js create mode 100644 mock-project/node_modules/@playwright/test/reporter.mjs create mode 100644 mock-project/node_modules/playwright-core/LICENSE create mode 100644 mock-project/node_modules/playwright-core/NOTICE create mode 100644 mock-project/node_modules/playwright-core/README.md create mode 100644 mock-project/node_modules/playwright-core/ThirdPartyNotices.txt create mode 100644 mock-project/node_modules/playwright-core/bin/install_media_pack.ps1 create mode 100644 mock-project/node_modules/playwright-core/bin/install_webkit_wsl.ps1 create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh create mode 100644 mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh create mode 100644 mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh create mode 100644 mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh create mode 100644 mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh create mode 100755 mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh create mode 100644 mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 create mode 100644 mock-project/node_modules/playwright-core/browsers.json create mode 100755 mock-project/node_modules/playwright-core/cli.js create mode 100644 mock-project/node_modules/playwright-core/index.d.ts create mode 100644 mock-project/node_modules/playwright-core/index.js create mode 100644 mock-project/node_modules/playwright-core/index.mjs create mode 100644 mock-project/node_modules/playwright-core/package.json create mode 100644 mock-project/node_modules/playwright-core/types/protocol.d.ts create mode 100644 mock-project/node_modules/playwright-core/types/structs.d.ts create mode 100644 mock-project/node_modules/playwright-core/types/types.d.ts create mode 100644 mock-project/node_modules/playwright/LICENSE create mode 100644 mock-project/node_modules/playwright/NOTICE create mode 100644 mock-project/node_modules/playwright/README.md create mode 100644 mock-project/node_modules/playwright/ThirdPartyNotices.txt create mode 100755 mock-project/node_modules/playwright/cli.js create mode 100644 mock-project/node_modules/playwright/index.d.ts create mode 100644 mock-project/node_modules/playwright/index.js create mode 100644 mock-project/node_modules/playwright/index.mjs create mode 100644 mock-project/node_modules/playwright/jsx-runtime.js create mode 100644 mock-project/node_modules/playwright/jsx-runtime.mjs create mode 100644 mock-project/node_modules/playwright/package.json create mode 100644 mock-project/node_modules/playwright/test.d.ts create mode 100644 mock-project/node_modules/playwright/test.js create mode 100644 mock-project/node_modules/playwright/test.mjs create mode 100644 mock-project/node_modules/playwright/types/test.d.ts create mode 100644 mock-project/node_modules/playwright/types/testReporter.d.ts create mode 100644 mock-project/run-load-test.sh create mode 100644 mock-project/test-results/.last-run.json diff --git a/assignment-5-common-issues.md b/assignment-5-common-issues.md new file mode 100644 index 0000000..e4f4776 --- /dev/null +++ b/assignment-5-common-issues.md @@ -0,0 +1,27 @@ +# Common Production Issues for Colorblindness Diagnostic Tools + +Based on research of similar products (Enchroma, Color Blind Check, Ishihara Test apps) and SOA/REST principles: + +## Functional issues + +1. **False positives/negatives** – Users report inconsistent results between test sessions. The slides note that scores can vary by +/-13%, but some users experience wider swings. This is the highest-priority issue because a misdiagnosis erodes trust. + +2. **Calibration issues** – Different screens (OLED vs LCD, brightness settings) affect color perception. A test calibrated on one device may be too easy or too hard on another. + +3. **Scoring algorithm bugs** – A bug in the cone score calculation would misdiagnose every user. My unit tests do not currently cover this logic. + +## Operational issues (from SOA statelessness principle, SRC-3, SRC-27) + +4. **Session state as a bottleneck** – My application uses server-side Flask sessions to track user progress. Under load, the session store becomes a bottleneck. If a user refreshes the page or opens multiple tabs, the session can become corrupted. A stateless design would store answers in localStorage or a signed JWT, aligning with REST statelessness constraints. This would also simplify load testing because each request would be independent. + +5. **No runbook for incident response** – If the test goes down at 2am, there are no documented steps for investigation or recovery. + +## Accessibility issues + +6. **Keyboard navigation gaps** – Users who cannot use a mouse may struggle to take the test. + +7. **Screen reader support** – The canvas-based number display is not accessible to blind users. This is a fundamental limitation of the Ishihara format. + +## Load/performance issues + +8. **Unknown concurrency limits** – I have not tested how the system behaves under 100 concurrent users. The Flask development server is single-threaded and not production-ready. diff --git a/assignment-5-configurations.md b/assignment-5-configurations.md new file mode 100644 index 0000000..d21e6be --- /dev/null +++ b/assignment-5-configurations.md @@ -0,0 +1,40 @@ +# Test Configurations + +Based on SOA principles of interoperability and standardized service contracts (SRC-25), the product must be tested across the configurations real users will have. + +## Browsers (must test all) +- Chrome (latest) – Windows, Mac, Linux +- Firefox (latest) +- Safari (latest) – Mac only +- Edge (latest) – Windows + +## Operating Systems +- Windows 10/11 +- macOS (Ventura, Sonoma, Sequoia) +- Ubuntu 22.04/24.04 + +## Devices and screen sizes +- Desktop (1920x1080) – primary target +- Laptop (1366x768) +- Tablet (iPad, Android) – numbers may be too small; document as limitation + +## Network conditions (for API health endpoint only) +- Fast (100 Mbps) +- Slow (3G throttled) – the Canvas renders client-side, so network mainly affects initial load + +## Screen color profiles (manual testing only) +- Standard RGB +- sRGB +- HDR modes (may shift colors) + +## Environmental conditions (manual) +- Bright sunlight (screen glare) +- Dark room (high contrast mode) + +## API contract versions (future) +If the product exposes a REST API, it should follow SOA standardized service contract principles. The current version uses form POSTs with implicit contract. Before release, the API should be documented (OpenAPI) and versioned. + +## Testing approach +- Automated cross-browser testing is not implemented due to time constraints. +- Manual testing covers Chrome, Firefox, and Safari on desktop. +- Load testing is automated with Locust (see specialized testing report). diff --git a/mock-project/Dockerfile b/mock-project/Dockerfile new file mode 100644 index 0000000..6aa95d1 --- /dev/null +++ b/mock-project/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.11-slim +WORKDIR /app +COPY backend/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt +COPY backend/ . +CMD ["python", "app.py"] diff --git a/mock-project/backend/app.py b/mock-project/backend/app.py new file mode 100644 index 0000000..a5cfc6a --- /dev/null +++ b/mock-project/backend/app.py @@ -0,0 +1,423 @@ +from flask import Flask, render_template_string, session, redirect, url_for, request +import random +import psutil + +app = Flask(__name__) +app.secret_key = 'your-secret-key-here' + +# Number patterns (5x5 grid) +PATTERNS = { + 0: [ + [0,1,1,1,0], + [1,0,0,0,1], + [1,0,0,0,1], + [1,0,0,0,1], + [0,1,1,1,0] + ], + 1: [ + [0,0,1,0,0], + [0,1,1,0,0], + [0,0,1,0,0], + [0,0,1,0,0], + [0,1,1,1,0] + ], + 2: [ + [0,1,1,1,0], + [1,0,0,0,1], + [0,0,1,1,0], + [0,1,0,0,0], + [1,1,1,1,1] + ], + 3: [ + [0,1,1,1,0], + [1,0,0,0,1], + [0,0,1,1,0], + [1,0,0,0,1], + [0,1,1,1,0] + ], + 4: [ + [1,0,0,0,1], + [1,0,0,0,1], + [1,1,1,1,1], + [0,0,0,0,1], + [0,0,0,0,1] + ], + 5: [ + [1,1,1,1,1], + [1,0,0,0,0], + [1,1,1,1,0], + [0,0,0,0,1], + [1,1,1,1,0] + ], + 6: [ + [0,1,1,1,0], + [1,0,0,0,0], + [1,1,1,1,0], + [1,0,0,0,1], + [0,1,1,1,0] + ], + 7: [ + [1,1,1,1,1], + [0,0,0,0,1], + [0,0,1,1,0], + [0,1,0,0,0], + [1,0,0,0,0] + ], + 8: [ + [0,1,1,1,0], + [1,0,0,0,1], + [0,1,1,1,0], + [1,0,0,0,1], + [0,1,1,1,0] + ], + 9: [ + [0,1,1,1,0], + [1,0,0,0,1], + [0,1,1,1,1], + [0,0,0,0,1], + [0,1,1,1,0] + ], +} + +def get_pattern(num): + if num < 10: + return PATTERNS.get(num, PATTERNS[0]) + tens = num // 10 + ones = num % 10 + p1 = PATTERNS.get(tens, PATTERNS[0]) + p2 = PATTERNS.get(ones, PATTERNS[0]) + combined = [] + for i in range(5): + row = p1[i] + [0] + p2[i] + combined.append(row) + return combined + +def make_plate(plate_type, number): + if plate_type == 'protan': + # Protan - make it VERY hard for red-deficient + base_red = random.randint(80, 110) + base_green = random.randint(80, 110) + bg = [base_red, base_green, random.randint(60, 90)] + fg = [base_red + random.randint(-10, 10), base_green + random.randint(-10, 10), random.randint(60, 90)] + elif plate_type == 'deutan': + # Deutan - medium difficulty + bg = [random.randint(70, 100), random.randint(120, 150), random.randint(70, 100)] + fg = [random.randint(120, 150), random.randint(40, 70), random.randint(70, 100)] + elif plate_type == 'tritan': + # Tritan - VERY easy for normal vision (high contrast) + bg = [120, 120, 120] + fg = [40, 40, 200] + else: + # Control - extremely easy + bg = [60, 60, 60] + fg = [220, 220, 220] + + for i in range(3): + bg[i] = max(30, min(230, bg[i])) + fg[i] = max(30, min(230, fg[i])) + + return { + 'num': number, + 'type': plate_type, + 'bg': bg, + 'fg': fg, + 'pattern': get_pattern(number) + } + +HTML = ''' + + + + Color Vision Test + + + +

Color Vision Diagnostic Test

+ {% if not done %} +
+ Instructions: A number is hidden in the circle of dots. Type the number you see.
+ If you do not see any number, click the No Number button. +
+ +
+ ⚠️ Disclaimer: This test is for informational and educational purposes only. + It is not a medical diagnosis. If you have concerns about your color vision, please consult + an eye care professional. Results may vary and should not be used for official medical determinations. +
+ +
+

Plate {{ idx }} of {{ total }}

+ +
+
+ + + +
+
+ + {% else %} +
+

Your Color Blind Test Result

+

{{ diagnosis }}

+

{{ description }}

+ +
+
Blue Cone (Tritan)
+
{{ blue_score }}%
+ +
+ +
+
Green Cone (Deutan)
+
{{ green_score }}%
+ +
+ +
+
Red Cone (Protan)
+
{{ red_score }}%
+ +
+ +
Note: Scores below 60% indicate a possible deficiency in that cone type.
+ +
+ +
+ +
+ +
+
+ + {% endif %} + + +''' + +PROTAN_QUESTIONS = [12, 8, 5, 74, 29, 6, 3, 15] +DEUTAN_QUESTIONS = [12, 8, 5, 74, 29, 6, 3, 15] +TRITAN_QUESTIONS = [2, 9, 4] +CONTROL_QUESTIONS = [7, 0] + +@app.route('/', methods=['GET', 'POST']) +def index(): + if not session.get('initialized'): + session.clear() + plates = [] + for q in PROTAN_QUESTIONS: + plates.append(make_plate('protan', q)) + for q in DEUTAN_QUESTIONS: + plates.append(make_plate('deutan', q)) + for q in TRITAN_QUESTIONS: + plates.append(make_plate('tritan', q)) + for q in CONTROL_QUESTIONS: + plates.append(make_plate('control', q)) + random.shuffle(plates) + + session['plates'] = plates + session['answers'] = [] + session['step'] = 0 + session['initialized'] = True + session.modified = True + + if request.method == 'POST': + # Handle the "No Number" button or regular number input + if 'skip' in request.form: + user_number = 0 + else: + ans = request.form.get('answer', '0') + try: + user_number = int(ans) + except: + user_number = 0 + + step = session.get('step', 0) + plates = session.get('plates', []) + + if step < len(plates): + answers = session.get('answers', []) + answers.append({ + 'user': user_number, + 'correct': plates[step]['num'], + 'type': plates[step]['type'] + }) + session['answers'] = answers + session['step'] = step + 1 + session.modified = True + + if session.get('step', 0) >= len(plates): + return redirect(url_for('result')) + + step = session.get('step', 0) + plates = session.get('plates', []) + + if step >= len(plates) or not plates: + return redirect(url_for('result')) + + p = plates[step] + return render_template_string(HTML, + pattern=p['pattern'], + bg=p['bg'], + fg=p['fg'], + idx=step+1, + total=len(plates), + pct=(step/len(plates))*100, + done=False) + +@app.route('/result') +def result(): + answers = session.get('answers', []) + plates = session.get('plates', []) + + protan_correct = 0 + protan_total = 0 + deutan_correct = 0 + deutan_total = 0 + tritan_correct = 0 + tritan_total = 0 + + for i, a in enumerate(answers): + if i >= len(plates): + continue + plate_type = plates[i]['type'] + is_correct = (a['user'] == a['correct']) + + if plate_type == 'protan': + protan_total += 1 + if is_correct: + protan_correct += 1 + elif plate_type == 'deutan': + deutan_total += 1 + if is_correct: + deutan_correct += 1 + elif plate_type == 'tritan': + tritan_total += 1 + if is_correct: + tritan_correct += 1 + + red_score = round((protan_correct / max(protan_total, 1)) * 100) + green_score = round((deutan_correct / max(deutan_total, 1)) * 100) + blue_score = round((tritan_correct / max(tritan_total, 1)) * 100) + + # Find the lowest score + scores = {'red': red_score, 'green': green_score, 'blue': blue_score} + min_type = min(scores, key=scores.get) + min_score = scores[min_type] + + if min_score < 60: + if min_type == 'red': + diagnosis = "Protan Color Blind" + description = "You have a stronger deficiency in your red color cone, which means you have a type of red-green color blindness called Protan." + elif min_type == 'green': + diagnosis = "Deutan Color Blind" + description = "You have a stronger deficiency in your green color cone, which means you have a type of red-green color blindness called Deutan." + else: + diagnosis = "Tritan Color Blind" + description = "You have a deficiency in your blue color cone, which means you have blue-yellow color blindness called Tritan." + else: + diagnosis = "Normal Color Vision" + description = "Your color vision appears normal within the range of this test." + + return render_template_string(HTML, + done=True, + red_score=red_score, + green_score=green_score, + blue_score=blue_score, + diagnosis=diagnosis, + description=description) + +@app.route('/reset', methods=['POST']) +def reset(): + session.clear() + return redirect(url_for('index')) + +@app.route('/health') +def health(): + return {'status': 'ok'} + +@app.route('/debug/stats') +def debug_stats(): + """Simple monitoring endpoint for operational health.""" + return { + 'status': 'ok', + 'cpu_percent': psutil.cpu_percent(interval=0.1), + 'memory_percent': psutil.virtual_memory().percent, + 'active_sessions': len(session.keys()) if session else 0 + } + +if __name__ == '__main__': + app.run(host='0.0.0.0', port=5000, debug=True) diff --git a/mock-project/backend/requirements.txt b/mock-project/backend/requirements.txt new file mode 100644 index 0000000..4994621 --- /dev/null +++ b/mock-project/backend/requirements.txt @@ -0,0 +1,5 @@ +flask +pytest +requests +locust +psutil diff --git a/mock-project/backend/unit_tests/test_scoring.py b/mock-project/backend/unit_tests/test_scoring.py new file mode 100644 index 0000000..3637bd5 --- /dev/null +++ b/mock-project/backend/unit_tests/test_scoring.py @@ -0,0 +1,37 @@ +import sys +import os +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +import pytest +from app import app + +@pytest.fixture +def client(): + """Create a test client for the Flask app.""" + app.config['TESTING'] = True + with app.test_client() as client: + with app.app_context(): + pass + yield client + +def test_result_page_returns_200(client): + """Test that the result page loads without crashing.""" + # The result page redirects to index if no session, but should not crash + response = client.get('/result') + assert response.status_code in [200, 302] + +def test_health_endpoint_returns_ok(client): + """Test that the health endpoint works.""" + response = client.get('/health') + assert response.status_code == 200 + assert response.json == {'status': 'ok'} + +def test_debug_stats_endpoint_returns_stats(client): + """Test that the debug stats endpoint returns expected fields.""" + response = client.get('/debug/stats') + assert response.status_code == 200 + data = response.json + assert 'status' in data + assert 'cpu_percent' in data + assert 'memory_percent' in data + assert 'active_sessions' in data diff --git a/mock-project/docker-compose.yml b/mock-project/docker-compose.yml new file mode 100644 index 0000000..7e8fa42 --- /dev/null +++ b/mock-project/docker-compose.yml @@ -0,0 +1,5 @@ +services: + api: + build: . + ports: + - "5000:5000" diff --git a/mock-project/load_tests/locustfile.py b/mock-project/load_tests/locustfile.py new file mode 100644 index 0000000..970294c --- /dev/null +++ b/mock-project/load_tests/locustfile.py @@ -0,0 +1,18 @@ +from locust import HttpUser, task, between + +class ColorVisionUser(HttpUser): + wait_time = between(1, 3) + + @task + def health_check(self): + self.client.get("/health") + + @task(3) + def submit_plate(self): + # Simulate submitting a "No Number" answer + self.client.post("/", data={"skip": "skip"}) + + @task(1) + def submit_number(self): + # Simulate submitting a number answer + self.client.post("/", data={"answer": "12"}) diff --git a/mock-project/node_modules/.bin/playwright b/mock-project/node_modules/.bin/playwright new file mode 120000 index 0000000..c30d07f --- /dev/null +++ b/mock-project/node_modules/.bin/playwright @@ -0,0 +1 @@ +../@playwright/test/cli.js \ No newline at end of file diff --git a/mock-project/node_modules/.bin/playwright-core b/mock-project/node_modules/.bin/playwright-core new file mode 120000 index 0000000..08d6c28 --- /dev/null +++ b/mock-project/node_modules/.bin/playwright-core @@ -0,0 +1 @@ +../playwright-core/cli.js \ No newline at end of file diff --git a/mock-project/node_modules/.package-lock.json b/mock-project/node_modules/.package-lock.json new file mode 100644 index 0000000..6a93712 --- /dev/null +++ b/mock-project/node_modules/.package-lock.json @@ -0,0 +1,53 @@ +{ + "name": "colorblind-api", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@playwright/test": { + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.60.0.tgz", + "integrity": "sha512-O71yZIbAh/PxDMNGns37GHBIfrVkEVyn+AXyIa5dOTfb4/xNvRWV+Vv/NMbNCtODB/pO7vLlF2OTmMVLhmr7Ag==", + "dev": true, + "dependencies": { + "playwright": "1.60.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/playwright": { + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.60.0.tgz", + "integrity": "sha512-hheHdokM8cdqCb0lcE3s+zT4t4W+vvjpGxsZlDnikarzx8tSzMebh3UiFtgqwFwnTnjYQcsyMF8ei2mCO/tpeA==", + "dev": true, + "dependencies": { + "playwright-core": "1.60.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/playwright-core": { + "version": "1.60.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.60.0.tgz", + "integrity": "sha512-9bW6zvX/m0lEbgTKJ6YppOKx8H3VOPBMOCFh2irXFOT4BbHgrx5hPjwJYLT40Lu+4qtD36qKc/Hn56StUW57IA==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=18" + } + } + } +} diff --git a/mock-project/node_modules/@playwright/test/LICENSE b/mock-project/node_modules/@playwright/test/LICENSE new file mode 100644 index 0000000..df11237 --- /dev/null +++ b/mock-project/node_modules/@playwright/test/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Portions Copyright (c) Microsoft Corporation. + Portions Copyright 2017 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/mock-project/node_modules/@playwright/test/NOTICE b/mock-project/node_modules/@playwright/test/NOTICE new file mode 100644 index 0000000..814ec16 --- /dev/null +++ b/mock-project/node_modules/@playwright/test/NOTICE @@ -0,0 +1,5 @@ +Playwright +Copyright (c) Microsoft Corporation + +This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer), +available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE). diff --git a/mock-project/node_modules/@playwright/test/README.md b/mock-project/node_modules/@playwright/test/README.md new file mode 100644 index 0000000..17feb3c --- /dev/null +++ b/mock-project/node_modules/@playwright/test/README.md @@ -0,0 +1,318 @@ +# 🎭 Playwright + +[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) [![Chromium version](https://img.shields.io/badge/chromium-148.0.7778.96-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-150.0.2-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-26.4-blue.svg?logo=safari)](https://webkit.org/) [![Join Discord](https://img.shields.io/badge/join-discord-informational)](https://aka.ms/playwright/discord) + +## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright) + +Playwright is a framework for web automation and testing. It drives Chromium, Firefox, and WebKit with a single API — in your tests, in your scripts, and as a tool for AI agents. + +## Get Started + +Choose the path that fits your workflow: + +| | Best for | Install | +|---|---|---| +| **[Playwright Test](#playwright-test)** | End-to-end testing | `npm init playwright@latest` | +| **[Playwright CLI](#playwright-cli)** | Coding agents (Claude Code, Copilot) | `npm i -g @playwright/cli@latest` | +| **[Playwright MCP](#playwright-mcp)** | AI agents and LLM-driven automation | `npx @playwright/mcp@latest` | +| **[Playwright Library](#playwright-library)** | Browser automation scripts | `npm i playwright` | +| **[VS Code Extension](#vs-code-extension)** | Test authoring and debugging in VS Code | [Install from Marketplace](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) | + +--- + +## Playwright Test + +Playwright Test is a full-featured test runner built for end-to-end testing. It runs tests across Chromium, Firefox, and WebKit with full browser isolation, auto-waiting, and web-first assertions. + +### Install + +```bash +npm init playwright@latest +``` + +Or add manually: + +```bash +npm i -D @playwright/test +npx playwright install +``` + +### Write a test + +```TypeScript +import { test, expect } from '@playwright/test'; + +test('has title', async ({ page }) => { + await page.goto('https://playwright.dev/'); + await expect(page).toHaveTitle(/Playwright/); +}); + +test('get started link', async ({ page }) => { + await page.goto('https://playwright.dev/'); + await page.getByRole('link', { name: 'Get started' }).click(); + await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); +}); +``` + +### Run tests + +```bash +npx playwright test +``` + +Tests run in parallel across all configured browsers, in headless mode by default. Each test gets a fresh browser context — full isolation with near-zero overhead. + +### Key capabilities + +**Auto-wait and web-first assertions.** No artificial timeouts. Playwright waits for elements to be actionable, and assertions automatically retry until conditions are met. + +**Locators.** Find elements with resilient locators that mirror how users see the page: + +```TypeScript +page.getByRole('button', { name: 'Submit' }) +page.getByLabel('Email') +page.getByPlaceholder('Search...') +page.getByTestId('login-form') +``` + +**Test isolation.** Each test runs in its own browser context — equivalent to a fresh browser profile. Save authentication state once and reuse it across tests: + +```TypeScript +// Save state after login +await page.context().storageState({ path: 'auth.json' }); + +// Reuse in other tests +test.use({ storageState: 'auth.json' }); +``` + +**Tracing.** Capture execution traces, screenshots, and videos on failure. Inspect every action, DOM snapshot, network request, and console message in the [Trace Viewer](https://playwright.dev/docs/trace-viewer): + +```TypeScript +// playwright.config.ts +export default defineConfig({ + use: { + trace: 'on-first-retry', + }, +}); +``` + +```bash +npx playwright show-trace trace.zip +``` + + + +**Parallelism.** Tests run in parallel by default across all configured browsers. + +[Full testing documentation](https://playwright.dev/docs/intro) + +--- + +## Playwright CLI + +[Playwright CLI](https://github.com/microsoft/playwright-cli) is a command-line interface for browser automation designed for coding agents. It's more token-efficient than MCP — commands avoid loading large tool schemas and accessibility trees into the model context. + +### Install + +```bash +npm install -g @playwright/cli@latest +``` + +Optionally install skills for richer agent integration: + +```bash +playwright-cli install --skills +``` + +### Usage + +Point your coding agent at a task: + +``` +Test the "add todo" flow on https://demo.playwright.dev/todomvc using playwright-cli. +Take screenshots for all successful and failing scenarios. +``` + +Or run commands directly: + +```bash +playwright-cli open https://demo.playwright.dev/todomvc/ --headed +playwright-cli type "Buy groceries" +playwright-cli press Enter +playwright-cli screenshot +``` + +### Session monitoring + +Use `playwright-cli show` to open a visual dashboard with live screencast previews of all running browser sessions. Click any session to zoom in and take remote control. + +```bash +playwright-cli show +``` + + + +[Full CLI documentation](https://playwright.dev/docs/cli-agent) | [GitHub](https://github.com/microsoft/playwright-cli) + +--- + +## Playwright MCP + +The [Playwright MCP server](https://github.com/microsoft/playwright-mcp) gives AI agents full browser control through the [Model Context Protocol](https://modelcontextprotocol.io). Agents interact with pages using structured accessibility snapshots — no vision models or screenshots required. + +### Setup + +Add to your MCP client (VS Code, Cursor, Claude Desktop, Windsurf, etc.): + +```json +{ + "mcpServers": { + "playwright": { + "command": "npx", + "args": ["@playwright/mcp@latest"] + } + } +} +``` + +**One-click install for VS Code:** + +[Install in VS Code](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) + +**For Claude Code:** + +```bash +claude mcp add playwright npx @playwright/mcp@latest +``` + +### How it works + +Ask your AI assistant to interact with any web page: + +``` +Navigate to https://demo.playwright.dev/todomvc and add a few todo items. +``` + +The agent sees the page as a structured accessibility tree: + +``` +- heading "todos" [level=1] +- textbox "What needs to be done?" [ref=e5] +- listitem: + - checkbox "Toggle Todo" [ref=e10] + - text: "Buy groceries" +``` + +It uses element refs like `e5` and `e10` to click, type, and interact — deterministically and without visual ambiguity. Tools cover navigation, form filling, screenshots, network mocking, storage management, and more. + +[Full MCP documentation](https://playwright.dev/docs/mcp) | [GitHub](https://github.com/microsoft/playwright-mcp) + +--- + +## Playwright Library + +Use `playwright` as a library for browser automation scripts — web scraping, PDF generation, screenshot capture, and any workflow that needs programmatic browser control without a test runner. + +### Install + +```bash +npm i playwright +``` + +### Examples + +**Take a screenshot:** + +```TypeScript +import { chromium } from 'playwright'; + +const browser = await chromium.launch(); +const page = await browser.newPage(); +await page.goto('https://playwright.dev/'); +await page.screenshot({ path: 'screenshot.png' }); +await browser.close(); +``` + +**Generate a PDF:** + +```TypeScript +import { chromium } from 'playwright'; + +const browser = await chromium.launch(); +const page = await browser.newPage(); +await page.goto('https://playwright.dev/'); +await page.pdf({ path: 'page.pdf', format: 'A4' }); +await browser.close(); +``` + +**Emulate a mobile device:** + +```TypeScript +import { chromium, devices } from 'playwright'; + +const browser = await chromium.launch(); +const context = await browser.newContext(devices['iPhone 15']); +const page = await context.newPage(); +await page.goto('https://playwright.dev/'); +await page.screenshot({ path: 'mobile.png' }); +await browser.close(); +``` + +**Intercept network requests:** + +```TypeScript +import { chromium } from 'playwright'; + +const browser = await chromium.launch(); +const page = await browser.newPage(); +await page.route('**/*.{png,jpg,jpeg}', route => route.abort()); +await page.goto('https://playwright.dev/'); +await browser.close(); +``` + +[Library documentation](https://playwright.dev/docs/library) | [API reference](https://playwright.dev/docs/api/class-playwright) + +--- + +## VS Code Extension + +The [Playwright VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) brings test running, debugging, and code generation directly into your editor. + + + +**Run and debug tests** from the editor with a single click. Set breakpoints, inspect variables, and step through test execution with a live browser view. + +**Generate tests with CodeGen.** Click "Record new" to open a browser — navigate and interact with your app while Playwright writes the test code for you. + +**Pick locators.** Hover over any element in the browser to see the best available locator, then click to copy it to your clipboard. + +**Trace Viewer integration.** Enable "Show Trace Viewer" in the sidebar to get a full execution trace after each test run — DOM snapshots, network requests, console logs, and screenshots at every step. + +[Install the extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright) | [VS Code guide](https://playwright.dev/docs/getting-started-vscode) + +--- + +## Cross-Browser Support + +| | Linux | macOS | Windows | +| :--- | :---: | :---: | :---: | +| Chromium1 148.0.7778.96 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| WebKit 26.4 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 150.0.2 | :white_check_mark: | :white_check_mark: | :white_check_mark: | + +Headless and headed execution on all platforms. 1 Uses [Chrome for Testing](https://developer.chrome.com/blog/chrome-for-testing) by default. + +## Other Languages + +Playwright is also available for [Python](https://playwright.dev/python/docs/intro), [.NET](https://playwright.dev/dotnet/docs/intro), and [Java](https://playwright.dev/java/docs/intro). + +## Resources + +* [Documentation](https://playwright.dev) +* [API reference](https://playwright.dev/docs/api/class-playwright) +* [MCP server](https://github.com/microsoft/playwright-mcp) +* [CLI for coding agents](https://github.com/microsoft/playwright-cli) +* [VS Code extension](https://github.com/microsoft/playwright-vscode) +* [Contribution guide](CONTRIBUTING.md) +* [Changelog](https://github.com/microsoft/playwright/releases) +* [Discord](https://aka.ms/playwright/discord) diff --git a/mock-project/node_modules/@playwright/test/cli.js b/mock-project/node_modules/@playwright/test/cli.js new file mode 100755 index 0000000..e42facb --- /dev/null +++ b/mock-project/node_modules/@playwright/test/cli.js @@ -0,0 +1,19 @@ +#!/usr/bin/env node +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const { program } = require('playwright/lib/program'); +program.parse(process.argv); diff --git a/mock-project/node_modules/@playwright/test/index.d.ts b/mock-project/node_modules/@playwright/test/index.d.ts new file mode 100644 index 0000000..8d99c91 --- /dev/null +++ b/mock-project/node_modules/@playwright/test/index.d.ts @@ -0,0 +1,18 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from 'playwright/test'; +export { default } from 'playwright/test'; diff --git a/mock-project/node_modules/@playwright/test/index.js b/mock-project/node_modules/@playwright/test/index.js new file mode 100644 index 0000000..8536f06 --- /dev/null +++ b/mock-project/node_modules/@playwright/test/index.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module.exports = require('playwright/test'); diff --git a/mock-project/node_modules/@playwright/test/index.mjs b/mock-project/node_modules/@playwright/test/index.mjs new file mode 100644 index 0000000..8d99c91 --- /dev/null +++ b/mock-project/node_modules/@playwright/test/index.mjs @@ -0,0 +1,18 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from 'playwright/test'; +export { default } from 'playwright/test'; diff --git a/mock-project/node_modules/@playwright/test/package.json b/mock-project/node_modules/@playwright/test/package.json new file mode 100644 index 0000000..2898afa --- /dev/null +++ b/mock-project/node_modules/@playwright/test/package.json @@ -0,0 +1,35 @@ +{ + "name": "@playwright/test", + "version": "1.60.0", + "description": "A high-level API to automate web browsers", + "repository": { + "type": "git", + "url": "git+https://github.com/microsoft/playwright.git" + }, + "homepage": "https://playwright.dev", + "engines": { + "node": ">=18" + }, + "author": { + "name": "Microsoft Corporation" + }, + "license": "Apache-2.0", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./index.mjs", + "require": "./index.js", + "default": "./index.js" + }, + "./cli": "./cli.js", + "./package.json": "./package.json", + "./reporter": "./reporter.js" + }, + "bin": { + "playwright": "cli.js" + }, + "scripts": {}, + "dependencies": { + "playwright": "1.60.0" + } +} diff --git a/mock-project/node_modules/@playwright/test/reporter.d.ts b/mock-project/node_modules/@playwright/test/reporter.d.ts new file mode 100644 index 0000000..806d13f --- /dev/null +++ b/mock-project/node_modules/@playwright/test/reporter.d.ts @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from 'playwright/types/testReporter'; diff --git a/mock-project/node_modules/@playwright/test/reporter.js b/mock-project/node_modules/@playwright/test/reporter.js new file mode 100644 index 0000000..485e880 --- /dev/null +++ b/mock-project/node_modules/@playwright/test/reporter.js @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// We only export types in reporter.d.ts. diff --git a/mock-project/node_modules/@playwright/test/reporter.mjs b/mock-project/node_modules/@playwright/test/reporter.mjs new file mode 100644 index 0000000..485e880 --- /dev/null +++ b/mock-project/node_modules/@playwright/test/reporter.mjs @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// We only export types in reporter.d.ts. diff --git a/mock-project/node_modules/playwright-core/LICENSE b/mock-project/node_modules/playwright-core/LICENSE new file mode 100644 index 0000000..df11237 --- /dev/null +++ b/mock-project/node_modules/playwright-core/LICENSE @@ -0,0 +1,202 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Portions Copyright (c) Microsoft Corporation. + Portions Copyright 2017 Google Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/mock-project/node_modules/playwright-core/NOTICE b/mock-project/node_modules/playwright-core/NOTICE new file mode 100644 index 0000000..814ec16 --- /dev/null +++ b/mock-project/node_modules/playwright-core/NOTICE @@ -0,0 +1,5 @@ +Playwright +Copyright (c) Microsoft Corporation + +This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer), +available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE). diff --git a/mock-project/node_modules/playwright-core/README.md b/mock-project/node_modules/playwright-core/README.md new file mode 100644 index 0000000..422b373 --- /dev/null +++ b/mock-project/node_modules/playwright-core/README.md @@ -0,0 +1,3 @@ +# playwright-core + +This package contains the no-browser flavor of [Playwright](http://github.com/microsoft/playwright). diff --git a/mock-project/node_modules/playwright-core/ThirdPartyNotices.txt b/mock-project/node_modules/playwright-core/ThirdPartyNotices.txt new file mode 100644 index 0000000..369e202 --- /dev/null +++ b/mock-project/node_modules/playwright-core/ThirdPartyNotices.txt @@ -0,0 +1,13 @@ +microsoft/playwright-core + +THIRD-PARTY SOFTWARE NOTICES AND INFORMATION + +This package bundles third-party software inside individual files under +`lib/`. Each bundled output has a sidecar `.js.LICENSE` file next +to it listing every npm package whose source was inlined into that +bundle, together with the full license text for each. + +For example: +- lib/utilsBundle.js.LICENSE + +This project incorporates components from the projects listed below. The original copyright notices and the licenses under which Microsoft received such components are set forth below. Microsoft reserves all rights not expressly granted herein, whether by implication, estoppel or otherwise. diff --git a/mock-project/node_modules/playwright-core/bin/install_media_pack.ps1 b/mock-project/node_modules/playwright-core/bin/install_media_pack.ps1 new file mode 100644 index 0000000..6170754 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/install_media_pack.ps1 @@ -0,0 +1,5 @@ +$osInfo = Get-WmiObject -Class Win32_OperatingSystem +# check if running on Windows Server +if ($osInfo.ProductType -eq 3) { + Install-WindowsFeature Server-Media-Foundation +} diff --git a/mock-project/node_modules/playwright-core/bin/install_webkit_wsl.ps1 b/mock-project/node_modules/playwright-core/bin/install_webkit_wsl.ps1 new file mode 100644 index 0000000..ccaaf15 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/install_webkit_wsl.ps1 @@ -0,0 +1,33 @@ +$ErrorActionPreference = 'Stop' + +# This script sets up a WSL distribution that will be used to run WebKit. + +$Distribution = "playwright" +$Username = "pwuser" + +$distributions = (wsl --list --quiet) -split "\r?\n" +if ($distributions -contains $Distribution) { + Write-Host "WSL distribution '$Distribution' already exists. Skipping installation." +} else { + Write-Host "Installing new WSL distribution '$Distribution'..." + $VhdSize = "10GB" + wsl --install -d Ubuntu-24.04 --name $Distribution --no-launch --vhd-size $VhdSize + wsl -d $Distribution -u root adduser --gecos GECOS --disabled-password $Username +} + +$pwshDirname = (Resolve-Path -Path $PSScriptRoot).Path; +$playwrightCoreRoot = Resolve-Path (Join-Path $pwshDirname "..") + +$initScript = @" +if [ ! -f "/home/$Username/node/bin/node" ]; then + mkdir -p /home/$Username/node + curl -fsSL https://nodejs.org/dist/v22.17.0/node-v22.17.0-linux-x64.tar.xz -o /home/$Username/node/node-v22.17.0-linux-x64.tar.xz + tar -xJf /home/$Username/node/node-v22.17.0-linux-x64.tar.xz -C /home/$Username/node --strip-components=1 + sudo -u $Username echo 'export PATH=/home/$Username/node/bin:\`$PATH' >> /home/$Username/.profile +fi +/home/$Username/node/bin/node cli.js install-deps webkit +sudo -u $Username PLAYWRIGHT_SKIP_BROWSER_GC=1 /home/$Username/node/bin/node cli.js install webkit +"@ -replace "\r\n", "`n" + +wsl -d $Distribution --cd $playwrightCoreRoot -u root -- bash -c "$initScript" +Write-Host "Done!" \ No newline at end of file diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh new file mode 100755 index 0000000..0451bda --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +set -e +set -x + +if [[ $(arch) == "aarch64" ]]; then + echo "ERROR: not supported on Linux Arm64" + exit 1 +fi + +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi + + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi +fi + +# 1. make sure to remove old beta if any. +if dpkg --get-selections | grep -q "^google-chrome-beta[[:space:]]*install$" >/dev/null; then + apt-get remove -y google-chrome-beta +fi + +# 2. Update apt lists (needed to install curl and chrome dependencies) +apt-get update + +# 3. Install curl to download chrome +if ! command -v curl >/dev/null; then + apt-get install -y curl +fi + +# 4. download chrome beta from dl.google.com and install it. +cd /tmp +curl -O https://dl.google.com/linux/direct/google-chrome-beta_current_amd64.deb +apt-get install -y ./google-chrome-beta_current_amd64.deb +rm -rf ./google-chrome-beta_current_amd64.deb +cd - +google-chrome-beta --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh new file mode 100755 index 0000000..617e3b5 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -e +set -x + +rm -rf "/Applications/Google Chrome Beta.app" +cd /tmp +curl --retry 3 -o ./googlechromebeta.dmg https://dl.google.com/chrome/mac/universal/beta/googlechromebeta.dmg +hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechromebeta.dmg ./googlechromebeta.dmg +cp -pR "/Volumes/googlechromebeta.dmg/Google Chrome Beta.app" /Applications +hdiutil detach /Volumes/googlechromebeta.dmg +rm -rf /tmp/googlechromebeta.dmg + +/Applications/Google\ Chrome\ Beta.app/Contents/MacOS/Google\ Chrome\ Beta --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 new file mode 100644 index 0000000..3fbe551 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 @@ -0,0 +1,24 @@ +$ErrorActionPreference = 'Stop' + +$url = 'https://dl.google.com/tag/s/dl/chrome/install/beta/googlechromebetastandaloneenterprise64.msi' + +Write-Host "Downloading Google Chrome Beta" +$wc = New-Object net.webclient +$msiInstaller = "$env:temp\google-chrome-beta.msi" +$wc.Downloadfile($url, $msiInstaller) + +Write-Host "Installing Google Chrome Beta" +$arguments = "/i `"$msiInstaller`" /quiet" +Start-Process msiexec.exe -ArgumentList $arguments -Wait +Remove-Item $msiInstaller + +$suffix = "\\Google\\Chrome Beta\\Application\\chrome.exe" +if (Test-Path "${env:ProgramFiles(x86)}$suffix") { + (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo +} elseif (Test-Path "${env:ProgramFiles}$suffix") { + (Get-Item "${env:ProgramFiles}$suffix").VersionInfo +} else { + Write-Host "ERROR: Failed to install Google Chrome Beta." + Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." + exit 1 +} diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh new file mode 100755 index 0000000..78f1d41 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +set -e +set -x + +if [[ $(arch) == "aarch64" ]]; then + echo "ERROR: not supported on Linux Arm64" + exit 1 +fi + +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi + + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi +fi + +# 1. make sure to remove old stable if any. +if dpkg --get-selections | grep -q "^google-chrome[[:space:]]*install$" >/dev/null; then + apt-get remove -y google-chrome +fi + +# 2. Update apt lists (needed to install curl and chrome dependencies) +apt-get update + +# 3. Install curl to download chrome +if ! command -v curl >/dev/null; then + apt-get install -y curl +fi + +# 4. download chrome stable from dl.google.com and install it. +cd /tmp +curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb +apt-get install -y ./google-chrome-stable_current_amd64.deb +rm -rf ./google-chrome-stable_current_amd64.deb +cd - +google-chrome --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh new file mode 100755 index 0000000..6aa650a --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -e +set -x + +rm -rf "/Applications/Google Chrome.app" +cd /tmp +curl --retry 3 -o ./googlechrome.dmg https://dl.google.com/chrome/mac/universal/stable/GGRO/googlechrome.dmg +hdiutil attach -nobrowse -quiet -noautofsck -noautoopen -mountpoint /Volumes/googlechrome.dmg ./googlechrome.dmg +cp -pR "/Volumes/googlechrome.dmg/Google Chrome.app" /Applications +hdiutil detach /Volumes/googlechrome.dmg +rm -rf /tmp/googlechrome.dmg +/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 new file mode 100644 index 0000000..7ca2dba --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 @@ -0,0 +1,24 @@ +$ErrorActionPreference = 'Stop' +$url = 'https://dl.google.com/tag/s/dl/chrome/install/googlechromestandaloneenterprise64.msi' + +$wc = New-Object net.webclient +$msiInstaller = "$env:temp\google-chrome.msi" +Write-Host "Downloading Google Chrome" +$wc.Downloadfile($url, $msiInstaller) + +Write-Host "Installing Google Chrome" +$arguments = "/i `"$msiInstaller`" /quiet" +Start-Process msiexec.exe -ArgumentList $arguments -Wait +Remove-Item $msiInstaller + + +$suffix = "\\Google\\Chrome\\Application\\chrome.exe" +if (Test-Path "${env:ProgramFiles(x86)}$suffix") { + (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo +} elseif (Test-Path "${env:ProgramFiles}$suffix") { + (Get-Item "${env:ProgramFiles}$suffix").VersionInfo +} else { + Write-Host "ERROR: Failed to install Google Chrome." + Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." + exit 1 +} diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh new file mode 100755 index 0000000..a1531a9 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +set -e +set -x + +if [[ $(arch) == "aarch64" ]]; then + echo "ERROR: not supported on Linux Arm64" + exit 1 +fi + +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi + + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi +fi + +# 1. make sure to remove old beta if any. +if dpkg --get-selections | grep -q "^microsoft-edge-beta[[:space:]]*install$" >/dev/null; then + apt-get remove -y microsoft-edge-beta +fi + +# 2. Install curl to download Microsoft gpg key +if ! command -v curl >/dev/null; then + apt-get update + apt-get install -y curl +fi + +# GnuPG is not preinstalled in slim images +if ! command -v gpg >/dev/null; then + apt-get update + apt-get install -y gpg +fi + +# 3. Add the GPG key, the apt repo, update the apt cache, and install the package +curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg +install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/ +sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list' +rm /tmp/microsoft.gpg +apt-get update && apt-get install -y microsoft-edge-beta + +microsoft-edge-beta --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh new file mode 100755 index 0000000..72ec3e4 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e +set -x + +cd /tmp +curl --retry 3 -o ./msedge_beta.pkg "$1" +# Note: there's no way to uninstall previously installed MSEdge. +# However, running PKG again seems to update installation. +sudo installer -pkg /tmp/msedge_beta.pkg -target / +rm -rf /tmp/msedge_beta.pkg +/Applications/Microsoft\ Edge\ Beta.app/Contents/MacOS/Microsoft\ Edge\ Beta --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 new file mode 100644 index 0000000..cce0d0b --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 @@ -0,0 +1,23 @@ +$ErrorActionPreference = 'Stop' +$url = $args[0] + +Write-Host "Downloading Microsoft Edge Beta" +$wc = New-Object net.webclient +$msiInstaller = "$env:temp\microsoft-edge-beta.msi" +$wc.Downloadfile($url, $msiInstaller) + +Write-Host "Installing Microsoft Edge Beta" +$arguments = "/i `"$msiInstaller`" /quiet" +Start-Process msiexec.exe -ArgumentList $arguments -Wait +Remove-Item $msiInstaller + +$suffix = "\\Microsoft\\Edge Beta\\Application\\msedge.exe" +if (Test-Path "${env:ProgramFiles(x86)}$suffix") { + (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo +} elseif (Test-Path "${env:ProgramFiles}$suffix") { + (Get-Item "${env:ProgramFiles}$suffix").VersionInfo +} else { + Write-Host "ERROR: Failed to install Microsoft Edge Beta." + Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." + exit 1 +} diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh new file mode 100755 index 0000000..7fde34e --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +set -e +set -x + +if [[ $(arch) == "aarch64" ]]; then + echo "ERROR: not supported on Linux Arm64" + exit 1 +fi + +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi + + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi +fi + +# 1. make sure to remove old dev if any. +if dpkg --get-selections | grep -q "^microsoft-edge-dev[[:space:]]*install$" >/dev/null; then + apt-get remove -y microsoft-edge-dev +fi + +# 2. Install curl to download Microsoft gpg key +if ! command -v curl >/dev/null; then + apt-get update + apt-get install -y curl +fi + +# GnuPG is not preinstalled in slim images +if ! command -v gpg >/dev/null; then + apt-get update + apt-get install -y gpg +fi + +# 3. Add the GPG key, the apt repo, update the apt cache, and install the package +curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg +install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/ +sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list' +rm /tmp/microsoft.gpg +apt-get update && apt-get install -y microsoft-edge-dev + +microsoft-edge-dev --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh new file mode 100755 index 0000000..3376e86 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e +set -x + +cd /tmp +curl --retry 3 -o ./msedge_dev.pkg "$1" +# Note: there's no way to uninstall previously installed MSEdge. +# However, running PKG again seems to update installation. +sudo installer -pkg /tmp/msedge_dev.pkg -target / +rm -rf /tmp/msedge_dev.pkg +/Applications/Microsoft\ Edge\ Dev.app/Contents/MacOS/Microsoft\ Edge\ Dev --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 new file mode 100644 index 0000000..22e6db8 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 @@ -0,0 +1,23 @@ +$ErrorActionPreference = 'Stop' +$url = $args[0] + +Write-Host "Downloading Microsoft Edge Dev" +$wc = New-Object net.webclient +$msiInstaller = "$env:temp\microsoft-edge-dev.msi" +$wc.Downloadfile($url, $msiInstaller) + +Write-Host "Installing Microsoft Edge Dev" +$arguments = "/i `"$msiInstaller`" /quiet" +Start-Process msiexec.exe -ArgumentList $arguments -Wait +Remove-Item $msiInstaller + +$suffix = "\\Microsoft\\Edge Dev\\Application\\msedge.exe" +if (Test-Path "${env:ProgramFiles(x86)}$suffix") { + (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo +} elseif (Test-Path "${env:ProgramFiles}$suffix") { + (Get-Item "${env:ProgramFiles}$suffix").VersionInfo +} else { + Write-Host "ERROR: Failed to install Microsoft Edge Dev." + Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." + exit 1 +} diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh new file mode 100755 index 0000000..4acb1db --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash + +set -e +set -x + +if [[ $(arch) == "aarch64" ]]; then + echo "ERROR: not supported on Linux Arm64" + exit 1 +fi + +if [ -z "$PLAYWRIGHT_HOST_PLATFORM_OVERRIDE" ]; then + if [[ ! -f "/etc/os-release" ]]; then + echo "ERROR: cannot install on unknown linux distribution (/etc/os-release is missing)" + exit 1 + fi + + ID=$(bash -c 'source /etc/os-release && echo $ID') + if [[ "${ID}" != "ubuntu" && "${ID}" != "debian" ]]; then + echo "ERROR: cannot install on $ID distribution - only Ubuntu and Debian are supported" + exit 1 + fi +fi + +# 1. make sure to remove old stable if any. +if dpkg --get-selections | grep -q "^microsoft-edge-stable[[:space:]]*install$" >/dev/null; then + apt-get remove -y microsoft-edge-stable +fi + +# 2. Install curl to download Microsoft gpg key +if ! command -v curl >/dev/null; then + apt-get update + apt-get install -y curl +fi + +# GnuPG is not preinstalled in slim images +if ! command -v gpg >/dev/null; then + apt-get update + apt-get install -y gpg +fi + +# 3. Add the GPG key, the apt repo, update the apt cache, and install the package +curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /tmp/microsoft.gpg +install -o root -g root -m 644 /tmp/microsoft.gpg /etc/apt/trusted.gpg.d/ +sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-stable.list' +rm /tmp/microsoft.gpg +apt-get update && apt-get install -y microsoft-edge-stable + +microsoft-edge-stable --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh new file mode 100755 index 0000000..afcd2f5 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -e +set -x + +cd /tmp +curl --retry 3 -o ./msedge_stable.pkg "$1" +# Note: there's no way to uninstall previously installed MSEdge. +# However, running PKG again seems to update installation. +sudo installer -pkg /tmp/msedge_stable.pkg -target / +rm -rf /tmp/msedge_stable.pkg +/Applications/Microsoft\ Edge.app/Contents/MacOS/Microsoft\ Edge --version diff --git a/mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 new file mode 100644 index 0000000..31fdf51 --- /dev/null +++ b/mock-project/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 @@ -0,0 +1,24 @@ +$ErrorActionPreference = 'Stop' + +$url = $args[0] + +Write-Host "Downloading Microsoft Edge" +$wc = New-Object net.webclient +$msiInstaller = "$env:temp\microsoft-edge-stable.msi" +$wc.Downloadfile($url, $msiInstaller) + +Write-Host "Installing Microsoft Edge" +$arguments = "/i `"$msiInstaller`" /quiet" +Start-Process msiexec.exe -ArgumentList $arguments -Wait +Remove-Item $msiInstaller + +$suffix = "\\Microsoft\\Edge\\Application\\msedge.exe" +if (Test-Path "${env:ProgramFiles(x86)}$suffix") { + (Get-Item "${env:ProgramFiles(x86)}$suffix").VersionInfo +} elseif (Test-Path "${env:ProgramFiles}$suffix") { + (Get-Item "${env:ProgramFiles}$suffix").VersionInfo +} else { + Write-Host "ERROR: Failed to install Microsoft Edge." + Write-Host "ERROR: This could be due to insufficient privileges, in which case re-running as Administrator may help." + exit 1 +} \ No newline at end of file diff --git a/mock-project/node_modules/playwright-core/browsers.json b/mock-project/node_modules/playwright-core/browsers.json new file mode 100644 index 0000000..9652f7d --- /dev/null +++ b/mock-project/node_modules/playwright-core/browsers.json @@ -0,0 +1,81 @@ +{ + "comment": "Do not edit this file, use utils/roll_browser.js", + "browsers": [ + { + "name": "chromium", + "revision": "1223", + "installByDefault": true, + "browserVersion": "148.0.7778.96", + "title": "Chrome for Testing" + }, + { + "name": "chromium-headless-shell", + "revision": "1223", + "installByDefault": true, + "browserVersion": "148.0.7778.96", + "title": "Chrome Headless Shell" + }, + { + "name": "chromium-tip-of-tree", + "revision": "1427", + "installByDefault": false, + "browserVersion": "149.0.7827.0", + "title": "Chrome Canary for Testing" + }, + { + "name": "chromium-tip-of-tree-headless-shell", + "revision": "1427", + "installByDefault": false, + "browserVersion": "149.0.7827.0", + "title": "Chrome Canary Headless Shell" + }, + { + "name": "firefox", + "revision": "1522", + "installByDefault": true, + "browserVersion": "150.0.2", + "title": "Firefox" + }, + { + "name": "firefox-beta", + "revision": "1512", + "installByDefault": false, + "browserVersion": "151.0b5", + "title": "Firefox Beta" + }, + { + "name": "webkit", + "revision": "2287", + "installByDefault": true, + "revisionOverrides": { + "mac14": "2251", + "mac14-arm64": "2251", + "debian11-x64": "2105", + "debian11-arm64": "2105", + "ubuntu20.04-x64": "2092", + "ubuntu20.04-arm64": "2092" + }, + "browserVersion": "26.4", + "title": "WebKit" + }, + { + "name": "ffmpeg", + "revision": "1011", + "installByDefault": true, + "revisionOverrides": { + "mac12": "1010", + "mac12-arm64": "1010" + } + }, + { + "name": "winldd", + "revision": "1007", + "installByDefault": false + }, + { + "name": "android", + "revision": "1001", + "installByDefault": false + } + ] +} diff --git a/mock-project/node_modules/playwright-core/cli.js b/mock-project/node_modules/playwright-core/cli.js new file mode 100755 index 0000000..f275a03 --- /dev/null +++ b/mock-project/node_modules/playwright-core/cli.js @@ -0,0 +1,21 @@ +#!/usr/bin/env node +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const { libCli, libCliTestStub } = require('./lib/coreBundle'); +const { program } = require('./lib/utilsBundle'); +libCli.decorateProgram(program); +libCliTestStub.decorateProgram(program); +program.parse(process.argv); diff --git a/mock-project/node_modules/playwright-core/index.d.ts b/mock-project/node_modules/playwright-core/index.d.ts new file mode 100644 index 0000000..97c1493 --- /dev/null +++ b/mock-project/node_modules/playwright-core/index.d.ts @@ -0,0 +1,17 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './types/types'; diff --git a/mock-project/node_modules/playwright-core/index.js b/mock-project/node_modules/playwright-core/index.js new file mode 100644 index 0000000..e845cfa --- /dev/null +++ b/mock-project/node_modules/playwright-core/index.js @@ -0,0 +1,32 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const minimumMajorNodeVersion = 18; +const currentNodeVersion = process.versions.node; +const semver = currentNodeVersion.split('.'); +const [major] = [+semver[0]]; + +if (major < minimumMajorNodeVersion) { + console.error( + 'You are running Node.js ' + + currentNodeVersion + + '.\n' + + `Playwright requires Node.js ${minimumMajorNodeVersion} or higher. \n` + + 'Please update your version of Node.js.' + ); + process.exit(1); +} + +module.exports = require('./lib/coreBundle').inprocess.playwright; diff --git a/mock-project/node_modules/playwright-core/index.mjs b/mock-project/node_modules/playwright-core/index.mjs new file mode 100644 index 0000000..3b3c75b --- /dev/null +++ b/mock-project/node_modules/playwright-core/index.mjs @@ -0,0 +1,28 @@ +/** + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import playwright from './index.js'; + +export const chromium = playwright.chromium; +export const firefox = playwright.firefox; +export const webkit = playwright.webkit; +export const selectors = playwright.selectors; +export const devices = playwright.devices; +export const errors = playwright.errors; +export const request = playwright.request; +export const _electron = playwright._electron; +export const _android = playwright._android; +export default playwright; diff --git a/mock-project/node_modules/playwright-core/package.json b/mock-project/node_modules/playwright-core/package.json new file mode 100644 index 0000000..2ac3960 --- /dev/null +++ b/mock-project/node_modules/playwright-core/package.json @@ -0,0 +1,34 @@ +{ + "name": "playwright-core", + "version": "1.60.0", + "description": "A high-level API to automate web browsers", + "repository": { + "type": "git", + "url": "git+https://github.com/microsoft/playwright.git" + }, + "homepage": "https://playwright.dev", + "engines": { + "node": ">=18" + }, + "author": { + "name": "Microsoft Corporation" + }, + "license": "Apache-2.0", + "exports": { + ".": { + "types": "./index.d.ts", + "import": "./index.mjs", + "require": "./index.js", + "default": "./index.js" + }, + "./package.json": "./package.json", + "./lib/bootstrap": "./lib/bootstrap.js", + "./lib/coreBundle": "./lib/coreBundle.js", + "./lib/utilsBundle": "./lib/utilsBundle.js", + "./lib/tools/cli-client/program": "./lib/tools/cli-client/program.js" + }, + "bin": { + "playwright-core": "cli.js" + }, + "types": "types/types.d.ts" +} diff --git a/mock-project/node_modules/playwright-core/types/protocol.d.ts b/mock-project/node_modules/playwright-core/types/protocol.d.ts new file mode 100644 index 0000000..14b1122 --- /dev/null +++ b/mock-project/node_modules/playwright-core/types/protocol.d.ts @@ -0,0 +1,24565 @@ +// This is generated from /utils/protocol-types-generator/index.js +type binary = string; +export namespace Protocol { + export namespace Accessibility { + /** + * Unique accessibility node identifier. + */ + export type AXNodeId = string; + /** + * Enum of possible property types. + */ + export type AXValueType = "boolean"|"tristate"|"booleanOrUndefined"|"idref"|"idrefList"|"integer"|"node"|"nodeList"|"number"|"string"|"computedString"|"token"|"tokenList"|"domRelation"|"role"|"internalRole"|"valueUndefined"; + /** + * Enum of possible property sources. + */ + export type AXValueSourceType = "attribute"|"implicit"|"style"|"contents"|"placeholder"|"relatedElement"; + /** + * Enum of possible native property sources (as a subtype of a particular AXValueSourceType). + */ + export type AXValueNativeSourceType = "description"|"figcaption"|"label"|"labelfor"|"labelwrapped"|"legend"|"rubyannotation"|"tablecaption"|"title"|"other"; + /** + * A single source for a computed AX property. + */ + export interface AXValueSource { + /** + * What type of source this is. + */ + type: AXValueSourceType; + /** + * The value of this property source. + */ + value?: AXValue; + /** + * The name of the relevant attribute, if any. + */ + attribute?: string; + /** + * The value of the relevant attribute, if any. + */ + attributeValue?: AXValue; + /** + * Whether this source is superseded by a higher priority source. + */ + superseded?: boolean; + /** + * The native markup source for this value, e.g. a `