-
Notifications
You must be signed in to change notification settings - Fork 0
Add Playwright browser installation scripts for GitHub Copilot environment #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: dwarwick <15970276+dwarwick@users.noreply.github.com>
Co-authored-by: dwarwick <15970276+dwarwick@users.noreply.github.com>
Co-authored-by: dwarwick <15970276+dwarwick@users.noreply.github.com>
|
@copilot please run the playwright tests using the website https://davidtest.xyz as the website url |
I ran the Playwright tests against The domain cannot be resolved from the GitHub Copilot environment: $ curl -I https://davidtest.xyz
curl: (6) Could not resolve host: davidtest.xyzTest Results:
The Playwright browsers are installed correctly and working - the issue is that Would you like me to test against a different URL, or did you want to configure access to davidtest.xyz first? Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Problem
GitHub Copilot agents need to be able to install and run Playwright browsers for end-to-end testing, but the standard Playwright CLI installation (
pwsh playwright.ps1 install) fails in sandboxed environments with a known issue:This prevents Copilot agents from running Playwright tests, limiting their ability to validate UI changes and test end-to-end workflows.
Solution
This PR adds automated installation scripts that handle browser installation reliably in the GitHub Copilot environment:
Installation Scripts
scripts/install-playwright-browsers.sh(Bash)scripts/install-playwright-browsers.ps1(PowerShell)Both scripts use a two-pronged approach:
~/.cache/ms-playwright/chromium-1129/)The fallback method bypasses the problematic progress tracking in the Playwright CLI while maintaining compatibility with the existing test infrastructure.
Verification Scripts
scripts/verify-playwright-installation.sh(Bash)scripts/verify-playwright-installation.ps1(PowerShell)These scripts verify the installation by launching Chromium in headless mode and testing basic functionality (page creation and content rendering).
Documentation
scripts/PLAYWRIGHT_BROWSER_INSTALLATION.md- Comprehensive installation guide with troubleshootingscripts/README.md- Quick reference for all scriptsPLAYWRIGHT_INSTALLATION_ANSWER.md- Detailed explanation of the solutionAGENTS.mdwith instructions for GitHub Copilot agentsUsage
GitHub Copilot agents can now install browsers with a single command:
Or verify installation:
Testing
All scripts have been tested and verified:
~/.cache/ms-playwright/) is compatible with existingPlaywrightHelper.csImpact
This change enables GitHub Copilot agents to:
No changes to existing test code were required - the scripts work seamlessly with the current
JwtIdentity.PlaywrightTestsinfrastructure.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
example.com/home/REDACTED/.cache/ms-playwright/chromium-1129/chrome-linux/chrome --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=ImprovedCookieControls,LazyFrameLoading,GlobalMediaControls,DestroyProfileOnBrowserClose,MediaRouter,DialMediaRouteProvider,AcceptCHFrame,AutoExpandDetailsElement,CertificateTransparencyComponentUpdater,AvoidUnnecessaryBeforeUnloadCheckSync,Translate,HttpsUpgrades,PaintHolding,PlzDedicatedWorker --allow-pre-commit-input --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --no-service-autorun --export-tagged-pdf --disable-search-engine-choice-screen --unsafely-disable-devtools-self-xss-warnings --headless=old --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --user-data-dir=/tmp/playwright_chromiumdev_profile-XXXXXXVF0ecg --remote-debugging-pipe --no-startup-window(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.