Exercises for training dependent tests handling.
All exercises have detailed descriptions available after signing here: https://jaktestowac.pl/pw-strategie/ You will get link to recording of full webinar, presentation and tips (in Polish language).
Information how to get tested app is located in page available after registering here https://jaktestowac.pl/pw-strategie/
Node.jsVisual Studio Code- extensions for VSC:
Prettier - Code formatterPlaywright Test for VSCode
-
Install packages:
npm i -
Install playwright browsers:
npx playwright install -
Configure
playwright.config.json- Set baseURL to your app main url.
- Set timeout to desired value (current 20s can be to short)
There are few ways of test running:
- Navigate to folder with given exercise an simply run test by pressing green arrow
- Open
Testingtab located in left menu (flask icon), unfold all tests and choose one or as many as you want to be run. If test not appears, refresh tab or checkplaywright.config.tsif you have everything set properly withprojectssection. - Run npm scripts by copy pasting scripts form
package.jsonformscriptssection. - Yse VSC npm script run section:
- in
Explorertab menu checkNPM Scripts - in very bottom of Explorer tab you will find section
NPM SCRIPTS - choose script you want to run
- in
- Go to
playwright.config.ts - In
projectscomment first item under// No dependency - Uncomment item related to exercise i.e.
Part5 Ex1 Simple dependency in project - Run tests for given exercises from
part5-projectsfolder in i.etests\part5-projects\ex1-projects-simple.spec.ts - After finishing testing remember to comment back project item in
playwright.config.tsand uncomment first project item
Just run script form package.json:
npm run report
Recommended option is running this script in separate console.
After running test the report is updated and you can refresh page with report
- run same tests couple times (if it works)
- check reports and traces
- broke test and try to find problem in report
⚠️ be careful with test with projects (part 5)