CI capabilities
| Capability | What it gives you |
|---|---|
| Quality gates | Enforce lint, build, and test checks before merge |
| Browser-target confidence | Build and validate multiple browser targets consistently |
| Reproducible environments | Lock toolchain versions across local and CI runs |
| Debuggable failures | Publish test reports and artifacts for investigation |
Core pipeline stages
- Install dependencies
- Run lint/check commands
- Build browser targets
- Run automated tests (including Playwright where applicable)
- Upload artifacts/reports
Minimal GitHub Actions example
Build matrix example
Playwright in CI
- Install browsers in CI job (
playwright installor equivalent). - Keep retries slightly higher on CI than local.
- Publish Playwright reports/artifacts for failed runs.
- Use
dist/extension-js/<browser>/ready.jsonas readiness contract before launching Playwright. - Avoid parsing human-readable logs in CI automation scripts.
- Prefer the built-in wait commands:
extension dev --wait --browser=<browser>(watch/dev) orextension start --wait --browser=<browser>(production/start). - For scripts or CI automation, prefer
--wait-format=json.
Example readiness gate
Test handlers without a browser UI
You don’t always need Playwright. For event handlers — the toolbar action, keyboard commands — Extension.js can fire them directly against a dev session and you assert on the side effect. It’s deterministic and headless, so it’s a reliable gate.extension open command --name <cmd>). See Trigger actions and commands for the result payloads and the one caveat (replay carries no user gesture, so activeTab is not granted).
Docker and container CI
When CI runs inside Docker or a dev container, pass--host 0.0.0.0 so external processes can reach the dev server. If another process already occupies the default port, use --port 0 for automatic port assignment.
Common pitfalls
- CI scripts diverging from local scripts over time
- Building only one browser target while shipping to multiple engines
- Missing artifact upload for failed E2E jobs
- Mixing unpinned Node/package manager versions across workflows
.github/workflows/e2e.yml
Best practices
- Keep CI commands close to local scripts to reduce drift.
- Fail fast on lint/config errors before expensive browser jobs.
- Cache dependencies and browser binaries when possible.
- Version lock CI Node and package manager versions for reproducibility.
Next steps
- Add or refine Playwright E2E tests.
- Review commands reference for script alignment.

