An open API service indexing awesome lists of open source software.

https://github.com/beemi/playwright-automation-test-framework

UI Automation framework with Playwright & Allure reporting
https://github.com/beemi/playwright-automation-test-framework

allure-report allure2 automation-test github-actions playwright playwright-typescript

Last synced: 2 months ago
JSON representation

UI Automation framework with Playwright & Allure reporting

Awesome Lists containing this project

README

          

# 🎭 Playwright UI Automation Framework 🎭

[![Playwright](https://img.shields.io/badge/Playwright-1.44.0-blue)](https://playwright.dev/)
[![Typescript](https://img.shields.io/badge/Typescript-4.9.5-blue)](https://www.typescriptlang.org/)
[![Allure](https://img.shields.io/badge/Allure-2.13.8-blue)](https://docs.qameta.io/allure/)
[![Node](https://img.shields.io/badge/Node-14.17.6-green)](https://nodejs.org/en/)
[![Npm](https://img.shields.io/badge/Npm-6.14.15-green)](https://www.npmjs.com/)

## 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](#project-structure)
- [Installation](#installation)
- [Lint and Format](#lint-and-format)
- [Reporting](#reporting)
- [CI/CD](#cicd)
- [Contact](#contact)

## Project Structure πŸ“

```angular2html
β”œβ”€β”€β”€.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 πŸ› 

```bash
npm init playwright@latest
```

Check the installation by running the following command:

```bash
npx playwright --version
```

Run all tests in headless mode:

```bash
npm test
```

Run all tests in headed mode:

```bash
npm run test:headed
```

### Lint 🧹 and Format 🎨

To lint the code, run the following command:

```bash
npm run lint
```

Also `husky` is configured in the project to run the linting and formatting on every commit.

:warning: _**Note:**_ Git commit message should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format.

### Reporting πŸ“Š

[Allure GitHub](https://allurereport.org/docs/integrations-github/)

To generate the allure report, run the following command:

```bash
npm run generate:allure:report
```

To open the allure report, run the following command:

```bash

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](mailto:beemi.raja@gmail.com)

```

```