test(e2e): real-browser SW-health + GitHub round-trip tests#60
Merged
Conversation
Adds the e2e coverage that would have caught #57 (dead service worker): - sw-health.spec.ts: loads the unpacked extension and asserts the SW actually registered (created the gitmarks:poll alarm). A SW that crashes on load never gets that far. No credentials needed. - reconcile-roundtrip.spec.ts: true end-to-end against GitHub — adds a native bookmark, completes setup, asserts the live SW writes it to bookmarks.json in the repo. Skips unless e2e/.env.e2e provides a throwaway repo + scoped PAT. playwright.config loads e2e/.env.e2e (no dotenv dep); .env.example documents the format; .env* is gitignored. Both tests verified passing locally against a real Chromium + real GitHub repo. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
The tests that would have caught #57 (and the whole 'never ran in a browser' saga).
sw-health.spec.ts— loads the unpacked extension, asserts the service worker registered (created thegitmarks:pollalarm). A SW that crashes on load never reaches that line. No creds needed → runnable anywhere.reconcile-roundtrip.spec.ts— true end-to-end against GitHub: adds a native bookmark, completes setup, asserts the live SW writes it tobookmarks.jsonin the repo. Skips unlesse2e/.env.e2eprovides a throwaway repo + scoped fine-grained PAT (.env.exampledocuments it;.env*gitignored).Both verified passing locally against real Chromium + a real GitHub repo (sw-health 0.4s; round-trip 4.2s).
Follow-up: wire the no-creds SW-health test into CI (needs xvfb for headed extension loading) so a dead SW blocks merges.
🤖 Generated with Claude Code