A robust End-to-End (E2E) test automation framework built with Playwright and TypeScript. This project automates the critical user journeys of the "Swag Labs" e-commerce demo site (SauceDemo).
This repository demonstrates a production-grade automation architecture designed for scalability, maintainability, and stability.
Key Features:
- Page Object Model (POM): Modular design separating test logic from page selectors.
- CI/CD Integration: Automated pipeline using GitHub Actions to run tests on every push.
- Dynamic Interactions: Handling of list filtering, locator chaining, and form manipulation.
- Reporting: HTML reports with attached screenshots and traces for failed tests.
- Authentication: Validating user login with credentials.
- Inventory Management: Dynamic filtering and adding specific products to the cart.
- Checkout Flow: Full E2E journey from Cart -> Checkout Information -> Order Completion.
- Language: TypeScript
- Framework: Playwright Test
- Runtime: Node.js
- CI/CD: GitHub Actions
1. Clone the repository
git clone [https://github.com/YOUR_USERNAME/swag-automator.git](https://github.com/YOUR_USERNAME/swag-automator.git)
cd swag-automator2. Install dependencies
npm install
npx playwright install --with-deps3. Run the tests
# Run all tests in headless mode
npx playwright test
# Run tests with UI header (to see the browser)
npx playwright test --headed4. View the Report
npx playwright show-report├── .github/workflows # CI/CD Pipeline configuration
├── pages/ # Page Object Models (Selectors & Actions)
│ ├── LoginPage.ts
│ ├── InventoryPage.ts
│ └── CheckoutPage.ts
├── tests/ # Test Specifications (.spec.ts)
├── playwright.config.ts # Global configuration
└── package.json