https://github.com/jptrp/saucedemo-playwright
Playwright + TypeScript automation framework for SauceDemo with comprehensive test coverage
https://github.com/jptrp/saucedemo-playwright
automation automation-testing playwright playwright-tests playwright-typescript pomme qa qa-automation test-automation testing typescript
Last synced: about 2 months ago
JSON representation
Playwright + TypeScript automation framework for SauceDemo with comprehensive test coverage
- Host: GitHub
- URL: https://github.com/jptrp/saucedemo-playwright
- Owner: jptrp
- Created: 2025-11-15T21:51:42.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-11-15T22:28:46.000Z (7 months ago)
- Last Synced: 2025-11-16T00:19:24.204Z (7 months ago)
- Topics: automation, automation-testing, playwright, playwright-tests, playwright-typescript, pomme, qa, qa-automation, test-automation, testing, typescript
- Language: TypeScript
- Homepage:
- Size: 1.58 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
π§ͺ Playwright UI Automation Framework
Modern, maintainable end-to-end automation using Playwright, TypeScript, and the Page Object Model.
---
## π― Why This Project Matters
**Most QA portfolios only show simple scripts. This repo demonstrates real-world automation capability:**
- β
**Clean Architecture** - Page Object Model pattern with proper encapsulation and reusability
- β
**Comprehensive Coverage** - 25+ tests across authentication, inventory, cart, and checkout flows
- β
**Production-Ready** - CI/CD pipeline with GitHub Actions, automated testing on every push
- β
**Modern Stack** - TypeScript with Playwright, following current industry standards
- β
**Best Practices** - Centralized test data, JSDoc documentation, AAA test pattern
- β
**Robust Selectors** - Data-test attributes and defensive locator strategies
- β
**Cross-Browser** - Configured for Chromium, Firefox, and WebKit testing
- β
**Professional Reporting** - HTML reports with screenshots and videos on failure
- β
**Maintainable** - DRY principles, clear naming conventions, and comprehensive comments
**This isn't just test automationβit's a scalable framework that shows enterprise-level thinking.**
---
## π¬ Demo

*Automated end-to-end checkout flow running in Chromium*
---
## π Overview
A production-ready UI automation framework built using Playwright, TypeScript, and the Page Object Model (POM) pattern.
This project demonstrates clean automation architecture, comprehensive test coverage, and CI/CD integration β all aligned with real-world QA Engineer workflows.
π **Documentation**:
- [Test Strategy](./docs/TestStrategy.md) - Comprehensive testing approach and methodology
- [Test Plan](./docs/TestPlan.md) - Detailed test planning and execution strategy
- [Architecture](./docs/Architecture.md) - Framework design and technical architecture
---
## π Tech Stack
- Playwright (TypeScript)
- Page Object Model (POM)
- GitHub Actions (Continuous Integration)
- Node.js
- HTML Reporter
- Cross-browser testing (Chromium, Firefox, WebKit)
---
## π Project Structure
```text
saucedemo-playwright/
βββ tests/ # Test specs
β βββ login.spec.ts
β βββ inventory.spec.ts
β βββ cart.spec.ts
β βββ checkout.spec.ts
β
βββ pages/ # Page Object Model classes
β βββ BasePage.ts
β βββ LoginPage.ts
β βββ InventoryPage.ts
β βββ CartPage.ts
β βββ CheckoutPage.ts
β
βββ fixtures/ # Test data
β βββ testData.ts
β
βββ playwright.config.ts # Global Playwright settings
βββ package.json
β
βββ .github/workflows/ # CI pipeline
βββ playwright.yml
```
---
## π§ͺ Features & Tests Included
### βοΈ Login tests
- Valid login
- Invalid login (error validation)
### βοΈ Inventory tests
- Add item to cart
- Navigate from inventory β cart
### βοΈ Cart & Checkout tests
- Start checkout
- Fill user information
- Complete the purchase
- Validate confirmation screen
### βοΈ Page Object Model (POM)
- LoginPage
- InventoryPage
- CartPage
- CheckoutPage
- BasePage (shared functionality)
### βοΈ CI Integration
- GitHub Actions workflow triggers on push and pull requests
- Ensures all tests run headless in CI
---
## βΆοΈ Running Tests Locally
Install dependencies:
```bash
npm install
```
Run all Playwright tests:
```bash
npx playwright test
```
View the HTML test report:
```bash
npx playwright show-report
```
Run tests in headed mode:
```bash
npx playwright test --headed
```
Run a specific test file:
```bash
npx playwright test tests/login.spec.ts
```
---
## π€ Continuous Integration (CI)
GitHub Actions workflow automatically runs:
- `npm ci`
- Install Playwright browsers
- All test specs
- Generate report artifacts
On:
- Push to main
- Pull requests
Workflow file: `.github/workflows/playwright.yml`