This is a sample Automation project using Playwright and Typescript
This is a sample Automation project using Playwright and Typescript and uses playwright-testrunner to execute test cases. This is a Data Driven framework focused on separating the test scripts logic and the test data from each other. This allows us to create test automation scripts by passing different sets of test data. The test data set is kept in an external Excel Sheet. The test scripts connect to the external Excel sheet to get the test data. This framework significantly reduces the number of test scripts compared to a modular based framework when we need to test for multiple sets of data for same functionality.
For Demo purpose UI test cases are created on advantageonlineshopping.com site and API test cases are created on these SOAP API & REST API endpoints.
Mode | Execl Value | Description |
---|---|---|
Normal | Blank | Runs the tests sequentially |
Serial | serial | Runs the tests sequentially. On test failure, all subsequent tests are skipped |
Parallel | parallel | Runs the tests parallelly, this is ideal when tests in the scenario are independent of one another |
Playwright framework requires Node.js v14+ to run.
Code from github need to be download OR cloned using git command.
Installing the dependencies.
npm ci
To run test suite use below command.
npm run create:suite SHEET=<SheetName> && npm test
Note: SheetName needs to be updated.
To run individual test locally use below command.
set TEST_NAME=<TestFileName> && npm run local:test
Note: Using set command we are setting the local TestFileName.
To run individual test locally in UI Mode use below command.
set TEST_NAME=<TestFileName> && npm run local:test:ui
Note: Using set command we are setting the local TestFileName.
To change any environment configuration in .env file at run time use set command. Eg: To change browser to MS Edge use below command
set BROWSER=edge
Similar command can be used to update other environment configuration
To generate Allure report use below command
npm run report
Playwright HTML report will be present inside
test-results/results/index.html
Execution log will be present in the log file.
test-results/logs/execution.log
:pencil: If you find my work interesting don't forget to give a Star :star: & Follow me :busts_in_silhouette: