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
Copy file name to clipboardExpand all lines: docs/helpers/Playwright.md
+84-56Lines changed: 84 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,23 +41,23 @@ Type: [object][5]
41
41
42
42
-`url`**[string][8]?** base url of website to be tested
43
43
-`browser`**(`"chromium"` | `"firefox"` | `"webkit"` | `"electron"`)?** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
44
-
-`show`**[boolean][32]?** show browser window.
45
-
-`restart`**([string][8] | [boolean][32])?** restart strategy between tests. Possible values:- 'context' or **false** - restarts [browser context][40] but keeps running browser. Recommended by Playwright team to keep tests isolated.
44
+
-`show`**[boolean][25]?** show browser window.
45
+
-`restart`**([string][8] | [boolean][25])?** restart strategy between tests. Possible values:- 'context' or **false** - restarts [browser context][42] but keeps running browser. Recommended by Playwright team to keep tests isolated.
46
46
- 'browser' or **true** - closes browser and opens it again between tests.
47
47
- 'session' or 'keep' - keeps browser context and session, but cleans up cookies and localStorage between tests. The fastest option when running tests in windowed mode. Works with `keepCookies` and `keepBrowserState` options. This behavior was default before CodeceptJS 3.1
48
-
-`timeout`**[number][20]?** - [timeout][41] in ms of all Playwright actions .
49
-
-`disableScreenshots`**[boolean][32]?** don't save screenshot on failure.
48
+
-`timeout`**[number][20]?** - [timeout][43] in ms of all Playwright actions .
49
+
-`disableScreenshots`**[boolean][25]?** don't save screenshot on failure.
50
50
-`emulate`**any?** browser in device emulation mode.
51
-
-`video`**[boolean][32]?** enables video recording for failed tests; videos are saved into `output/videos` folder
52
-
-`keepVideoForPassedTests`**[boolean][32]?** save videos for passed tests; videos are saved into `output/videos` folder
53
-
-`trace`**[boolean][32]?** record [tracing information][42] with screenshots and snapshots.
54
-
-`keepTraceForPassedTests`**[boolean][32]?** save trace for passed tests.
55
-
-`fullPageScreenshots`**[boolean][32]?** make full page screenshots on failure.
56
-
-`uniqueScreenshotNames`**[boolean][32]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
57
-
-`keepBrowserState`**[boolean][32]?** keep browser state between tests when `restart` is set to 'session'.
58
-
-`keepCookies`**[boolean][32]?** keep cookies between tests when `restart` is set to 'session'.
51
+
-`video`**[boolean][25]?** enables video recording for failed tests; videos are saved into `output/videos` folder
52
+
-`keepVideoForPassedTests`**[boolean][25]?** save videos for passed tests; videos are saved into `output/videos` folder
53
+
-`trace`**[boolean][25]?** record [tracing information][44] with screenshots and snapshots.
54
+
-`keepTraceForPassedTests`**[boolean][25]?** save trace for passed tests.
55
+
-`fullPageScreenshots`**[boolean][25]?** make full page screenshots on failure.
56
+
-`uniqueScreenshotNames`**[boolean][25]?** option to prevent screenshot override if you have scenarios with the same name in different suites.
57
+
-`keepBrowserState`**[boolean][25]?** keep browser state between tests when `restart` is set to 'session'.
58
+
-`keepCookies`**[boolean][25]?** keep cookies between tests when `restart` is set to 'session'.
59
59
-`waitForAction`**[number][20]?** how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
60
-
-`waitForNavigation`**(`"load"` | `"domcontentloaded"` | `"commit"`)?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `commit`. Choose one of those options is possible. See [Playwright API][38].
60
+
-`waitForNavigation`**(`"load"` | `"domcontentloaded"` | `"commit"`)?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `commit`. Choose one of those options is possible. See [Playwright API][40].
61
61
-`pressKeyDelay`**[number][20]?** Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
62
62
-`getPageTimeout`**[number][20]?** config option to set maximum navigation time in milliseconds.
63
63
-`waitForTimeout`**[number][20]?** default wait* timeout in ms. Default: 1000.
@@ -66,15 +66,15 @@ Type: [object][5]
66
66
-`colorScheme`**(`"dark"` | `"light"` | `"no-preference"`)?** default color scheme. Possible values: `dark` | `light` | `no-preference`.
-`manualStart`**[boolean][32]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
69
+
-`manualStart`**[boolean][25]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.
-`electron`**[object][5]?** (pass additional electron options
73
-
-`channel`**any?** (While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge][43].
74
-
-`ignoreLog`**[Array][10]<[string][8]>?** An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values][44].
75
-
-`ignoreHTTPSErrors`**[boolean][32]?** Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
76
-
-`bypassCSP`**[boolean][32]?** bypass Content Security Policy or CSP
77
-
-`highlightElement`**[boolean][32]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
73
+
-`channel`**any?** (While Playwright can operate against the stock Google Chrome and Microsoft Edge browsers available on the machine. In particular, current Playwright version will support Stable and Beta channels of these browsers. See [Google Chrome & Microsoft Edge][45].
74
+
-`ignoreLog`**[Array][10]<[string][8]>?** An array with console message types that are not logged to debug log. Default value is `['warning', 'log']`. E.g. you can set `[]` to log all messages. See all possible [values][46].
75
+
-`ignoreHTTPSErrors`**[boolean][25]?** Allows access to untrustworthy pages, e.g. to a page with an expired certificate. Default value is `false`
76
+
-`bypassCSP`**[boolean][25]?** bypass Content Security Policy or CSP
77
+
-`highlightElement`**[boolean][25]?** highlight the interacting elements. Default: false. Note: only activate under verbose mode (--verbose).
Presses a key in the browser (on a focused element).
1475
1499
1476
-
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][29].
1500
+
_Hint:_ For populating text field or textarea, it is recommended to use [`fillField`][32].
1477
1501
1478
1502
```js
1479
1503
I.pressKey('Backspace');
@@ -1534,13 +1558,13 @@ Some of the supported key names are:
1534
1558
1535
1559
-`key`**([string][8] | [Array][10]<[string][8]>)** key or array of keys to press.
1536
1560
1537
-
Returns **[Promise][9]<void>** automatically synchronized promise through #recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313][30]).
1561
+
Returns **[Promise][9]<void>** automatically synchronized promise through #recorder_Note:_ Shortcuts like `'Meta'` + `'A'` do not work on macOS ([GoogleChrome/Puppeteer#1313][33]).
1538
1562
1539
1563
### pressKeyDown
1540
1564
1541
1565
Presses a key in the browser and leaves it in a down state.
1542
1566
1543
-
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][31]).
1567
+
To make combinations with modifier key and user operation (e.g. `'Control'` + [`click`][34]).
-`context`**([string][8]? | [object][5])** (optional, `null` by default) element located by CSS | XPath | strict locator.
2218
2242
-`options`
2219
2243
2220
-
Returns **[Promise][9]<void>** automatically synchronized promise through #recorder[Additional options][33] for uncheck available as 3rd argument.Examples:```js
2244
+
Returns **[Promise][9]<void>** automatically synchronized promise through #recorder[Additional options][35] for uncheck available as 3rd argument.Examples:```js
0 commit comments