From 47185b743b059814d6a7312c03fcc29dbff2d7ba Mon Sep 17 00:00:00 2001 From: Debbie O'Brien Date: Tue, 21 May 2024 21:37:39 +0200 Subject: [PATCH] docs: add last failed to running tests (#30730) --- docs/src/running-tests-js.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/src/running-tests-js.md b/docs/src/running-tests-js.md index 77d201338d..71d8b8adb5 100644 --- a/docs/src/running-tests-js.md +++ b/docs/src/running-tests-js.md @@ -83,6 +83,15 @@ To run a test with a specific title, use the `-g` flag followed by the title of npx playwright test -g "add a todo item" ``` +### Run last failed tests + +To run only the tests that failed in the last test run, first run your tests and then run them again with the `--last-failed` flag. + +```bash +npx playwright test --last-failed +``` + + ### Run tests in VS Code Tests can be run right from VS Code using the [VS Code extension](https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright). Once installed you can simply click the green triangle next to the test you want to run or run all tests from the testing sidebar. Check out our [Getting Started with VS Code](./getting-started-vscode.md#running-tests) guide for more details.