Remove temporary browser-test dependency playwright-tests.md
Browse files
node_modules/playwright-core/lib/tools/skills/playwright-cli/references/playwright-tests.md
DELETED
|
@@ -1,39 +0,0 @@
|
|
| 1 |
-
# Running Playwright Tests
|
| 2 |
-
|
| 3 |
-
To run Playwright tests, use the `npx playwright test` command, or a package manager script. To avoid opening the interactive html report, use `PLAYWRIGHT_HTML_OPEN=never` environment variable.
|
| 4 |
-
|
| 5 |
-
```bash
|
| 6 |
-
# Run all tests
|
| 7 |
-
PLAYWRIGHT_HTML_OPEN=never npx playwright test
|
| 8 |
-
|
| 9 |
-
# Run all tests through a custom npm script
|
| 10 |
-
PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
|
| 11 |
-
```
|
| 12 |
-
|
| 13 |
-
# Debugging Playwright Tests
|
| 14 |
-
|
| 15 |
-
To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.
|
| 16 |
-
|
| 17 |
-
**IMPORTANT**: run the command in the background and check the output until "Debugging Instructions" is printed. Make sure to stop the command after you have finished.
|
| 18 |
-
|
| 19 |
-
Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.
|
| 20 |
-
|
| 21 |
-
```bash
|
| 22 |
-
# Run the test
|
| 23 |
-
PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli
|
| 24 |
-
# ...
|
| 25 |
-
# ... debugging instructions for "tw-abcdef" session ...
|
| 26 |
-
# ...
|
| 27 |
-
|
| 28 |
-
# Attach to the test
|
| 29 |
-
playwright-cli attach tw-abcdef
|
| 30 |
-
```
|
| 31 |
-
|
| 32 |
-
Keep the test running in the background while you explore and look for a fix.
|
| 33 |
-
The test is paused at the start, so you should step over or pause at a particular location
|
| 34 |
-
where the problem is most likely to be.
|
| 35 |
-
|
| 36 |
-
Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
|
| 37 |
-
This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated, but it could also be a bug in the app. Use your judgement.
|
| 38 |
-
|
| 39 |
-
After fixing the test, stop the background test run. Rerun to check that test passes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|