mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: add images to dependencies (#21757)
This commit is contained in:
parent
001df3a495
commit
93d20ffb52
@ -152,7 +152,7 @@ export default defineConfig({
|
|||||||
```
|
```
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
||||||
Dependencies are a list of projects that need to run before the tests in another project run. They can be useful for configuring the global setup actions so that one project depends on this running first. Using dependencies allows global setup to produce traces and other artifacts.
|
Dependencies are a list of projects that need to run before the tests in another project run. They can be useful for configuring the global setup actions so that one project depends on this running first. When using project dependencies, [test reporters](./test-reporters.md) will show the setup tests and the [trace viewer](/trace-viewer.md) will record traces of the setup. You can use the inspector to inspect the DOM snapshot of the trace of your setup tests and you can also use [fixtures](./test-fixtures.md) inside your setup.
|
||||||
|
|
||||||
In this example the chromium, firefox and webkit projects depend on the setup project.
|
In this example the chromium, firefox and webkit projects depend on the setup project.
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ export default defineConfig({
|
|||||||
projects: [
|
projects: [
|
||||||
{
|
{
|
||||||
name: 'setup',
|
name: 'setup',
|
||||||
testMatch: /global.setup\.ts/,
|
testMatch: '**/*.setup.ts',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'chromium',
|
name: 'chromium',
|
||||||
@ -185,6 +185,28 @@ export default defineConfig({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Running Sequence
|
||||||
|
|
||||||
|
When working with tests that have a dependency, the dependency will always run first and once all tests from this project have passed, then the other projects will run in parallel.
|
||||||
|
|
||||||
|
Running order:
|
||||||
|
1. Tests in 'setup' project run
|
||||||
|
|
||||||
|
2. Tests in 'chromium', 'webkit' and 'firefox' projects run in parallel
|
||||||
|
|
||||||
|
<img width="70%" style={{display: 'flex', margin: 'auto'}} alt="chromium, webkit and firefox projects depend on setup project" loading="lazy" src="https://user-images.githubusercontent.com/13063165/225937080-327b1e63-431f-40e0-90d7-35f21d7a92cb.jpg" />
|
||||||
|
|
||||||
|
If there are more than one dependency then these project dependencies will be run first and in parallel. If the tests from a dependency fails then the tests that rely on this project will not be run.
|
||||||
|
|
||||||
|
Running order:
|
||||||
|
1. Tests in 'Browser Login' and 'DataBase' projects run in parallel
|
||||||
|
- 'Browser Login' passes
|
||||||
|
- ❌ 'DataBase' fails!
|
||||||
|
|
||||||
|
1. “e2e tests” is not run!
|
||||||
|
|
||||||
|
<img width="70%" style={{display: 'flex', margin: 'auto'}} alt="Browser login project is blue, database is red and e2e tests relies on both" loading="lazy" src="https://user-images.githubusercontent.com/13063165/225938262-33c1b78f-f092-4762-a478-7f8cbc1e3b21.jpg" />
|
||||||
|
|
||||||
## Custom project parameters
|
## Custom project parameters
|
||||||
|
|
||||||
Projects can be also used to parametrize tests with your custom configuration - take a look at [this separate guide](./test-parameterize.md#parameterized-projects).
|
Projects can be also used to parametrize tests with your custom configuration - take a look at [this separate guide](./test-parameterize.md#parameterized-projects).
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user