How qa-learning-hub/e2e-automation-template-playwright works
Project Type and Purpose
• This is an E2E Automation Framework template, not a business application.
• Purpose: provide a scalable, maintainable foundation for UI and API tests using Playwright, TypeScript, POM, and CI integration.
File Structure
• src/pages: Page Object Model (POM) classes representing UI screens.
• src/utils: shared helpers (dataGenerator, dateUtils, validators).
• tests/ui and tests/api: test suites (UI spec files and API spec files).
• playwright.config.ts + env.config.ts: test configuration and environment settings.
• .github/workflows/playwright-tests.yml: CI workflow.
• package.json: dependencies (Playwright, Allure, TypeScript, etc.).
Extract Additional Insights from README
• Uses Page Object Model pattern.
• CI via GitHub Actions: install deps, install browsers, run tests, generate Allure report.
• Generates screenshots, videos, and Allure results.
a. Local/Developer Environment
• Node.js + npm
• Playwright CLI & Browsers (Chromium, Firefox, WebKit)
• TypeScript compiler (tsc)
b. Test Artifacts
• POM Classes (src/pages)
• Utility Modules (src/utils)
• UI Tests (tests/ui/*.spec.ts)
• API Tests (tests/api/*.spec.ts)
c. Configuration
• playwright.config.ts (projects, reporters, timeouts)
• env.config.ts (environment URLs, credentials)
d. CI/CD Pipeline
• GitHub Actions workflow
• Steps: checkout → npm install → npx playwright install → run UI & API tests → generate Allure results → publish artifacts
e. Reporting
• Allure-results & allure-report
• Screenshots & videos for failures
Relationships and Interactions
• Developer triggers npm test or npx playwright test, which:
1. Reads playwright.config.ts & env.config.ts
2. Compiles TypeScript → loads POM classes & utils
3. Executes UI tests: POM → HTTP/browser → Application Under Test (AUT)
4. Executes API tests: Playwright request → backend endpoints
5. Collects logs, screenshots, videos, and test results
6. Generates Allure reports
• CI pipeline automates the same sequence on each push/PR.
Architectural Patterns & Principles
• Page Object Model (separation of page definitions from test logic)
• Single Responsibility (utils vs. page objects vs. specs)
• Config-driven (env.config.ts + playwright.config.ts)
• Modular tests (UI vs. API)
Technologies & Frameworks
• Node.js, npm
• TypeScript, ts-node
• Playwright (test runner, browser automation)
• GitHub Actions (CI)
• Allure Playwright (reporting)
• ESLint & Prettier (code quality)
Final Checklist
• [ ] Components: Dev machine, CI server, AUT/API endpoint
• [ ] Modules: src/pages, src/utils, tests/ui, tests/api, config files
• [ ] Workflows: CLI commands, GitHub Actions steps
• [ ] Data flows: test execution → AUT/API → reporting