Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: add last failed to running tests (#30730)

Debbie O'Brien47185b743b05
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.