Skip to content

Commit 7de167f

Browse files
authored
fix(playwright): typings improvements (#3650)
1 parent 964819b commit 7de167f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/helpers/Playwright.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Type: [object][5]
4040
### Properties
4141

4242
- `url` **[string][8]** base url of website to be tested
43-
- `browser` **[string][8]?** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
43+
- `browser` **(`"chromium"` | `"firefox"` | `"webkit"` | `"electron"`)?** a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
4444
- `show` **[boolean][26]?** show browser window.
4545
- `restart` **([string][8] | [boolean][26])?** restart strategy between tests. Possible values:- 'context' or **false** - restarts [browser context][33] but keeps running browser. Recommended by Playwright team to keep tests isolated.
4646
- 'browser' or **true** - closes browser and opens it again between tests.
@@ -57,13 +57,13 @@ Type: [object][5]
5757
- `keepBrowserState` **[boolean][26]?** keep browser state between tests when `restart` is set to 'session'.
5858
- `keepCookies` **[boolean][26]?** keep cookies between tests when `restart` is set to 'session'.
5959
- `waitForAction` **[number][12]?** how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
60-
- `waitForNavigation` **[string][8]?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API][36].
60+
- `waitForNavigation` **(`"load"` | `"domcontentloaded"` | `"networkidle"`)?** When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API][36].
6161
- `pressKeyDelay` **[number][12]?** Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
6262
- `getPageTimeout` **[number][12]?** config option to set maximum navigation time in milliseconds.
6363
- `waitForTimeout` **[number][12]?** default wait* timeout in ms. Default: 1000.
6464
- `basicAuth` **[object][5]?** the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
6565
- `windowSize` **[string][8]?** default window size. Set a dimension like `640x480`.
66-
- `colorScheme` **[string][8]?** default color scheme. Possible values: `dark` | `light` | `no-preference`.
66+
- `colorScheme` **(`"dark"` | `"light"` | `"no-preference"`)?** default color scheme. Possible values: `dark` | `light` | `no-preference`.
6767
- `userAgent` **[string][8]?** user-agent string.
6868
- `locale` **[string][8]?** locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
6969
- `manualStart` **[boolean][26]?** do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.

lib/helper/Playwright.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const pathSeparator = path.sep;
5454
* @typedef PlaywrightConfig
5555
* @type {object}
5656
* @prop {string} url - base url of website to be tested
57-
* @prop {string} [browser] - a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
57+
* @prop {'chromium' | 'firefox'| 'webkit' | 'electron'} [browser='chromium'] - a browser to test on, either: `chromium`, `firefox`, `webkit`, `electron`. Default: chromium.
5858
* @prop {boolean} [show=false] - show browser window.
5959
* @prop {string|boolean} [restart=false] - restart strategy between tests. Possible values:
6060
* * 'context' or **false** - restarts [browser context](https://playwright.dev/docs/api/class-browsercontext) but keeps running browser. Recommended by Playwright team to keep tests isolated.
@@ -72,13 +72,13 @@ const pathSeparator = path.sep;
7272
* @prop {boolean} [keepBrowserState=false] - keep browser state between tests when `restart` is set to 'session'.
7373
* @prop {boolean} [keepCookies=false] - keep cookies between tests when `restart` is set to 'session'.
7474
* @prop {number} [waitForAction] - how long to wait after click, doubleClick or PressKey actions in ms. Default: 100.
75-
* @prop {string} [waitForNavigation] - When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API](https://playwright.dev/docs/api/class-page#page-wait-for-navigation).
75+
* @prop {'load' | 'domcontentloaded' | 'networkidle'} [waitForNavigation] - When to consider navigation succeeded. Possible options: `load`, `domcontentloaded`, `networkidle`. Choose one of those options is possible. See [Playwright API](https://playwright.dev/docs/api/class-page#page-wait-for-navigation).
7676
* @prop {number} [pressKeyDelay=10] - Delay between key presses in ms. Used when calling Playwrights page.type(...) in fillField/appendField
7777
* @prop {number} [getPageTimeout] - config option to set maximum navigation time in milliseconds.
7878
* @prop {number} [waitForTimeout] - default wait* timeout in ms. Default: 1000.
7979
* @prop {object} [basicAuth] - the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
8080
* @prop {string} [windowSize] - default window size. Set a dimension like `640x480`.
81-
* @prop {string} [colorScheme] - default color scheme. Possible values: `dark` | `light` | `no-preference`.
81+
* @prop {'dark' | 'light' | 'no-preference'} [colorScheme] - default color scheme. Possible values: `dark` | `light` | `no-preference`.
8282
* @prop {string} [userAgent] - user-agent string.
8383
* @prop {string} [locale] - locale string. Example: 'en-GB', 'de-DE', 'fr-FR', ...
8484
* @prop {boolean} [manualStart] - do not start browser before a test, start it manually inside a helper with `this.helpers["Playwright"]._startBrowser()`.

0 commit comments

Comments
 (0)