A CI-ready Playwright framework for post-deployment, black-box validation of critical user journeys.
- Smoke tests for deployment health and critical routes.
- Optional authenticated user-flow validation (login + post-login assertion).
- CI pipeline (
GitHub Actions) with test reports/artifact upload. - Environment-driven behavior so you can run against staging, pre-prod, or production without code changes.
- Install dependencies:
npm install
- Copy and configure env:
cp .env.example .env
- Run tests locally:
npm run test:e2e
Required:
BASE_URL: Deployment URL under test.
Optional:
HEALTHCHECK_PATH(default/health)CRITICAL_PATHS(comma-separated, default/)EXPECTED_TITLE_REGEX(default.*)LOGIN_*+ selector variables for optional authenticated flow.
If LOGIN_USERNAME and LOGIN_PASSWORD are unset, the authenticated flow test is automatically skipped.
GitHub Actions workflow: .github/workflows/playwright-e2e.yml
Set the following in GitHub repository settings:
- Secrets:
BASE_URL,LOGIN_USERNAME,LOGIN_PASSWORD - Variables (optional): route paths and selectors (
HEALTHCHECK_PATH,CRITICAL_PATHS, etc.)
The workflow runs on pull requests, pushes to main, and manual dispatch, then uploads HTML/JUnit reports as artifacts.
npm run test:e2e— run full suite.npm run test:e2e:smoke— run smoke checks only.npm run test:e2e:headed— run headed mode locally.npm run report:e2e— open HTML report.