docs: make --grep more clear (#26324)
Fixes https://github.com/microsoft/playwright/issues/24604
This commit is contained in:
parent
bddd4eadad
commit
1383844af8
|
|
@ -160,7 +160,7 @@ export default defineConfig({
|
|||
* since: v1.10
|
||||
- type: ?<[RegExp]|[Array]<[RegExp]>>
|
||||
|
||||
Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only run tests with "cart" in the title. Also available in the [command line](../test-cli.md) with the `-g` option.
|
||||
Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only run tests with "cart" in the title. Also available in the [command line](../test-cli.md) with the `-g` option. 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` option is also useful for [tagging tests](../test-annotations.md#tag-tests).
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ You can configure entire test project to concurrently run all tests in all files
|
|||
* since: v1.10
|
||||
- type: ?<[RegExp]|[Array]<[RegExp]>>
|
||||
|
||||
Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only run tests with "cart" in the title. Also available globally and in the [command line](../test-cli.md) with the `-g` option. 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`.
|
||||
Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only run tests with "cart" in the title. Also available globally and in the [command line](../test-cli.md) with the `-g` option. 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` option is also useful for [tagging tests](../test-annotations.md#tag-tests).
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ Complete set of Playwright Test options is available in the [configuration file]
|
|||
| `-c <file>` or `--config <file>`| Configuration file. If not passed, defaults to `playwright.config.ts` or `playwright.config.js` in the current directory. |
|
||||
| `-c <dir>` or `--config <dir>`| 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 <grep>` or `--grep <grep>` | Only run tests matching this regular expression. For example, this will run `'should add to cart'` when passed `-g "add to cart"`. |
|
||||
| `-g <grep>` or `--grep <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 <grep>` | Only run tests **not** matching this regular expression. The opposite of `--grep`. |
|
||||
| `--global-timeout <number>` | 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.|
|
||||
|
|
|
|||
12
packages/playwright-test/types/test.d.ts
vendored
12
packages/playwright-test/types/test.d.ts
vendored
|
|
@ -164,7 +164,7 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
|
|||
* Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
|
||||
* run tests with "cart" in the title. Also available globally and in the [command line](https://playwright.dev/docs/test-cli) with the `-g`
|
||||
* option. 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`.
|
||||
* `test.describe` name (if any) and the test name divided by spaces, e.g. `my-test.spec.ts my-suite my-test`.
|
||||
*
|
||||
* `grep` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
|
||||
*/
|
||||
|
|
@ -791,7 +791,9 @@ interface TestConfig {
|
|||
|
||||
/**
|
||||
* Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
|
||||
* run tests with "cart" in the title. Also available in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option.
|
||||
* run tests with "cart" in the title. Also available in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option. 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` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
|
||||
*
|
||||
|
|
@ -1540,7 +1542,9 @@ export interface FullConfig<TestArgs = {}, WorkerArgs = {}> {
|
|||
globalTimeout: number;
|
||||
/**
|
||||
* Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
|
||||
* run tests with "cart" in the title. Also available in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option.
|
||||
* run tests with "cart" in the title. Also available in the [command line](https://playwright.dev/docs/test-cli) with the `-g` option. 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` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
|
||||
*
|
||||
|
|
@ -6406,7 +6410,7 @@ interface TestProject {
|
|||
* Filter to only run tests with a title matching one of the patterns. For example, passing `grep: /cart/` should only
|
||||
* run tests with "cart" in the title. Also available globally and in the [command line](https://playwright.dev/docs/test-cli) with the `-g`
|
||||
* option. 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`.
|
||||
* `test.describe` name (if any) and the test name divided by spaces, e.g. `my-test.spec.ts my-suite my-test`.
|
||||
*
|
||||
* `grep` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue