End-to-end test automation for saucedemo.com using Playwright and TypeScript, built with the Page Object Model.
- Login
- Standard user can log in successfully
- Locked-out user sees the correct error message
More pages (inventory, cart, checkout) are planned as the suite grows.
- Playwright (TypeScript)
- Page Object Model architecture
- GitHub Actions for CI
- Node.js (LTS)
- npm
git clone https://github.com/Ruby20-50/saucedemo-playwright-tests.git
cd saucedemo-playwright-tests
npm install
npx playwright install --with-depsnpx playwright testRuns across Chromium, Firefox, and WebKit as configured in playwright.config.ts. After the run, view the HTML report:
npx playwright show-reportrun and detect the automated test
npx playwright test --uiEvery push and pull request to main triggers a GitHub Actions workflow (.github/workflows/playwright.yml) with two jobs:
- Lint — runs ESLint across the codebase; the pipeline stops here if this fails.
- Test — runs the Playwright suite in parallel across Chromium, Firefox, and WebKit (matrix strategy), only if lint passes.
npm dependencies are cached between runs to speed up installs. The HTML report from each browser run is uploaded as a workflow artifact, viewable from the Actions tab on GitHub for 30 days (see .github/workflows/playwright.yml).
tests/
├── login.spec.ts # Login test scenarios
└── pages/
└── LoginPage.ts # Page Object for the login page (locators + actions)
playwright.config.ts # Playwright configuration (browsers, reporter, retries)
.github/workflows/
└── playwright.yml # CI workflow
- Page Objects and specs for inventory, cart, and checkout flows
- Broader assertion coverage per page (sorting, item details, cart totals)