This project uses Playwright for end-to-end (E2E) testing and Allure for beautiful test reporting.
- ✅ End-to-end testing with Playwright
- ✅ Automatic screenshots and videos on test failure
- ✅ Allure reports (with screenshots, videos, traces)
- ✅ Test parallelization and retries
- ✅ Headless and headed modes
- ✅ Easy setup and usage
npm install
npm install -g allure-commandline
ℹ️ If
allure
is not found, you can usenpx allure
or install Java (Allure needs Java).
If Java is missing, install it:
- Mac:
brew install openjdk
- Windows: Download from https://adoptium.net/
npx playwright test
npx playwright test --headed
npx playwright test tests/example.spec.ts
npx allure generate ./allure-results --clean -o ./allure-report
npx allure open ./allure-report
├── tests/
│ ├── example.spec.ts # Test files
│
├── pages/
│ ├── inventoryPage.ts # Page Object Models (POM)
│
├── allure-results/ # Raw Allure test results (generated after test run)
├── allure-report/ # Final HTML report (generated)
├── playwright.config.ts # Playwright configuration
├── package.json
└── README.md
import { defineConfig } from '@playwright/test';
export default defineConfig({
reporter: [
['list'],
['allure-playwright'],
],
use: {
video: 'retain-on-failure',
screenshot: 'only-on-failure',
trace: 'retain-on-failure',
},
});
- 🎥 Videos recorded only on test failure
- 📸 Screenshots captured on failure
- 🧩 Allure reporter integrated
Command | Description |
---|---|
npx playwright test |
Run all tests |
npx playwright test --headed |
Run tests with visible browser |
npx playwright show-report |
Show Playwright's own HTML report |
npx allure generate |
Generate Allure report |
npx allure open |
Open Allure report |
- Allure reports require Java installed to work properly.
- Clean old results before generating new reports with
--clean
. - Customize
playwright.config.ts
for different environments (staging, production, etc.).
This project is licensed under the MIT License.