MCPInstall
pw-demo-mcp logo

pw-demo-mcp

by dreamquality dreamquality/pw-demo-mcp

Playwright test automation framework demo with TypeScript and Page Object Model pattern.

READMEmain

SauceDemo Automated Tests

This project contains automated tests for the SauceDemo website using Playwright.

Prerequisites

  • Node.js (v14 or higher)
  • npm (comes with Node.js)

Setup

  1. Install dependencies:
npm install
  1. Install Playwright browsers:
npx playwright install

Running Tests

Run all tests in headless mode:

npm test

Run tests with browser visible:

npm run test:headed

Run tests with Playwright UI mode:

npm run test:ui

View the last test report:

npm run report

Project Structure

  • src/pages/ - Page Object Models
  • src/tests/ - Test files
    • e2e/ - End-to-end tests
    • integration/ - Integration tests
    • api/ - API tests
  • src/fixtures/ - Test data
  • src/types/ - TypeScript interfaces
  • src/utils/ - Utility functions
  • playwright.config.ts - Playwright configuration
  • package.json - Project dependencies and scripts

Features

  • Page Object Model implementation
  • Cross-browser testing (Chrome, Firefox, Safari)
  • HTML report generation
  • Parallel test execution
  • Automatic retries in CI
  • Screenshot on test failure