This is a Playwright-based frontend test automation framework for testing the Sauce Demo website.
Note: This Entire Frontend Test Automation Framework has been Generated by Bolt.new, AI Web Search Agent https://bolt.new/
https://jaykishore999.blogspot.com/2025/02/playwright-test-automation-framework.html
├── tests/
│ ├── fixtures/
│ │ └── users.json # Test data
│ ├── pages/
│ │ ├── login.page.js # Login page object
│ │ └── inventory.page.js # Inventory page object
│ ├── login.spec.js # Login tests
│ └── inventory.spec.js # Inventory tests
└── playwright.config.js # Playwright configuration
- Clone this repository
- Install dependencies:
npm install
- Install Playwright browsers:
npx playwright install
# Run all tests
npm run test:one
# Run tests in headed mode
npm run test:headed
# Run tests in UI mode
npm run test:ui
# View test report
npm run report
-
Login Functionality
- Successful login with valid credentials
- Error handling for locked out user
- Error handling for invalid credentials
-
Inventory Page
- Adding items to cart
- Product sorting
- Product count verification
- The framework uses Page Object Model (POM) design pattern
- Test data is maintained in JSON fixtures
- Cross-browser testing is configured but limited to Chromium in this setup
- Screenshots and videos are captured only on test failures