Skip to content

JayKishoreDuvvuri/Playwright-JavaScript-with-AI

Repository files navigation

Sauce Demo - Frontend Test Automation Framework

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/

Project Documentation

https://jaykishore999.blogspot.com/2025/02/playwright-test-automation-framework.html

Project Structure

├── 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

Setup Instructions

  1. Clone this repository
  2. Install dependencies:
    npm install
  3. Install Playwright browsers:
    npx playwright install

Running Tests

# 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

Test Coverage

  1. Login Functionality

    • Successful login with valid credentials
    • Error handling for locked out user
    • Error handling for invalid credentials
  2. Inventory Page

    • Adding items to cart
    • Product sorting
    • Product count verification

Important Notes

  • 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

About

Playwright with JavaScript Page Object Model with AI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages