A Playwright test automation project for end-to-end testing.
This project uses Playwright for browser automation and testing. The project has been set up with:
- TypeScript for type-safe test authoring
- Multi-browser testing support (Chrome, Firefox, Safari)
- Parallel test execution
- HTML reporting
- Screenshot capture
- Ensure you have Node.js installed
- Clone this repository
- Install dependencies:
npm install
The following npm scripts are available:
npm test
- Run all tests in all browsersnpm run test:ui
- Run tests with the Playwright UI modenpm run test:chrome
- Run tests only in Chromenpm run test:firefox
- Run tests only in Firefoxnpm run test:safari
- Run tests only in Safari (WebKit)npm run test:debug
- Run tests in debug modenpm run report
- Show the HTML test reportnpm run codegen
- Generate tests using the Playwright code generator
tests/
- Contains test files (example.spec.ts and custom-test.spec.ts)tests-examples/
- Contains demo examples provided by Playwrightplaywright.config.ts
- Playwright configuration filetest-results/
- Screenshots and other test artifacts
Tests are written using the Playwright test framework. Here's a basic example:
import { test, expect } from '@playwright/test';
test('basic test', async ({ page }) => {
await page.goto('https://example.com');
await expect(page).toHaveTitle(/Example/);
});
For more information, visit the Playwright documentation.