Skip to content

Commit

Permalink
docs: add info about "passive" option and "testplane.also.in" helper
Browse files Browse the repository at this point in the history
  • Loading branch information
DudaGod committed Jul 10, 2024
1 parent 90455c8 commit 1eaf0e4
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
- [region](#region)
- [headless](#headless)
- [isolation](#isolation)
- [passive](#passive)
- [system](#system)
- [debug](#debug)
- [mochaOpts](#mochaopts)
Expand Down Expand Up @@ -197,6 +198,7 @@ Option name | Description
`region` | Ability to choose different datacenters for run in cloud service. Default value is `null`.
`headless` | Ability to run headless browser in cloud service. Default value is `null`.
`isolation` | Ability to execute tests in isolated clean-state environment ([incognito browser context](https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-createBrowserContext)). Default value is `false`, but `true` for chrome@93 and higher.
`passive` | Ability to make browser passive. Tests are not run in passive browsers by default. Default value is `false`.

#### desiredCapabilities
**Required.** Used WebDriver [DesiredCapabilities](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities). For example,
Expand Down Expand Up @@ -491,6 +493,11 @@ Ability to run headless browser in cloud service. Default value is `null`. Can b
#### isolation
Ability to execute tests in isolated clean-state environment ([incognito browser context](https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-createBrowserContext)). It means that `testsPerSession` can be set to `Infinity` in order to speed up tests execution and save browser resources. Currently works only in chrome@93 and higher. Default value is `null`, but `true` for chrome@93 and higher.

#### passive
Ability to make browser passive. Tests are not run in passive browsers by default. Using [testplane.also.in](./writing-tests.md#also) makes it possible to run test or suite before which it is specified.

:warning: When using this option, you need to get rid of the [hermione-passive-browsers](https://github.com/gemini-testing/testplane-passive-browsers) plugin, since they work together incorrectly.

### system

#### debug
Expand Down
21 changes: 21 additions & 0 deletions docs/writing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,27 @@ it('should work another way', function() {
```
The test will be processed in all browsers and **silently** skipped in `ie9`.

### Also
This feature allows you to run the specified suite or test in [passive browser](./config.md#passive).
You can do this by using the global `testplane.also` helper. It supports the following methods:

- `.in` – Adds matchers for browsers.

These methods take the following arguments:

- browser {String|RegExp|Array<String|RegExp>} — A matcher for browser(s) to enable test.

For example:
```js
// ...
testplane.also.in('yabro');

it('should run in passive browser', function() {
return doSomething();
});
```
The test will be run in passive browser "yabro" and in all other not passive browsers.

### Config overriding
You can override some config settings for specific test, suite or hook via `testplane.config.*` notation.

Expand Down

0 comments on commit 1eaf0e4

Please sign in to comment.