GitHub Actions
Pre-built GitHub Actions workflow for Wocha auth testing with the offline emulator and matrix framework support
This guide provides a reusable GitHub Actions pattern for running Wocha auth tests in CI. It starts the offline auth emulator, waits for readiness, runs your test suite, and tears down cleanly.
Composite action pattern
Create .github/actions/wocha-test/action.yml in your repository:
Note: Composite actions cannot run background processes across steps. For production CI, use a workflow job step (see below) rather than stopping the emulator inside the composite action.
Recommended workflow
Matrix testing across frameworks
Run the same auth smoke tests against multiple framework example apps:
Cloud API tests with test-mode keys
When CI must hit the real Customer API, use a wocha_test_ key stored as a GitHub secret:
Create the test key in the Console (Settings → API Keys → Test mode) or via the API with "mode": "test".
Reporting test results
Upload Playwright traces or JUnit reports as artefacts:
Troubleshooting
| Symptom | Fix |
|---|---|
| Emulator not ready | Increase health-check retries; confirm port 4400 is free |
| OAuth redirect mismatch | Register http://localhost:3000/api/auth/callback or your CI app URL |
| Tests hit production | Set WOCHA_EMULATOR=true or use wocha_test_ keys only |
@wocha/cli not found | Add @wocha/cli to devDependencies or use npx |