This is a Playwright project for runing End-To-End automated test. With this, you can do frontend and backend test, or a mix of both.
| Job | Status | Reports |
|---|---|---|
| Smoke | ||
| Regression |
- For UI tests is using: demoblaze
- For backend tests is using: jsonplaceholder
#1 - Clone the repo or manually download it.
#2 - Open a console inside the repo folder
#3 - Make sure you have Node correctly installed. If it is this command should display your node version:
node -v
#3 - Install project dependencies:
npm install
#4 - Install Playwright:
npx playwright install --with-deps
#5 - Run the tests:
npx playwright test --project=chrome --headed
#6 - Open the report:
npx playwright show-reportnpm install
npx playwright install --with-depsThis command will run all the test for all the available browsers in headless mode.
npm run test
# or
npx playwright testIf you don't want to run the scripts and want something more specific use the next parameters.
The file is under: 'config/.env'. This is where you must select the configurarion for you environment, xray reporting or add test accounts if needed. For better secutiry is not allowed to storage and commit secret values. You can add the variables but do not commit the values.
Use it to select in which environment you want to test. Available: qa, prod. Default: prod
On the configuration file fill the value for 'env_name' with one of the available ones.
You can specify the browser you want to run. Available: chrome, firefox, safari, edge, backend. Default: when empty it will run for all. Note: When choosing backend it will run only backend tests, when choosing any of the browsers only frontend tests will be run.
npx playwright test --project=chromeBy default browser will be headless and will run in the background. If you want to see it:
npx playwright test --project=chrome --headedYou can choose which test you want to run using test tags. Like:
npx playwright test --grep @SmokeYou can also use operators like:
npx playwright test --grep '@Smoke | @Regression'By default test will run sequentially, one after another. To speed things up, you can run test in parallel, so many browsers will open up and run each test. To do it, just change in the configuration file:
runInParallel=true
For seeing reports, after test execution run this commands.
-
Playwright:
npx playwright show-report
-
Allure:
npm run allureReport
-
Ortoni: Under: ortoni-report/index.html
-
Json and XML Junit: Files are saved under /test-results after tests execution.
- Playwright - to learn about Playright framework.