Skip to content

An end-to-end test automation framework built using Playwright for reliable, fast, and cross-browser testing of modern web applications. Features βœ… End-to-End (E2E) testing using Playwright 🌐 Cross-browser testing (Chromium, Firefox, WebKit) πŸ“± Responsive & mobile viewport testing πŸ§ͺ

Notifications You must be signed in to change notification settings

viowb/Auto-Framework-PlayWright

Repository files navigation

An end-to-end test automation framework built using Playwright for reliable, fast, and cross-browser testing of modern web applications. Features

βœ… End-to-End (E2E) testing using Playwright

🌐 Cross-browser testing (Chromium, Firefox, WebKit)

πŸ“± Responsive & mobile viewport testing

πŸ§ͺ Supports UI & API testing

⚑ Parallel test execution

πŸ“Έ Screenshots & video on failure

πŸ“Š HTML test reports

πŸ” CI/CD ready (GitHub Actions, Jenkins, etc.)

🧩 Scalable framework structure using Page Object Model (POM)

Tech Stack

Language: JavaScript / TypeScript

Test Framework: Playwright Test

Assertion Library: Playwright built-in expect

Package Manager: npm / yarn

Reporting: Playwright HTML Report

Project Structure playwright-automation-framework/ β”‚ β”œβ”€β”€ tests/ # Test specs β”‚ └── login.spec.ts β”‚ β”œβ”€β”€ pages/ # Page Object Models β”‚ └── login.page.ts β”‚ β”œβ”€β”€ fixtures/ # Test data & fixtures β”‚ β”œβ”€β”€ utils/ # Helper utilities β”‚ β”œβ”€β”€ playwright.config.ts # Playwright configuration β”œβ”€β”€ package.json β”œβ”€β”€ README.md └── reports/ # Test execution reports

πŸ“¦ Installation Prerequisites

Node.js (>= 16)

npm or yarn

Setup git clone https://github.com/your-username/playwright-automation-framework.git cd playwright-automation-framework npm install

Install Playwright browsers: npx playwright install

▢️ Running Tests

Run all tests:

npx playwright test

Run tests in headed mode:

npx playwright test --headed

Run tests in a specific browser:

npx playwright test --project=chromium

Run a specific test file:

npx playwright test tests/login.spec.ts

πŸ“Š Test Reports

After execution, open the HTML report:

npx playwright show-report

Reports include:

Test summary

Failure screenshots

Execution traces

Videos (if enabled)

🧩 Writing a Test (Example) import { test, expect } from '@playwright/test';

test('User should login successfully', async ({ page }) => { await page.goto('https://example.com/login'); await page.fill('#username', 'testuser'); await page.fill('#password', 'password'); await page.click('#login');

await expect(page).toHaveURL(/dashboard/); });

🧱 Page Object Model Example export class LoginPage { constructor(private page) {}

async login(username: string, password: string) { await this.page.fill('#username', username); await this.page.fill('#password', password); await this.page.click('#login'); } }

βš™οΈ Configuration

Key settings can be found in playwright.config.ts:

Base URL

Browsers

Timeouts

Retries

Reporters

Headless/Headed mode

πŸ” CI/CD Integration

This framework can be easily integrated with:

GitHub Actions

Jenkins

GitLab CI

Azure DevOps

GitHub Actions workflow flowchart LR main[main
(production)] develop[develop
(integration)] feature[feature/
(new work)] release[release/

(stabilization)] hotfix[hotfix/*
(urgent fixes)]

feature --> develop
develop --> release
release --> main
main --> develop
hotfix --> main
hotfix --> develop

| Branch      | Purpose               |

| ----------- | --------------------- | | main | Production-ready code | | develop | Ongoing integration | | feature/* | New features | | bugfix/* | Bug fixes | | release/* | Pre-production | | hotfix/* | Emergency fixes |

🀝 Contributing

Contributions are welcome! Please:

Fork the repository

Create a feature branch

Commit your changes

Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.

πŸ“§ Contact

For questions or suggestions, feel free to open an issue or reach out.

About

An end-to-end test automation framework built using Playwright for reliable, fast, and cross-browser testing of modern web applications. Features βœ… End-to-End (E2E) testing using Playwright 🌐 Cross-browser testing (Chromium, Firefox, WebKit) πŸ“± Responsive & mobile viewport testing πŸ§ͺ

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published