Skip to content

eric-stanley/playwright-framework

Repository files navigation

This project was bootstrapped with playwright.

Testing site used - UI Testing Playground

For fast run, fork the repo and run it from local. Otherwise, change the below

Key Value File
env.*.url http://uitestingplayground.com/ src/apps/ui-testing-playground/config.json
urlContains uitestingplayground src/apps/ui-testing-playground/data/home.data.json

✨ Available Scripts

In the project directory, you can run:

Command Description
yarn && yarn playwright install to install dependencies (always run this first before running any other commands)
yarn test to run tests
yarn test:debug to run tests in debug mode
yarn report to serve default report
yarn allure to serve allure report

Note: By default the tests are run in headless mode. Screenshots will not be captured in this mode as it causes problems during validation between headless and headed mode. For validating screenshots, change the below in src/apps/ui-testing-playground/playwright.config.js

Field Value
headless false
retries 0

During the first run, the screenshots will be baselined and no validations will be done during this run. Once the run is complete, change the retries back to the number of retries you need.

Starting second run, the screenshots will be compared with the baseline screenshot.

For implementation of this framework for a brand new application. Check here