This is a sample test automation framework developed using Playwright with Cucumber.
For Demo purpose web UI test cases are created on ecommerce-playground.lambdatest.io site and API test cases are created on these SOAP Calculator API & REST Library Information System API endpoints.
- Chrome - default browser
- Firefox
- MS Edge
- WebKit - web browser engine used by Safari
Playwright framework requires Node.js v14+ to run.
Installing the dependencies.
npm ci
To run test scenarios use below command.
npm run test
To run specific scenario, use tags command. Below are few examples.
npm run test:tags @sanity
npm run test:tags "@calculator or @author"
npm run test:tags "@rest and @author"
To dry run test scenarios use below command.
npm run dry:test
To rerun the failed test scenarios use below command.
npm run failed:test
To change any environment configuration in .env file at run time use set command. Eg: To change browser to Firefox use below command
set BROWSER=firefox
Similar command can be used to update other environment configuration
To generate HTML and Cucumber report use below command
npm run report
Cucumber HTML report will be present inside
test-results/reports/cucumber.html
HTML report will be present inside
test-results/reports/html/index.html
Execution log will be present in the log file.
test-results/logs/execution.log