You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error:example.spec.ts-snapshots/get-started-chromium-darwin.png is missing in snapshots, writing actual.
275
+
```
276
+
277
+
That's because there was no golden file for your `get-started.png` snapshot. It is now created and is ready to be added to the repository. The name of the folder with the golden expectations starts with the name of your test file:
278
+
279
+
```bash
280
+
drwxr-xr-x 5 user group 160 Jun 411:46 .
281
+
drwxr-xr-x 6 user group 192 Jun 411:45 ..
282
+
-rw-r--r--1 user group 231 Jun 411:16example.spec.ts
283
+
drwxr-xr-x 3 user group 96 Jun 411:46example.spec.ts-snapshots
284
+
```
285
+
286
+
To update your golden files, you can use the `--update-snapshots` parameter.
287
+
288
+
```bash
289
+
npx playwright test -c tests --update-snapshots
290
+
```
291
+
292
+
271
293
## Learn the command line
272
294
273
295
Here are the most common options available in the [command line](./test-cli.md).
@@ -335,37 +357,87 @@ Here are the most common options available in the [command line](./test-cli.md).
335
357
336
358
So far, we've looked at the zero-config operation of Playwright Test. For a real world application, it is likely that you would want to use a config.
337
359
338
-
Create `playwright.config.js` (or `playwright.config.ts`) to configure your tests. You can specify browser launch options, run tests in multiple browsers and much more with the config. Here is an example configuration that runs every test in Chromium, Firefox and WebKit. Look for more options in the [configuration section](./test-configuration.md).
360
+
Create `playwright.config.ts` (or `playwright.config.js`) to configure your tests. You can specify browser launch options, run tests in multiple browsers and much more with the config. Here is an example configuration that runs every test in Chromium, Firefox and WebKit, both Desktop and Mobile versions. Look for more options in the [configuration section](./test-configuration.md).
Copy file name to clipboardExpand all lines: docs/src/test-parallel.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,9 @@ Playwright Test runs tests in parallel by default, using multiple worker process
11
11
12
12
Each worker process creates a new environment to run tests. By default, Playwright Test reuses the worker as much as it can to make testing faster.
13
13
14
-
However, test runner will create a new worker when retrying tests, after any test failure, to initialize a new environment, or just to speed up test execution if the worker limit is not reached.
14
+
Should any test fail, Playwright will discard entire worker process along with the browsers used and will start a new one. That way failing tests can't affect healthy ones.
15
15
16
-
You can control the maximum number of worker processes via [command line](./test-cli.md) or in the [configuration file](./test-configuration.md).
16
+
You can control the maximum number of parallel worker processes via [command line](./test-cli.md) or in the [configuration file](./test-configuration.md).
17
17
18
18
- Run in parallel by default
19
19
```bash
@@ -50,7 +50,7 @@ You can control the maximum number of worker processes via [command line](./test
50
50
exportdefaultconfig;
51
51
```
52
52
53
-
Each worker process is assigned a unique sequential index that is accessible through the [`workerInfo`](./test-advanced.md#workerinfo) object.
53
+
Each worker process is assigned a unique sequential index that is accessible through the [`workerInfo`](./test-advanced.md#workerinfo) object. Since each worker is a process, there also is a process-wide environment variable `process.env.TEST_WORKER_INDEX` that has the same value.
54
54
55
55
## Shards
56
56
@@ -61,3 +61,5 @@ npx playwright test --shard=1/3
61
61
npx playwright test --shard=2/3
62
62
npx playwright test --shard=3/3
63
63
```
64
+
65
+
That way your test suite completes 3 times faster.
0 commit comments