A Test Accelerator for the Playwright test automation 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
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
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
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
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
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)
npx playwright test APITests.spec.js
Make sure the scripts are added to package.json file shown as below
npm run APITests
npm run UITests
npm run regression
npm run CucumberSmoke
• 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
• Traces, Screenshot, Video settings
• Devices and Screensize settings
• Test retries (retry any failed TC due to flakiness)