feat: add E2E tests for CDP connections and MV3 service workers#127
Merged
feat: add E2E tests for CDP connections and MV3 service workers#127
Conversation
Add comprehensive E2E tests for critical browser functionality: **CDP Connection Tests (e2e_combined_flow_test.go)** - TestExtensionViewportThenCDPConnection: Tests CDP connections work correctly after back-to-back Chromium restarts (extension upload → viewport change → CDP) - TestMultipleCDPConnectionsAfterRestart: Tests rapid successive CDP connections after a Chromium restart **MV3 Service Worker Tests (e2e_mv3_service_worker_test.go)** - TestMV3ServiceWorkerRegistration: Verifies MV3 extensions with service workers are properly loaded and responsive - Includes test extension with service worker that responds to ping messages - Playwright script pierces chrome://extensions shadow DOM to verify status **Chromium Launcher Fix** - Add killExistingChromium() to ensure clean restarts - Fixes race condition where old process holds IPv4 port during restart Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
The killExistingChromium function was using `pkill -f chromium` which matches any process with "chromium" in its command line. This included chromium-launcher itself, causing it to SIGKILL itself immediately on startup. Changed to `pkill -x chromium` which uses exact process name matching, so it only kills the actual chromium browser process without matching chromium-launcher. This fixes all CI tests failing with exit status 137 (SIGKILL). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Details
CDP Connection Tests (
e2e_combined_flow_test.go)TestExtensionViewportThenCDPConnection - Reproduces the scenario where profile loading fails to connect to CDP after back-to-back restarts:
Browser.getVersioncommand succeedsTestMultipleCDPConnectionsAfterRestart - Tests connection stability:
MV3 Service Worker Tests (
e2e_mv3_service_worker_test.go)TestMV3ServiceWorkerRegistration - Verifies MV3 extensions work correctly:
/chromium/upload-extensions-and-restartchrome://extensionsand enable developer modeIncludes a test extension (
server/e2e/test-extension/) with:Chromium Launcher Fix
Added
killExistingChromium()function that:Test plan
TestExtensionViewportThenCDPConnectionpassesTestMultipleCDPConnectionsAfterRestartpassesTestMV3ServiceWorkerRegistrationpasses🤖 Generated with Claude Code
Note
Adds robust E2E coverage for browser restarts, CDP connectivity, and MV3 service workers, plus a launcher hardening to ensure clean Chromium restarts.
TestExtensionViewportThenCDPConnectionandTestMultipleCDPConnectionsAfterRestartvalidate CDP stability after extension upload and viewport-change restarts and multiple rapid connectse2e_mv3_service_worker_test.go) with Playwright commandverify-mv3-service-workerto inspectchrome://extensions, confirm active service worker, and verify popup -> SW messagingserver/e2e/test-extension/and expands Playwrightindex.tswith the verification flow; updatestsconfig.jsonlibs to includeDOMserver/cmd/chromium-launcher/main.go) now callskillExistingChromium()topkill -9 -x chromiumand wait up to 2s before relaunch, preventing IPv4/IPv6 bind conflictsWritten by Cursor Bugbot for commit 2babbd1. This will update automatically on new commits. Configure here.