Skip to content

Commit 93955d3

Browse files
committed
docs(readme): update documentation formatting and content
- Fix markdown linting errors (MD022, MD032, MD031, MD040) - Add blank lines around headings and code blocks - Update project structure section - Improve formatting consistency throughout
1 parent 6528ed7 commit 93955d3

File tree

1 file changed

+0
-0
lines changed

1 file changed

+0
-0
lines changed

README.md

4.13 KB

PlaywrightTesting

Overview

This repository contains automated end-to-end UI tests for SauceDemo using Playwright and TypeScript.

It covers the full user workflow: login → browse products → add to cart → checkout → logout.
Tests follow the AAA (Arrange-Act-Assert) pattern and demonstrate professional QA practices.


Features

  • Login tests (positive/negative)
  • Full shopping flow: products → cart → checkout → logout
  • AAA pattern for clarity and maintainability
  • Reusable login helper
  • CI/CD integration (GitHub Actions)
  • HTML test reports

Prerequisites

  • Node.js >= 18
  • npm >= 9

Installation

git clone https://github.com/ln0185/PlaywrightTesting.git
cd PlaywrightTesting
npm install
npx playwright install --with-deps

Running Tests Locally

# Run all tests
npx playwright test

# Run tests in headed mode (useful for debugging)
npx playwright test --headed

# Generate HTML report
npx playwright show-report

Project Structure

tests/ ├─ login.spec.ts # Login tests ├─ shoppingFlow.spec.ts # Full end-to-end shopping flow including logout ├─ helpers.ts # Reusable login helper

playwright.config.ts # Playwright configuration package.json # Node dependencies README.md # Project documentation test-results/ # Raw test outputs playwright-report/ # HTML reports .github/workflows/ # GitHub Actions CI config

GitHub Actions CI

The project is set up to run tests automatically in GitHub Actions.

Common Issues & Fixes

Browser download issues: Ensure browsers are installed using npx playwright install --with-deps.

Headless failures: Some tests may fail in headless mode. Use --headed for debugging locally.

Environment variables: Make sure any required secrets or URLs are set in GitHub Actions.

Contributing

Pull requests are welcome. Please ensure tests pass locally before pushing.

License

MIT License

0 commit comments

Comments
 (0)