Skip to content

A Test Accelerator for the Playwright test automation framework built on JavaScript. This framework consists of tests including Web, API built on top of Mocha and Cucumber frameworks.

Notifications You must be signed in to change notification settings

LaunchCG/TestAccelerator-playwright

Repository files navigation

TestAccelerator-playwright

A Test Accelerator for the Playwright test automation framework

Playwright-js Test Automation Framework:

Features of this framework:

• Playwright with Mocha framework

• Playwright with Cucumber framework

• Playwright reporting, Allure reporting and Cucumber reporting

• Page object Model (PoM)

• API Integration

• Cross browser testing (chrome, webkit, firefox)

• Parallel Test executions

• Screenshots, Tracing and Logs

• External Data Source

• Parametrization

• TC’s Tagging and execution from package.json

Getting Started:

Pre-requisites

• Download and install Node.js

• Download and install Text Editor Visual Code

Setup Scripts

• Clone the repository into a folder

• Go to Project root directory and install Dependency: npm install

• All the dependencies from package.json would be installed in node_modules folder

How to Run UI Test

Playwright with Mocha Framework

Go to Project root directory and run command

npx playwright test E2EPlaceOrder.spec.spec.js --project=chrome (For Chrome browser)

To View report run below command

npx playwright show-report

image

To run in parallel browsers, issue below command (Ensure all 3 project names are available in the playwright.config.js)

npx playwright test E2EPlaceOrder.spec.js

To run the TC’s using Tags

npx playwright test –grep @Web

npx playwright test –grep @API

Playwright with Cucumber Framework

Go to Project root directory and run command

npx cucumber-js –exit

npx cucumber.js features\EComm.feature –exit

To run the TC’s using Tags

npx cucumber.js –tags @Smoke –exit

View the cucumber html report

npx cucumber.js –tags @Smoke –format –exit html:cucumber-report.html

image

Allure Reporting

npx playwright test –reporter=line,allure-playwright (To run the test with allure reporting)

npx allure generate ./allure-results –clean (To generate the results)

npx allure open ./allure-report (To view the allure report in html format)

image

image

How to Run API Test

npx playwright test APITests.spec.js

How to run tests through package.json file

Make sure the scripts are added to package.json file shown as below

image

npm run APITests

npm run UITests

npm run regression

npm run CucumberSmoke

How to write Test

• Add new spec under tests folder

• Name the file as .spec.js (e.g. testnew.spec.js)

• In the root directory cmd, issue below command to run the test

npx playwright test testnew.spec.js

Other configurations

• Traces, Screenshot, Video settings

image

• Devices and Screensize settings

image

• Test retries (retry any failed TC due to flakiness)

image

About

A Test Accelerator for the Playwright test automation framework built on JavaScript. This framework consists of tests including Web, API built on top of Mocha and Cucumber frameworks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages