How hussain257-git/saucedemo-playwrightautomation works
This is a Playwright/TypeScript automation framework for validating Sauce Demo and demonstrating API, network, browser-control, and cross-context behavior. Its primary workflow is to prepare reusable authenticated sessions, exercise the shopping journey from login and inventory through cart and checkout, and verify completion. The README documents the broader test branches; sampled source confirms selected page-object behavior and configuration, so uncertain test-to-page call wiring is omitted.
Main entry points: playwright.config.ts Playwright projects · test-fixtures.ts Custom fixtures · auth.setup.ts Auth setup · inventory.page.ts Inventory page
Components 26
Test execution
- Playwright projects
playwright.config.ts - Auth setup
tests/setup/auth.setup.ts - Authentication tests
tests/functional/auth.spec.ts - Session reuse tests
tests/functional/auth-storage-state.spec.ts - Functional tests
tests/functional
Shopping journey
- Checkout journey
tests/e2e/checkout-flow.spec.ts - Login page
src/pages/login.page.ts - Inventory page
src/pages/inventory.page.ts - Cart page
src/pages/cart.page.ts - Customer details
src/pages/checkout-step-one.page.ts - Order summary
src/pages/checkout-step-two.page.ts - Order confirmation
src/pages/checkout-complete.page.ts
Automation capabilities
- REST API tests
tests/api/api-testing.spec.ts - Network mocking
tests/network/network-mocking.spec.ts - Browser controls
tests/advanced-ui - Public demo tests
tests/public-demo/browser-controls.spec.ts - Controls sandbox
tests/fixtures/advanced-controls.html
Shared support
- Custom fixtures
src/fixtures/test-fixtures.ts - Test data factory
src/utils/test-data-factory.ts - Environment settings
src/config/environment.ts - Product test data
src/data/products-data.json
Other components
- Automation engineer
- Sauce Demo
- JSONPlaceholder API
- DemoQA
- Playwright browser
Connections 35
- Automation engineer → Playwright projects: starts run
- Playwright projects → Auth setup: runs setup
- Playwright projects → Authentication tests: runs tests
- Playwright projects → Session reuse tests: runs tests
- Playwright projects → Checkout journey: runs tests
- Playwright projects → Functional tests: runs tests
- Playwright projects → REST API tests: runs tests
- Playwright projects → Network mocking: runs tests
- Playwright projects → Browser controls: runs tests
- Playwright projects → Public demo tests: runs project
- Auth setup → Sauce Demo: authenticates
- Auth setup → Playwright browser: saves session
- Session reuse tests → Playwright browser: reuses session
- Checkout journey → Custom fixtures: uses fixtures
- Custom fixtures → Login page: provides page
- Custom fixtures → Inventory page: provides page
- Custom fixtures → Cart page: provides page
- Custom fixtures → Customer details: provides page
- Custom fixtures → Order summary: provides page
- Custom fixtures → Order confirmation: provides page
- Login page → Sauce Demo: drives login
- Inventory page → Sauce Demo: drives catalog
- Cart page → Sauce Demo: drives cart
- Customer details → Sauce Demo: drives details
- Order summary → Sauce Demo: checks summary
- Order confirmation → Sauce Demo: checks confirmation
- Network mocking → Playwright browser: intercepts traffic
- Playwright browser → Sauce Demo: sends requests
- REST API tests → JSONPlaceholder API: sends API requests
- REST API tests → Test data factory: creates payloads
- Browser controls → Playwright browser: controls browser
- Browser controls → Controls sandbox: opens local page
- Public demo tests → DemoQA: tests controls
- Playwright projects → Environment settings: reads settings
- Inventory page → Product test data: uses test data