Skip to content

feat: add e2e testing with Playwright and mock OIDC server#12

Merged
16 commits merged into
mainfrom
feat/e2e-testing
May 11, 2026
Merged

feat: add e2e testing with Playwright and mock OIDC server#12
16 commits merged into
mainfrom
feat/e2e-testing

Conversation

@ryanbas21
Copy link
Copy Markdown
Owner

Summary

  • Add top-level e2e/ package with Playwright for browser integration tests
  • Mock OIDC server (Hono) with /.well-known/openid-configuration, /authorize, /token, and /userinfo endpoints
  • Test page fixture that triggers a full OIDC flow
  • Playwright extension fixture that builds and loads the extension in Chromium
  • Panel page helpers for interacting with the Elm UI

Tests

Test file What it verifies
extension-loads.test.ts Service worker registers, panel loads, Elm mounts
network-capture.test.ts NETWORK_EVENT pipeline through service worker to panel
panel-renders-events.test.ts SDK event injection, clear button
firefox-build.test.ts Firefox manifest validity, dist files, no cross-contamination
mock-oidc-server/server.test.ts All mock OIDC endpoints respond correctly

CI

  • Chrome e2e tests run with xvfb-run (headed mode required for extensions)
  • Firefox build verification runs without a browser
  • Mock server unit tests run with vitest

Test plan

  • Mock OIDC server unit tests pass (4/4)
  • Firefox build verification tests pass (2/2)
  • All 295 existing unit tests pass
  • Chrome e2e tests pass in CI (requires xvfb)

🤖 Generated with Claude Code

ryanbas21 and others added 16 commits May 10, 2026 18:52
… endpoints

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rinfo requests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Replace __dirname with import.meta.dirname (ESM modules)
- Use spawnSync with process.execPath instead of execSync
- Fix relative paths from e2e/tests/ and e2e/fixtures/ (need ../../)
- Move build step to CI (Playwright workers can't spawn node)
- Simplify firefox-build test to verify output only (no in-test builds)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ests from Chrome run

- Remove spawnSync build from extension fixture (CI builds before e2e)
- Exclude "firefox build" tests from Chrome e2e run (they need Firefox build first)
- Run firefox-build tests after the Firefox build step

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… dir

- Share browser context across tests in same worker (avoid re-launching)
- Use mkdtempSync for user data dir instead of empty string
- Add --no-first-run and --disable-default-apps flags
- Set workers: 1 to serialize Chrome tests
- Remove unused launchOptions from playwright config (fixture handles launch)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add CLAUDE.md with agent skills config (issue tracker, triage labels, domain docs)
- Add docs/agents/ with GitHub issue tracker, triage labels, and domain doc conventions
- Add mattpocock/skills (.agents/skills/) for diagnose, tdd, triage, etc.
- Add .claude/skills/ symlinks for Claude Code skill discovery
- Ignore .claude/settings.local.json (machine-specific permissions)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ght builtin collision

Playwright registers 'context' as a built-in test-scoped fixture.
Renaming to 'extensionContext' avoids the conflict and uses a
module-level singleton to share the browser instance across tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ryanbas21 ryanbas21 closed this pull request by merging all changes into main in 3132936 May 11, 2026
@ryanbas21 ryanbas21 deleted the feat/e2e-testing branch May 12, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant