This repository is a small playground for playwright tests
You basically want to learn to do three things:
-
Generate tests using code generation
-
Learn how to store credentials safely
-
Learn how to launch tests
- Install
node.js
- Install
yarn
- Install dependencies: run
yarn
in terminal from the root of this project
-
Don't forget about
Pre-requisites
-
Launch test generation UI:
npx playwright codegen <url>
This command will open up a window with website specified in
<url>
argument. You will test this<url>
Example:
npx playwright codegen condo.d.doma.ai
Example:
npx playwright codegen v1.doma.ai
-
Click some stuff:
On the right side you are seeing the test code, on the left you are seeing opened website. Now just click some stuff within left window and see how code is written for you!
-
Don't forget about Assertions
-
Copy your first test to the
./tests
folderFrom PlayWright inspector:
To code editor
-
We have generated first test. Inspect test code to learn what it does and go to the
Running tests
section to learn how to run these tests