A production-grade end-to-end test automation framework built with Playwright and JavaScript, featuring a fully automated CI/CD pipeline with a live test dashboard hosted on GitHub Pages.
π Live Dashboard
- Features
- Tech Stack
- Project Structure
- Getting Started
- Running Tests
- CI/CD Pipeline
- Test Dashboard
- Configuration
- Cross-browser testing across Chrome, Firefox, Safari and Edge
- Automated HTML and JSON report generation on every run
- Live test dashboard with run history, pass rates and trend charts hosted on GitHub Pages
- Auto-cleanup of old reports to keep the repository lean
- Fully automated CI/CD via GitHub Actions β no external tools or paid services required
| Tool | Purpose |
|---|---|
| Playwright | Test framework |
| GitHub Actions | CI/CD pipeline |
| GitHub Pages | Dashboard hosting |
| Node.js 22 | Runtime |
playwright-demo-js/
βββ .github/
β βββ scripts/
β β βββ generate-dashboard.js # Builds the live HTML dashboard
β β βββ generate-dashboard-local.js # Run dashboard locally with mock data
β βββ workflows/
β βββ run-tests.yml # Runs Playwright tests on demand
β βββ publish-report.yml # Publishes report to GitHub Pages
βββ e2e/
β βββ example.spec.js # Test specs
βββ playwright.config.js # Playwright configuration
βββ package.json
βββ README.md
- Node.js >= 22
- npm
# Clone the repository
git clone https://github.com/jay-yeluru/playwright-demo-js.git
cd playwright-demo-js
# Install dependencies
npm install
# Install Playwright browsers
npx playwright installnpm testnpm run test:chrome
npm run test:firefox
npm run test:safari
npm run test:edgenpm run test:smokenpm run show-reportnpm run dashboard:localThe pipeline is split into two workflows:
Triggered manually via workflow_dispatch. Allows selecting the browser to run tests on.
Inputs:
browser: chrome | firefox | safari | edge (default: chrome)
Steps:
- Checkout repository
- Setup Node.js 22
- Install dependencies via
npm ci - Install Playwright browsers
- Run tests
- Upload reports as artifacts
Triggered automatically after run-tests.yml completes (pass or fail).
Steps:
- Checkout
gh-pagesbranch - Fetch the dashboard generator script
- Download reports artifact
- Regenerate dashboard with updated history
- Commit and push to
gh-pages
The live dashboard is hosted at https://jay-yeluru.github.io/playwright-demo-js/ and updates automatically after every CI run.
- Stats cards β Total runs, passed runs, failed runs and overall pass rate
- Sparkline chart β Pass rate trend across the last 20 runs
- Latest run banner β Quick summary of the most recent run with a direct report link
- Run history table β Full history with status, branch, browser, pass/fail counts, pass rate bar and link to the full Playwright HTML report
- Auto-cleanup β Keeps the latest 10 runs per branch (configurable via
KEEP_RUNS)
- Create an orphan
gh-pagesbranch:
git switch --orphan gh-pages
git commit --allow-empty -m "init: gh-pages"
git push origin gh-pages
git checkout develop-
Go to Settings β Pages β Source, select
gh-pagesbranch and/ (root) -
Go to Settings β Actions β General β Workflow permissions and enable Read and write permissions
| Option | Value | Description |
|---|---|---|
testDir |
./e2e |
Test files location |
outputDir |
test-artifacts |
Screenshots, traces, videos |
timeout |
30000ms |
Per-test timeout |
retries |
2 (CI) / 0 (local) |
Retry on failure |
workers |
1 (CI) / auto (local) |
Parallel workers |
reporter (CI) |
html, json, github |
CI reporters |
reporter (local) |
html, json, list |
Local reporters |
reports/
index.html β Playwright HTML report
test-results.json β JSON report (used by dashboard generator)
test-artifacts/ β Screenshots, videos, traces
| Variable | Description | Default |
|---|---|---|
BRANCH |
Git branch name | required |
RUN_ID |
GitHub Actions run ID | required |
BROWSER |
Browser used for the run | required |
REPORT_PATH |
Path to the downloaded reports | required |
KEEP_RUNS |
Number of runs to keep per branch | 10 |
ISC Β© Jay Yeluru