A modern, maintainable test automation framework built with Playwright and TypeScript, following ISTQB standards and best practices.
- Page Object Model design pattern
- Cross-browser testing support
- Parallel test execution
- Allure reporting with detailed steps and attachments
- Screenshot and video capture on failure
- Environment management
- API testing support
- TypeScript type safety
- Comprehensive logging
- Custom test fixtures
- Data-driven testing with CSV support
- Behavior-driven test organization with Allure labels
- Node.js (v16 or higher)
- npm (v7 or higher)
- Supported browsers (Chrome, Firefox, Safari)
- Clone the repository:
git clone <repository-url>
cd playwright-framework
- Install dependencies:
npm install
- Install Playwright browsers:
npx playwright install --with-deps
- Environment Variables:
Create a
.env.{environment}
file (e.g.,.env.dev
,.env.staging
) with:
BASE_URL=<your-application-url>
API_KEY=<your-api-key>
LOG_LEVEL=info
- Update test data in:
src/data/constants.ts
for static test datatests/data/*.csv
for data-driven tests
# Run all tests
npm test
# Run tests with UI mode
npm run test:ui
# Run tests in headed mode
npm run test:headed
# Run specific test file
npm test tests/e2e/login.spec.ts
# Run tests with specific tag
npm run test:smoke
npm run test:regression
# Run tests in specific browser
npm test -- --project=chromium
npm test -- --project=firefox
npm test -- --project=webkit
# Generate and open Allure report
npm run report
playwright-framework/
βββ src/
β βββ pages/ # Page Object Models
β βββ fixtures/ # Custom test fixtures
β βββ helpers/ # Helper functions
β βββ data/ # Test data and constants
β βββ utils/ # Utility functions
βββ tests/
β βββ e2e/ # End-to-end tests
β βββ api/ # API tests
β βββ data/ # Test data files (CSV, JSON)
βββ config/ # Configuration files
βββ docs/ # Documentation
βββ reports/ # Test reports
-
Test Categories
- E2E Tests:
@e2e
- API Tests:
@api
- Smoke Tests:
@smoke
- Regression Tests:
@regression
- E2E Tests:
-
Allure Labels
- Epic: High-level feature area
- Feature: Specific feature
- Story: User story or test scenario
- Follow Page Object Model pattern
- Write descriptive test names
- Use data-testid for element selectors
- Keep tests independent
- Use appropriate waiting strategies
- Handle errors gracefully
- Document new features and changes
- Use Allure steps for better reporting
- Implement data-driven tests where applicable
- Add TypeScript type checking in CI pipeline
-
VS Code Extension
- Install the Playwright VS Code extension for better development experience
- Use the test generator to create tests
- Debug tests directly in VS Code
-
Trace Viewer
- View test execution timeline
- Inspect DOM snapshots
- Analyze network requests
- Debug test failures
-
UI Mode
- Interactive test development
- Time travel debugging
- Watch mode for tests
For support, please open an issue in the repository.