This repository contains the UI automation framework for the 🌐 simple web application. The framework is built using 🎭 Playwright, tests are written in 🔠 Typescript, with 🏃 Jest as the test runner, 📈 Allure for test reporting, and 🎲 Faker for test data generation.
├───.github
│ └───workflows
├───docs # contains the documentation
├───config # contains the configuration files for each environment
│ ├───dev.env
│ ├───prod.env
│ └───qa.env
├───pages # contains the page objects for each page
| ├───home-page.ts
| ├───login-page.ts
| ├───product-page.ts
| ├───shopping-cart-page.ts
| └───checkout-page.ts
├───tests # contains the test files
| ├───checkout.test.ts
| ├───login.test.ts
| ├───product.test.ts
| ├───shopping-cart.test.ts
| └───test-data.ts
├───global-setup.ts # contains the global setup
├───playwright.config.ts # contains the playwright configuration
├───allure-results # contains the allure results
npm init playwright@latest
Check the installation by running the following command:
npx playwright --version
Run all tests in headless mode:
npm test
Run all tests in headed mode:
npm run test:headed
To lint the code, run the following command:
npm run lint
Also husky
is configured in the project to run the linting and formatting on every commit.
To generate the allure report, run the following command:
npm run generate:allure:report
To open the allure report, run the following command:
npm run open:allure:report
The CI/CD pipeline, configured with GitHub Actions, triggers on every push to the main branch. It runs tests in:
-
🌐 Development
-
🌐 QA
-
🌐 Production ...and across browsers:
-
🌐 Chrome
-
🌐 Firefox
-
🌐 Webkit
GitHub workflow file: .github/workflows/playwright.yml
Allure reports are generated and published via GitHub Pages.
Questions? Reach out to us at 📧 beemi.raja@gmail.com