- Follow instructions on the node.js site to install Node.js.
- Follow instructions in the NVM repository to install NVM.
Clone this repository
git clone https://github.com/Rat01047/flywp-automation.git
Run the followings in a terminal/command line window
cd e2enpm installto install the required dependencies (@playwright/test, dotenv, @faker-js/faker)
Make a .env file according to .env.example file
To run the tests suite, use the following command:
npx playwright test...
Here are some other useful commands to help you run and manage your tests effectively:
Run all tests with optimal performance using the available workers:
npm run all
Run all tests in a browser with a visible UI and single worker:
npm run all:headed
Playwright supports test sharding for parallel execution. You can run specific shards as follows:
• Pre-shard tests,
npm run test:preShard
• Shard 1,
npm run test:shard1
• Shard 2,
npm run test:shard2
• Shard 3,
npm run test:shard3
• Post-shard tests,
npm run test:postShard
Run pre-shard, all shards, and post-shard tests in sequence:
npm run test:sharded
...
Generate coverage reports for your tests:
npm run test:coverage
Merge reports from all shards and generate an HTML report:
npm run generate-report
View the most recent HTML report:
npm run report
...
• Ensure all dependencies are installed before running these commands (npm install).
• Configure your test environment and projects in the Playwright configuration file (playwright.config.js).