This repository contains end-to-end automated tests written in Playwright with TypeScript.
The suite validates core user-facing functionality of the Automation Exercise website, including: • User registration and login • Negative validation messages (e.g., wrong credentials, duplicate email) • Adding products to the cart • Cart detail verification (name, price, quantity) • Modal visibility and link navigation • Tag-based test grouping: @regression, @negative, @smoke, @e2e
Target website: https://automationexercise.com
The project follows a clean Page Object Model (POM) structure with reusable methods, custom locators, and fixtures using base.fixture.ts.
- A complete Playwright test automation framework
- Page Object Model (POM) structure with reusable methods and locators
- Tag-based test grouping for flexible test execution
- GitHub Actions CI integration
- HTML test report generated after each run
git clone https://github.com/srmiljus/TA_Playwright_TypeScript_Ecommerce.git
cd TA_Playwright_TypeScript_Ecommercenpm cinpx playwright install --with-depsYou can override default settings like BASE_URL by creating a .env file in the project root:
BASE_URL=https://www.automationexercise.comGitHub Actions automatically copies
.envto.env.localduring test execution.
npx playwright testnpx playwright test --grep @smoke
npx playwright test --grep @regression
npx playwright test --grep @negative
npx playwright test --grep @e2e
npx playwright test --project=chromium
npx playwright test --project=firefox
npx playwright test --project=webkit
npx playwright show-report- Uses a clean Page Object Model (POM) structure
- Uses fixtures to inject Page Object classes
- Allure reporter for rich test results
- Tags used to organize tests:
@smoke,@regression,@negative,@e2e - API validations included for signup and cleanup
- Verifies expected error messages and URL transitions
- Supports both functional and UI-level validation
- Tests are executed on Chromium, Firefox and Webkit in CI
- Mobile/responsive testing is not included
- Allure reports are uploaded as CI artifacts, not viewable via GitHub Pages
- API stubbing is not used; tests rely on real responses
GitHub Actions workflow:
- Runs on every push or PR to
mainormaster - Supports manual triggering with dropdowns for:
- Test tag selection (
@smoke,@regression,@negative,all,@e2e) - Browser selection (
chromium,firefox,webkit,all)
- Test tag selection (
- Generates and uploads Allure and HTML reports as artifacts
Workflow file: .github/workflows/playwright.yml
Test results are stored as artifacts in GitHub Actions:
- Allure Report: Generated via Allure CLI and stored in
allure-report/ - Playwright HTML Report: Stored in
reports/
To view reports locally:
npx playwright show-reportTo view Allure report locally:
npx allure serve allure-results- Playwright - v1.52+
- TypeScript - v5.8+
- Node.js - v20+
- GitHub Actions - CI/CD integration
- HTML Reporting - Playwright HTML & Allure
TA_Playwright_TypeScript_Ecommerce/
│
├── .github/workflows/ # GitHub Actions workflow config
├── allure-report/ # Allure HTML report output
├── allure-results/ # Allure raw results
├── pageObjects/ # Page Object classes & locators
├── reports/ # Playwright HTML report output
├── test-results/ # Playwright test outputs
├── tests/
│ ├── constants/ # Test constants (URLs, messages, etc.)
│ ├── fixtures/ # Custom base.fixture.ts
│ ├── specs/ # Grouped specs (login, signup, product)
│ ├── testData/ # Example users and test input data
│ ├── types/ # Shared TS types
│ └── utils/ # Custom helpers (e.g., API helpers)
├── .env # Local environment variables
├── .gitignore
├── package.json # Project dependencies
├── package-lock.json # Dependency lock file
├── playwright.config.ts # Playwright configuration
├── testData.json # Sample input data (external JSON)
└── tsconfig.json # TypeScript configuration