mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: TestProject.setup (#19152)
This commit is contained in:
parent
307a0b6ea7
commit
de1fc170b2
@ -146,7 +146,7 @@ Filter to only run tests with a title matching one of the patterns. For example,
|
||||
* since: v1.10
|
||||
- type: ?<[RegExp]|[Array]<[RegExp]>>
|
||||
|
||||
Filter to only run tests with a title **not** matching one of the patterns. This is the opposite of [`property: TestProject.grep`]. Also available globally and in the [command line](../test-cli.md) with the `--grep-invert` option.
|
||||
Filter to only run tests with a title **not** matching one of the patterns. This is the opposite of [`property: TestProject.grep`]. Also available globally and in the [command line](../test-cli.md) with the `--grep-invert` option. This filter and its command line counterpart also applies to the setup files. If all [`property: TestProject.setup`] tests match the filter Playwright **will** run all setup files before running the matching tests.
|
||||
|
||||
`grepInvert` option is also useful for [tagging tests](../test-annotations.md#tag-tests).
|
||||
|
||||
@ -166,7 +166,9 @@ Project name is visible in the report and during test execution.
|
||||
* since: v1.28
|
||||
- type: ?<[string]|[RegExp]|[Array]<[string]|[RegExp]>>
|
||||
|
||||
Project setup files that would be executed before all tests in the project. If project setup fails the tests in this project will be skipped. All project setup files will run in every shard if the project is sharded.
|
||||
Project setup files that would be executed before all tests in the project. If project setup fails the tests in this project will be skipped. All project setup files will run in every shard if the project is sharded. [`property: TestProject.grep`] and [`property: TestProject.grepInvert`] and their command line counterparts also apply to the setup files. If such filters match only tests in the project Playwright will run all setup files before running the matching tests.
|
||||
|
||||
If there is a file that matches both [`property: TestProject.setup`] and [`property: TestProject.testMatch`] filters an error will be thrown.
|
||||
|
||||
## property: TestProject.snapshotDir
|
||||
* since: v1.10
|
||||
|
19
packages/playwright-test/types/test.d.ts
vendored
19
packages/playwright-test/types/test.d.ts
vendored
@ -193,7 +193,10 @@ export interface FullProject<TestArgs = {}, WorkerArgs = {}> {
|
||||
/**
|
||||
* Filter to only run tests with a title **not** matching one of the patterns. This is the opposite of
|
||||
* [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep). Also available globally
|
||||
* and in the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option.
|
||||
* and in the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option. This filter and its command line
|
||||
* counterpart also applies to the setup files. If all
|
||||
* [testProject.setup](https://playwright.dev/docs/api/class-testproject#test-project-setup) tests match the filter
|
||||
* Playwright **will** run all setup files before running the matching tests.
|
||||
*
|
||||
* `grepInvert` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
|
||||
*/
|
||||
@ -4660,7 +4663,10 @@ interface TestProject {
|
||||
/**
|
||||
* Filter to only run tests with a title **not** matching one of the patterns. This is the opposite of
|
||||
* [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep). Also available globally
|
||||
* and in the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option.
|
||||
* and in the [command line](https://playwright.dev/docs/test-cli) with the `--grep-invert` option. This filter and its command line
|
||||
* counterpart also applies to the setup files. If all
|
||||
* [testProject.setup](https://playwright.dev/docs/api/class-testproject#test-project-setup) tests match the filter
|
||||
* Playwright **will** run all setup files before running the matching tests.
|
||||
*
|
||||
* `grepInvert` option is also useful for [tagging tests](https://playwright.dev/docs/test-annotations#tag-tests).
|
||||
*/
|
||||
@ -4679,6 +4685,15 @@ interface TestProject {
|
||||
/**
|
||||
* Project setup files that would be executed before all tests in the project. If project setup fails the tests in
|
||||
* this project will be skipped. All project setup files will run in every shard if the project is sharded.
|
||||
* [testProject.grep](https://playwright.dev/docs/api/class-testproject#test-project-grep) and
|
||||
* [testProject.grepInvert](https://playwright.dev/docs/api/class-testproject#test-project-grep-invert) and their
|
||||
* command line counterparts also apply to the setup files. If such filters match only tests in the project Playwright
|
||||
* will run all setup files before running the matching tests.
|
||||
*
|
||||
* If there is a file that matches both
|
||||
* [testProject.setup](https://playwright.dev/docs/api/class-testproject#test-project-setup) and
|
||||
* [testProject.testMatch](https://playwright.dev/docs/api/class-testproject#test-project-test-match) filters an error
|
||||
* will be thrown.
|
||||
*/
|
||||
setup?: string|RegExp|Array<string|RegExp>;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user