Skip to content

Repository files navigation

SauceDemo Playwright Tests

End-to-end test automation for saucedemo.com using Playwright and TypeScript, built with the Page Object Model.

Current Coverage

  • 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.

Tech Stack

  • Playwright (TypeScript)
  • Page Object Model architecture
  • GitHub Actions for CI

Prerequisites

  • Node.js (LTS)
  • npm

Setup

git clone https://github.com/Ruby20-50/saucedemo-playwright-tests.git
cd saucedemo-playwright-tests
npm install
npx playwright install --with-deps

Running the tests

npx playwright test

Runs across Chromium, Firefox, and WebKit as configured in playwright.config.ts. After the run, view the HTML report:

npx playwright show-report

run and detect the automated test

npx playwright test --ui

Continuous Integration

Every push and pull request to main triggers a GitHub Actions workflow (.github/workflows/playwright.yml) with two jobs:

  1. Lint — runs ESLint across the codebase; the pipeline stops here if this fails.
  2. 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).

Project Structure

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

Roadmap

  • Page Objects and specs for inventory, cart, and checkout flows
  • Broader assertion coverage per page (sorting, item details, cart totals)

About

End-to-end test automation for SauceDemo using Playwright and TypeScript, following the Page Object Model.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages