/playwright-automation-test-framework

UI Automation framework with Playwright & Allure reporting

Primary LanguageTypeScriptMIT LicenseMIT

🌟 Playwright UI Automation Framework 🌟

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.

Table of Contents 📚

alt text

Project Structure 🏷️

├───.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

Installation 🔨

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

Reporting 📊

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

CI/CD 🚀

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.

Contact 📬

Questions? Reach out to us at 📧 beemi.raja@gmail.com