diff --git a/docs/src/test-cli-js.md b/docs/src/test-cli-js.md index 99176626c6..e005c53714 100644 --- a/docs/src/test-cli-js.md +++ b/docs/src/test-cli-js.md @@ -84,8 +84,8 @@ Complete set of Playwright Test options is available in the [configuration file] | `-c ` or `--config `| Configuration file. If not passed, defaults to `playwright.config.ts` or `playwright.config.js` in the current directory. | | `-c ` or `--config `| Configuration file. If not passed, defaults to `playwright.config.ts` or `playwright.config.js` in the current directory. | | `--forbid-only` | Whether to disallow `test.only`. Useful on CI.| -| `-g ` or `--grep ` | Only run tests matching this regular expression. For example, this will run `'should add to cart'` when passed `-g "add to cart"`. The regular expression will be tested against the string that consists of the test file name, `test.describe` name (if any) and the test name divided by spaces, e.g. `my-test.spec.ts my-suite my-test`. | -| `--grep-invert ` | Only run tests **not** matching this regular expression. The opposite of `--grep`. | +| `-g ` or `--grep ` | Only run tests matching this regular expression. For example, this will run `'should add to cart'` when passed `-g "add to cart"`. The regular expression will be tested against the string that consists of the test file name, `test.describe` name (if any) and the test name divided by spaces, e.g. `my-test.spec.ts my-suite my-test`. The filter does not apply to the tests from dependcy projects, i.e. Playwright will still run all tests from [project dependencies](./test-projects.md#dependencies). | +| `--grep-invert ` | Only run tests **not** matching this regular expression. The opposite of `--grep`. The filter does not apply to the tests from dependcy projects, i.e. Playwright will still run all tests from [project dependencies](./test-projects.md#dependencies).| | `--global-timeout ` | Total timeout for the whole test run in milliseconds. By default, there is no global timeout. Learn more about [various timeouts](./test-timeouts.md).| | `--list` | list all the tests, but do not run them.| | `--max-failures ` or `-x`| Stop after the first `N` test failures. Passing `-x` stops after the first failure.| diff --git a/docs/src/test-projects-js.md b/docs/src/test-projects-js.md index 88b1ec0161..d401ae9c20 100644 --- a/docs/src/test-projects-js.md +++ b/docs/src/test-projects-js.md @@ -214,6 +214,9 @@ You can also teardown your setup by adding a [`property: TestProject.teardown`] global setup and teardown +### Test filtering + +If `--grep/--grep-invert` [option](./test-cli.md#reference) is used, test file name filter is specified in [command line](./test-cli.md) or [test.only()](./api/class-test.md#test-only) is used, the will only apply to the tests from the deepest projects in the project dependency chain. In other words, if a matching test belongs to a project that has project dependencies, Playwright will run all the tests from the project depdencies ignoring the filters. ## Custom project parameters