Skip to content

nevzattalhaozcan/saucedemo-automation

Repository files navigation

Saucedemo Automation

Automated end-to-end tests for saucedemo.com using Playwright.

Features

  • Login tests (including data-driven from JSON and CSV)
  • Product listing and sorting tests
  • Cart and checkout flow tests
  • Page Object Model structure
  • CI integration with GitHub Actions (sharded test runs, HTML reports)

Getting Started

Prerequisites

Installation

npm install

Environment Variables

Create a .env file in the project root with:

USERNAME=your_saucedemo_username
PASSWORD=your_saucedemo_password
BASE_URL=https://www.saucedemo.com

Running Tests Locally

npx playwright test

To run a specific test file:

npx playwright test tests/login.spec.ts

Viewing HTML Reports

After running tests:

npx playwright show-report

Test Data

Project Structure

  • pages/ - Page Object Model classes
  • tests/ - Test suites
  • utils/ - Helper utilities
  • fixtures/ - Playwright fixtures
  • .github/workflows/ - GitHub Actions CI config

Continuous Integration

Tests run automatically on push/PR via GitHub Actions workflow, with sharding and HTML report upload.

Useful Commands

  • Install Playwright browsers:
    npx playwright install --with-deps
  • Run tests with sharding:
    npx playwright test --shard=1/2
    npx playwright test --shard=2/2

About

Small Playwright Framework for Saucedemo Website UI Testing

Resources

Stars

Watchers

Forks