Skip to content

JayAshton/playwright-boxed

Repository files navigation

🎭 Playwright Boxed

A ready-to-use Playwright testing framework with best practices and useful utilities/configuration already set up. Use this as a starter template for UI automation, accessibility checks, visual regression, and performance testing — all out of the box.

Features

  • Preconfigured Playwright setup (major browsers, CI-ready)
  • ESLint with TypeScript & Playwright rules
  • Axe Core integration for accessibility testing
  • Global setup/teardown hooks
  • Page Object Model (POM) structure
  • Parameterized tests, test steps examples
  • Visual testing examples
  • Multi-tab & multi-browser windows support
  • UI performance testing capabilities with Lighthouse
  • GitHub Actions Workflow example

Getting started

Clone the repo & install dependencies:

git clone https://github.com/your-org/playwright-boxed.git
cd playwright-boxed
npm ci
npx playwright install --with-deps

Alternatively, select the "Use this template" option

Running tests

Use either the provided npm scripts e.g. npm run test

Alternatively, use the playwright CLI:

npx playwright test path-to-file.spec.ts --project=chromium

Useful CLI commands

  • --headed - run tests in headed mode
  • --workers <number> - overwrite number of workers
  • --grep <regex> - run tests matching the provided regex e.g. tags like @smoke
  • --ui - open UI Mode
  • --debug - run in debug mode and open the inspector

Many other options available in the playwright docs

Debugging tests

Pausing test execution

You can use await page.pause() as a debugger and pause test execution at that point. Tests must be run in headed mode and will also open the inspector window.

Trace Viewer

Traces can be turned on in the playwright configuration, either globally or per project (same for screenshots and videos) e.g:

use: {
  trace: "retain-on-failure",
  video: "retain-on-failure",
  screenshot: "only-on-failure",
},

You can then open the trace viewer with: npx playwright show-trace trace-path/trace.zip

To be added:

  • API requests
  • Request mocking
  • Device emulation tests
  • Locale switching
  • Geolocation switching
  • Data factory - faker
  • Popups/new windows
  • MCP prompts

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors