Skip to content

beemi/playwright-automation-test-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎭 Playwright UI Automation Framework 🎭

Playwright Typescript Allure Node Npm

Introduction 📝

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 📚

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

Lint 🧹 and Format 🎨

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.

⚠️ Note: Git commit message should follow the Conventional Commits format.

Reporting 📊

Allure GitHub

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