A professional end-to-end testing setup for a Node.js login page using Playwright and GitHub Actions CI.
# Install dependencies
npm install
# Install Playwright browsers (required once)
npx playwright install chromium
# Run tests (starts the server automatically)
npm testexample-case/
├── server.js # Express login server
├── public/
│ ├── login.html # Login page
│ └── dashboard.html # Post-login dashboard
├── tests/
│ └── login.spec.js # Playwright E2E tests
├── playwright.config.js # Playwright configuration
├── .github/workflows/
│ └── playwright.yml # GitHub Actions CI
└── TEST-REPORTING.md # How results are collected & reported
| Test | Flow | Expected |
|---|---|---|
| Valid login | testuser / Test123! |
Redirect to dashboard |
| Invalid login | Wrong credentials | Error message |
| Empty credentials | Submit empty form | Validation |
| Locked account | locked / Locked123! |
Account locked message |
The workflow runs on pull requests to main or master:
- Checks out code
- Installs Node.js and dependencies
- Runs Playwright tests
- Uploads HTML report and test results as artifacts
See TEST-REPORTING.md for details on how results are reported to the team.
npm test # Run tests (headless)
npm run test:ui # Run with Playwright UI
npm run test:headed # Run with visible browser
npm start # Start server only (for manual testing)We are just updating to test the CI