1 | WebdriverIO Local Runner
|
2 | ========================
|
3 |
|
4 | > A WebdriverIO runner to run tests locally within worker processes
|
5 |
|
6 | The [Local Runner](https://www.npmjs.com/package/@wdio/local-runner) initiates your framework (e.g. Mocha, Jasmine or Cucumber) within worker a process and runs all your test files within your Node.js environment. Every test file is being run in a separate worker process per capability allowing for maximum concurrency. Every worker process uses a single browser instance and therefore runs its own browser session allowing for maximum isolation.
|
7 |
|
8 | Given every test is run in its own isolated process, it is not possible to share data across test files. There are two ways to work around this:
|
9 |
|
10 | - use the [`@wdio/shared-store-service`](https://www.npmjs.com/package/@wdio/shared-store-service) to share data across all workers
|
11 | - group spec files (read more in [Organizing Test Suite](https://webdriver.io/docs/organizingsuites#grouping-test-specs-to-run-sequentially))
|
12 |
|
13 | If nothing else is defined in the `wdio.conf.js` the Local Runner is the default runner in WebdriverIO.
|
14 |
|
15 | ## Install
|
16 |
|
17 | To use the Local Runner you can install it via:
|
18 |
|
19 | ```sh
|
20 | npm install --save-dev @wdio/local-runner
|
21 | ```
|
22 |
|
23 | ## Setup
|
24 |
|
25 | The Local Runner is the default runner in WebdriverIO so there is no need to define it within your `wdio.conf.js`. If you want to explicitly set it, you can define it as follows:
|
26 |
|
27 | ```js
|
28 | // wdio.conf.js
|
29 | export const {
|
30 | // ...
|
31 | runner: 'local',
|
32 | // ...
|
33 | }
|
34 | ```
|
35 |
|
36 | ---
|
37 |
|
38 | For more information on WebdriverIO runner, check out the [documentation](https://webdriver.io/docs/runner).
|