End-to-end UI and API test automation framework for 21vek.by built with Playwright and TypeScript.
| Tool | Purpose |
|---|---|
| Playwright | Browser automation & API testing |
| TypeScript | Type-safe test development |
| Allure | Test reporting with rich UI |
| ESLint | Code linting |
| Prettier | Code formatting |
| Docker | Containerized test execution |
| GitHub Actions | CI pipeline |
| Jenkins | CI/CD pipeline |
21-vek/
├── .github/workflows/ # GitHub Actions CI workflow
├── api/ # API request helpers
├── fixtures/ # Playwright test fixtures (UI & API)
├── pages/ # Page Object Model
│ ├── BasePage.ts
│ ├── components/ # Shared base components
│ └── home/ # Home page & its components
│ ├── HomePage.ts
│ └── components/ # Header, Modals, Search, Cart, etc.
├── tests/
│ ├── api/ # API tests (auth, catalog, cart)
│ └── ui/ # UI tests (login, logout, purchase, search)
├── utils/ # Utilities (config, login, session)
├── Dockerfile # Docker image for headless execution
├── Jenkinsfile # Jenkins pipeline definition
├── playwright.config.ts # Playwright configuration
└── package.json
- Node.js >= 20 LTS
- npm >= 9
- Java JDK/JRE >= 11 (required for Allure CLI)
npm ci
npx playwright install --with-depsCopy the example environment file and fill in your credentials:
cp .env.example .env.env.example contents:
BASE_URL=https://www.21vek.by
LOGIN_EMAIL=your_email@example.com
LOGIN_PASSWORD=your_password
NAME=YourName
npm test| Command | Description |
|---|---|
npm run test:ui |
UI tests only (Chromium) |
npm run test:api |
API tests only |
npm run test:smoke |
Smoke suite (@smoke tag) |
npm run test:regression |
Regression suite (@regression tag) |
| Command | Description |
|---|---|
npm run test:chrome |
Run in Chromium |
npm run test:headed |
Run in headed mode |
npm run test:debug |
Run with Playwright Inspector |
npm run test:parallel |
Run with 4 workers |
npm run lint # ESLint check
npm run lint:fix # ESLint auto-fix
npm run format # Prettier formatThe project generates two types of reports: Playwright HTML and Allure.
npm run reportOpens the built-in Playwright HTML report from playwright-report/.
Generate and open the Allure report:
npm run report:allureOr step by step:
# Generate report from results
npm run report:allure:generate
# Open report in browser
npm run report:allure:open
# Clean previous results
npm run report:allure:cleanAllure results are written to allure-results/ and the generated report goes to allure-report/.
docker build -t 21vek-tests .docker run --rm \
-e BASE_URL=https://www.21vek.by \
-e LOGIN_EMAIL=your_email \
-e LOGIN_PASSWORD=your_password \
21vek-tests# Run tests and keep the container
docker run --name test-run 21vek-tests
# Copy reports to host
docker cp test-run:/app/allure-results ./allure-results
docker cp test-run:/app/playwright-report ./playwright-report
# Generate Allure report locally
npm run report:allure:generate
# Cleanup
docker rm test-runThe workflow (.github/workflows/playwright.yml) runs on every pull request to main and can be triggered manually.
Pipeline stages:
- Lint & Type Check -- ESLint + TypeScript compilation check
- E2E Tests -- Runs Playwright tests in the official Playwright Docker container
- Reports -- Uploads Allure results, Allure report, and Playwright HTML report as artifacts
Required repository secrets: BASE_URL, LOGIN_EMAIL, LOGIN_PASSWORD, NAME.
The Jenkinsfile defines a declarative pipeline with the following stages:
- Checkout -- Pulls source code
- Install -- Installs npm dependencies and Playwright browsers
- Test -- Runs the full Playwright test suite
- Generate Allure Report -- Generates the Allure report from results
The pipeline integrates with the Allure Jenkins Plugin for in-dashboard report viewing.
Required Jenkins credentials: BASE_URL, LOGIN_EMAIL, LOGIN_PASSWORD.
ISC