|
| 1 | + |
| 2 | +# π Playwright Test Automation Framework (TypeScript) |
| 3 | + |
| 4 | +This is a robust end-to-end Test Automation Framework built using **Playwright** and **TypeScript**. It supports cross-browser testing, rich reporting using **Allure**, and integrates seamlessly with **GitHub Actions CI/CD pipelines**. |
| 5 | + |
| 6 | +--- |
| 7 | + |
| 8 | +## π Features |
| 9 | + |
| 10 | +- β
TypeScript-based Playwright tests |
| 11 | +- β
Page Object Model (POM) |
| 12 | +- β
Parallel execution |
| 13 | +- β
Cross-browser support (Chromium, Firefox, WebKit) |
| 14 | +- β
Allure reporting |
| 15 | +- β
CI/CD via GitHub Actions |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +## π§ͺ Running Tests Locally |
| 20 | + |
| 21 | +```bash |
| 22 | +# Install dependencies |
| 23 | +npm ci |
| 24 | + |
| 25 | +# Run all Playwright tests |
| 26 | +npx playwright test |
| 27 | + |
| 28 | +# Run in headed mode |
| 29 | +npx playwright test --headed |
| 30 | + |
| 31 | +# Generate Allure report |
| 32 | +npm run allure:generate |
| 33 | + |
| 34 | +# Open Allure report in browser |
| 35 | +npm run allure:open |
| 36 | +```` |
| 37 | + |
| 38 | +> Make sure Playwright browsers are installed: |
| 39 | + |
| 40 | +```bash |
| 41 | +npx playwright install |
| 42 | +``` |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +## π Project Structure |
| 47 | + |
| 48 | +``` |
| 49 | +e2e-playwright-framework/ |
| 50 | +βββ tests/ # Test specs |
| 51 | +βββ pages/ # Page Object Models |
| 52 | +βββ fixtures/ # Shared test fixtures |
| 53 | +βββ utils/ # Custom utilities |
| 54 | +βββ storage/ # Session files |
| 55 | +βββ allure-results/ # Allure raw data |
| 56 | +βββ allure-report/ # Allure HTML reports |
| 57 | +βββ playwright.config.ts # Playwright test config |
| 58 | +βββ .github/workflows/ # GitHub Actions workflows |
| 59 | +``` |
| 60 | +
|
| 61 | +--- |
| 62 | +
|
| 63 | +## β
GitHub Actions CI/CD |
| 64 | +
|
| 65 | +This project uses **GitHub Actions** to automate test execution on each commit or pull request. |
| 66 | +
|
| 67 | +### π When it Runs |
| 68 | +
|
| 69 | +* On every push to the `main` branch |
| 70 | +* On every pull request |
| 71 | +
|
| 72 | +### π Workflow Location |
| 73 | +
|
| 74 | +``` |
| 75 | +.github/workflows/playwright.yml |
| 76 | +``` |
| 77 | +
|
| 78 | +### π Manual Trigger |
| 79 | +
|
| 80 | +1. Go to the **Actions** tab in GitHub. |
| 81 | +2. Select the **"Playwright Tests"** workflow. |
| 82 | +3. Click **"Run workflow"** (top-right dropdown). |
| 83 | +
|
| 84 | +### π CI Artifacts |
| 85 | +
|
| 86 | +* π§ͺ `playwright-report/` β HTML report of test run |
| 87 | +* π `allure-results/` β Raw Allure results |
| 88 | +* π `allure-report/` β Rich HTML Allure report (on demand) |
| 89 | +
|
| 90 | +--- |
| 91 | +
|
| 92 | +## π¦ NPM Scripts |
| 93 | +
|
| 94 | +Add these to your `package.json`: |
| 95 | +
|
| 96 | +```json |
| 97 | +"scripts": { |
| 98 | + "test": "npx playwright test", |
| 99 | + "test:headed": "npx playwright test --headed", |
| 100 | + "allure:generate": "allure generate --clean allure-results", |
| 101 | + "allure:open": "allure open allure-report" |
| 102 | +} |
| 103 | +``` |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## π€ Contributing |
| 108 | + |
| 109 | +1. Fork this repo |
| 110 | +2. Create a new feature branch |
| 111 | +3. Submit a PR after testing |
| 112 | + |
| 113 | +--- |
| 114 | + |
| 115 | +## π License |
| 116 | + |
| 117 | +MIT Β© 2025 Ramakrishna Jangatisetty |
0 commit comments