docs: split numbers into integers and floats (#4887)

This commit is contained in:
Pavel Feldman 2021-01-05 09:42:49 -08:00 committed by GitHub
parent 849a5b3795
commit 4996eacd5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 151 additions and 142 deletions

View File

@ -92,7 +92,7 @@ await browserContext.addCookies([cookieObject1, cookieObject2]);
## browserContext.addInitScript(script[, arg])
- `script` <[function]|[string]|[Object]> Script to be evaluated in all pages in the browser context.
- `path` <[path]> Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `path` <[string]> Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `content` <[string]> Raw script content. Optional.
- `arg` <[Serializable]> Optional argument to pass to `script` (only supported when passing a function).
- returns: <[Promise]>
@ -372,7 +372,7 @@ Provide credentials for [HTTP authentication](https://developer.mozilla.org/en-U
## browserContext.storageState([options])
- `options` <[Object]>
- `path` <[path]> The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd). If no path is provided, storage state is still returned, but won't be saved to the disk.
- `path` <[string]> The file path to save the storage state to. If `path` is a relative path, then it is resolved relative to [current working directory](https://nodejs.org/api/process.html#process_process_cwd). If no path is provided, storage state is still returned, but won't be saved to the disk.
- returns: <[Promise]<[Object]>>
- `cookies` <[Array]<[Object]>>
- `name` <[string]>

View File

@ -46,9 +46,9 @@ A path where Playwright expects to find a bundled browser executable.
- `args` <[Array]<[string]>> Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).
- `chromiumSandbox` <[boolean]> Enable Chromium sandboxing. Defaults to `false`.
- `devtools` <[boolean]> **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.
- `downloadsPath` <[path]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
- `downloadsPath` <[string]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
- `env` <[Object]<[string], [string]|[number]|[boolean]>> Specify environment variables that will be visible to the browser. Defaults to `process.env`.
- `executablePath` <[path]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.
- `executablePath` <[string]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.
- `firefoxUserPrefs` <[Object]<[string], [string]|[number]|[boolean]>> Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).
- `handleSIGHUP` <[boolean]> Close the browser process on SIGHUP. Defaults to `true`.
- `handleSIGINT` <[boolean]> Close the browser process on Ctrl-C. Defaults to `true`.
@ -84,7 +84,7 @@ const browser = await chromium.launch({ // Or 'firefox' or 'webkit'.
> See [`this article`](https://www.howtogeek.com/202825/what%E2%80%99s-the-difference-between-chromium-and-chrome/) for a description of the differences between Chromium and Chrome. [`This article`](https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md) describes some differences for Linux users.
## browserType.launchPersistentContext(userDataDir[, options])
- `userDataDir` <[path]> Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for [Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile).
- `userDataDir` <[string]> Path to a User Data Directory, which stores browser session data like cookies and local storage. More details for [Chromium](https://chromium.googlesource.com/chromium/src/+/master/docs/user_data_dir.md) and [Firefox](https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile).
- `options` <[Object]>
- `acceptDownloads` <[boolean]> Whether to automatically download all the attachments. Defaults to `false` where all the downloads are canceled.
- `args` <[Array]<[string]>> Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).
@ -93,9 +93,9 @@ const browser = await chromium.launch({ // Or 'firefox' or 'webkit'.
- `colorScheme` <"light"|"dark"|"no-preference"> Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See [page.emulateMedia(params)](api/class-page.md#pageemulatemediaparams) for more details. Defaults to '`light`'.
- `deviceScaleFactor` <[number]> Specify device scale factor (can be thought of as dpr). Defaults to `1`.
- `devtools` <[boolean]> **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.
- `downloadsPath` <[path]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
- `downloadsPath` <[string]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
- `env` <[Object]<[string], [string]|[number]|[boolean]>> Specify environment variables that will be visible to the browser. Defaults to `process.env`.
- `executablePath` <[path]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
- `executablePath` <[string]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
- `extraHTTPHeaders` <[Object]<[string], [string]>> An object containing additional HTTP headers to be sent with every request. All header values must be strings.
- `geolocation` <[Object]>
- `latitude` <[number]> Latitude between -90 and 90.
@ -152,9 +152,9 @@ Launches browser that uses persistent storage located at `userDataDir` and retur
- `args` <[Array]<[string]>> Additional arguments to pass to the browser instance. The list of Chromium flags can be found [here](http://peter.sh/experiments/chromium-command-line-switches/).
- `chromiumSandbox` <[boolean]> Enable Chromium sandboxing. Defaults to `true`.
- `devtools` <[boolean]> **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is `true`, the `headless` option will be set `false`.
- `downloadsPath` <[path]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
- `downloadsPath` <[string]> If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is deleted when browser is closed.
- `env` <[Object]<[string], [string]|[number]|[boolean]>> Specify environment variables that will be visible to the browser. Defaults to `process.env`.
- `executablePath` <[path]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
- `executablePath` <[string]> Path to a browser executable to run instead of the bundled one. If `executablePath` is a relative path, then it is resolved relative to the current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
- `firefoxUserPrefs` <[Object]<[string], [string]|[number]|[boolean]>> Firefox user preferences. Learn more about the Firefox user preferences at [`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).
- `handleSIGHUP` <[boolean]> Close the browser process on SIGHUP. Defaults to `true`.
- `handleSIGINT` <[boolean]> Close the browser process on Ctrl-C. Defaults to `true`.

View File

@ -34,7 +34,7 @@ Returns the newly created browser session.
- `page` <[Page]> Optional, if specified, tracing includes screenshots of the given page.
- `options` <[Object]>
- `categories` <[Array]<[string]>> specify custom categories to use instead of default.
- `path` <[path]> A path to write the trace file to.
- `path` <[string]> A path to write the trace file to.
- `screenshots` <[boolean]> captures screenshots in the trace.
- returns: <[Promise]>

View File

@ -52,7 +52,7 @@ Returns download error if any.
Returns path to the downloaded file in case of successful download.
## download.saveAs(path)
- `path` <[path]> Path where the download should be saved.
- `path` <[string]> Path where the download should be saved.
- returns: <[Promise]>
Saves the download to a user-specified path.

View File

@ -323,7 +323,7 @@ Shortcuts such as `key: "Control+o"` or `key: "Control+Shift+T"` are supported a
## elementHandle.screenshot([options])
- `options` <[Object]>
- `omitBackground` <[boolean]> Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.
- `path` <[path]> The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.
- `path` <[string]> The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.
- `quality` <[number]> The quality of the image, between 0-100. Not applicable to `png` images.
- `timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](api/class-browsercontext.md#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](api/class-page.md#pagesetdefaulttimeouttimeout) methods.
- `type` <"png"|"jpeg"> Specify screenshot type, defaults to `png`.

View File

@ -140,7 +140,7 @@ const divsCounts = await frame.$$eval('div', (divs, min) => divs.length >= min,
## frame.addScriptTag(params)
- `params` <[Object]>
- `url` <[string]> URL of a script to be added. Optional.
- `path` <[path]> Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `path` <[string]> Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `content` <[string]> Raw JavaScript content to be injected into frame. Optional.
- `type` <[string]> Script type. Use 'module' in order to load a Javascript ES6 module. See [script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details. Optional.
- returns: <[Promise]<[ElementHandle]>>
@ -152,7 +152,7 @@ Adds a `<script>` tag into the page with the desired url or content.
## frame.addStyleTag(params)
- `params` <[Object]>
- `url` <[string]> URL of the `<link>` tag. Optional.
- `path` <[path]> Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `path` <[string]> Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `content` <[string]> Raw CSS content to be injected into frame. Optional.
- returns: <[Promise]<[ElementHandle]>>

View File

@ -338,7 +338,7 @@ const divsCounts = await page.$$eval('div', (divs, min) => divs.length >= min, 1
## page.addInitScript(script[, arg])
- `script` <[function]|[string]|[Object]> Script to be evaluated in the page.
- `path` <[path]> Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `path` <[string]> Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `content` <[string]> Raw script content. Optional.
- `arg` <[Serializable]> Optional argument to pass to `script` (only supported when passing a function).
- returns: <[Promise]>
@ -365,7 +365,7 @@ await page.addInitScript(preloadFile);
## page.addScriptTag(params)
- `params` <[Object]>
- `url` <[string]> URL of a script to be added. Optional.
- `path` <[path]> Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `path` <[string]> Path to the JavaScript file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `content` <[string]> Raw JavaScript content to be injected into frame. Optional.
- `type` <[string]> Script type. Use 'module' in order to load a Javascript ES6 module. See [script](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script) for more details. Optional.
- returns: <[Promise]<[ElementHandle]>>
@ -377,7 +377,7 @@ Shortcut for main frame's [frame.addScriptTag(params)](api/class-frame.md#framea
## page.addStyleTag(params)
- `params` <[Object]>
- `url` <[string]> URL of the `<link>` tag. Optional.
- `path` <[path]> Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `path` <[string]> Path to the CSS file to be injected into frame. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `content` <[string]> Raw CSS content to be injected into frame. Optional.
- returns: <[Promise]<[ElementHandle]>>
@ -926,7 +926,7 @@ Returns the opener for popup pages and `null` for others. If the opener has been
- `bottom` <[string]|[number]> Bottom margin, accepts values labeled with units. Defaults to `0`.
- `left` <[string]|[number]> Left margin, accepts values labeled with units. Defaults to `0`.
- `pageRanges` <[string]> Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
- `path` <[path]> The file path to save the PDF to. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the PDF won't be saved to the disk.
- `path` <[string]> The file path to save the PDF to. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the PDF won't be saved to the disk.
- `preferCSSPageSize` <[boolean]> Give any CSS `@page` size declared in the page priority over what is declared in `width` and `height` or `format` options. Defaults to `false`, which will scale the content to fit the paper size.
- `printBackground` <[boolean]> Print background graphics. Defaults to `false`.
- `scale` <[number]> Scale of the webpage rendering. Defaults to `1`. Scale amount must be between 0.1 and 2.
@ -1065,7 +1065,7 @@ Page routes take precedence over browser context routes (set up with [browserCon
- `height` <[number]> height of clipping area
- `fullPage` <[boolean]> When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to `false`.
- `omitBackground` <[boolean]> Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images. Defaults to `false`.
- `path` <[path]> The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.
- `path` <[string]> The file path to save the image to. The screenshot type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to the disk.
- `quality` <[number]> The quality of the image, between 0-100. Not applicable to `png` images.
- `timeout` <[number]> Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by using the [browserContext.setDefaultTimeout(timeout)](api/class-browsercontext.md#browsercontextsetdefaulttimeouttimeout) or [page.setDefaultTimeout(timeout)](api/class-page.md#pagesetdefaulttimeouttimeout) methods.
- `type` <"png"|"jpeg"> Specify screenshot type, defaults to `png`.

View File

@ -60,7 +60,7 @@ await page.route('**/*', (route, request) => {
- `headers` <[Object]<[string], [string]>> Optional response headers. Header values will be converted to a string.
- `contentType` <[string]> If set, equals to setting `Content-Type` response header.
- `body` <[string]|[Buffer]> Optional response body.
- `path` <[path]> Optional file path to respond with. The content type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory.
- `path` <[string]> Optional file path to respond with. The content type will be inferred from file extension. If `path` is a relative path, then it is resolved relative to the current working directory.
- returns: <[Promise]>
Fulfills route's request with given response.

View File

@ -12,7 +12,7 @@ Selectors can be used to install custom selector engines. See [Working with sele
## selectors.register(name, script[, options])
- `name` <[string]> Name that is used in selectors as a prefix, e.g. `{name: 'foo'}` enables `foo=myselectorbody` selectors. May only contain `[a-zA-Z0-9_]` characters.
- `script` <[function]|[string]|[Object]> Script that evaluates to a selector engine instance.
- `path` <[path]> Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `path` <[string]> Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional.
- `content` <[string]> Raw script content. Optional.
- `options` <[Object]>
- `contentScript` <[boolean]> Whether to run this selector engine in isolated JavaScript environment. This environment has access to the same DOM, but not any JavaScript objects from the frame's scripts. Defaults to `false`. Note that running as a content script is not guaranteed when this engine is used together with other registered engines.

View File

@ -242,7 +242,7 @@ await browserContext.addCookies([cookieObject1, cookieObject2]);
- `url` <[string]> either url or domain / path are required. Optional.
- `domain` <[string]> either url or domain / path are required Optional.
- `path` <[string]> either url or domain / path are required Optional.
- `expires` <[number]> Unix time in seconds. Optional.
- `expires` <[float]> Unix time in seconds. Optional.
- `httpOnly` <[boolean]> Optional.
- `secure` <[boolean]> Optional.
- `sameSite` <"Strict"|"Lax"|"None"> Optional.
@ -317,7 +317,7 @@ Closes the browser context. All the pages that belong to the browser context wil
- `value` <[string]>
- `domain` <[string]>
- `path` <[string]>
- `expires` <[number]> Unix time in seconds.
- `expires` <[float]> Unix time in seconds.
- `httpOnly` <[boolean]>
- `secure` <[boolean]>
- `sameSite` <"Strict"|"Lax"|"None">
@ -535,7 +535,7 @@ This setting will change the default maximum navigation time for the following m
[`method: BrowserContext.setDefaultNavigationTimeout`].
### param: BrowserContext.setDefaultNavigationTimeout.timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum navigation time in milliseconds
@ -547,7 +547,7 @@ This setting will change the default maximum time for all the methods accepting
BrowserContext.setDefaultNavigationTimeout`] take priority over [`method: BrowserContext.setDefaultTimeout`].
### param: BrowserContext.setDefaultTimeout.timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum time in milliseconds
@ -577,9 +577,9 @@ pages to read its geolocation.
### param: BrowserContext.setGeolocation.geolocation
- `geolocation` <[null]|[Object]>
- `latitude` <[number]> Latitude between -90 and 90. **required**
- `longitude` <[number]> Longitude between -180 and 180. **required**
- `accuracy` <[number]> Non-negative accuracy value. Defaults to `0`.
- `latitude` <[float]> Latitude between -90 and 90. **required**
- `longitude` <[float]> Longitude between -180 and 180. **required**
- `accuracy` <[float]> Non-negative accuracy value. Defaults to `0`.
## async method: BrowserContext.setHTTPCredentials
@ -608,7 +608,7 @@ Whether to emulate network being offline for the browser context.
- `value` <[string]>
- `domain` <[string]>
- `path` <[string]>
- `expires` <[number]> Unix time in seconds.
- `expires` <[float]> Unix time in seconds.
- `httpOnly` <[boolean]>
- `secure` <[boolean]>
- `sameSite` <"Strict"|"Lax"|"None">
@ -662,7 +662,7 @@ Event name, same one would pass into `browserContext.on(event)`.
### param: BrowserContext.waitForEvent.optionsOrPredicate
- `optionsOrPredicate` <[Function]|[Object]>
- `predicate` <[Function]> receives the event data and resolves to truthy value when the waiting should resolve.
- `timeout` <[number]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].
- `timeout` <[float]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].
Either a predicate that receives an event or an options object. Optional.
@ -1711,7 +1711,7 @@ The file path to save the PDF to. If [`option: path`] is a relative path, then i
working directory. If no path is provided, the PDF won't be saved to the disk.
### option: Page.pdf.scale
- `scale` <[number]>
- `scale` <[float]>
Scale of the webpage rendering. Defaults to `1`. Scale amount must be between 0.1 and 2.
@ -1757,21 +1757,21 @@ Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, whic
Paper format. If set, takes priority over [`option: width`] or [`option: height`] options. Defaults to 'Letter'.
### option: Page.pdf.width
- `width` <[string]|[number]>
- `width` <[string]|[float]>
Paper width, accepts values labeled with units.
### option: Page.pdf.height
- `height` <[string]|[number]>
- `height` <[string]|[float]>
Paper height, accepts values labeled with units.
### option: Page.pdf.margin
- `margin` <[Object]>
- `top` <[string]|[number]> Top margin, accepts values labeled with units. Defaults to `0`.
- `right` <[string]|[number]> Right margin, accepts values labeled with units. Defaults to `0`.
- `bottom` <[string]|[number]> Bottom margin, accepts values labeled with units. Defaults to `0`.
- `left` <[string]|[number]> Left margin, accepts values labeled with units. Defaults to `0`.
- `top` <[string]|[float]> Top margin, accepts values labeled with units. Defaults to `0`.
- `right` <[string]|[float]> Right margin, accepts values labeled with units. Defaults to `0`.
- `bottom` <[string]|[float]> Bottom margin, accepts values labeled with units. Defaults to `0`.
- `left` <[string]|[float]> Left margin, accepts values labeled with units. Defaults to `0`.
Paper margins, defaults to none.
@ -1823,7 +1823,7 @@ await browser.close();
Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
### option: Page.press.delay
- `delay` <[number]>
- `delay` <[float]>
Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
@ -1903,7 +1903,7 @@ saved to the disk.
Specify screenshot type, defaults to `png`.
### option: Page.screenshot.quality
- `quality` <[number]>
- `quality` <[int]>
The quality of the image, between 0-100. Not applicable to `png` images.
@ -1915,10 +1915,10 @@ When true, takes a screenshot of the full scrollable page, instead of the curren
### option: Page.screenshot.clip
- `clip` <[Object]>
- `x` <[number]> x-coordinate of top-left corner of clip area
- `y` <[number]> y-coordinate of top-left corner of clip area
- `width` <[number]> width of clipping area
- `height` <[number]> height of clipping area
- `x` <[float]> x-coordinate of top-left corner of clip area
- `y` <[float]> y-coordinate of top-left corner of clip area
- `width` <[float]> width of clipping area
- `height` <[float]> height of clipping area
An object which specifies clipping of the resulting image. Should have the following fields:
@ -1958,7 +1958,7 @@ Shortcut for main frame's [`method: Frame.selectOption`]
- `values` <[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>>
- `value` <[string]> Matches by `option.value`. Optional.
- `label` <[string]> Matches by `option.label`. Optional.
- `index` <[number]> Matches by the index. Optional.
- `index` <[int]> Matches by the index. Optional.
Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the
first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option
@ -1993,7 +1993,7 @@ This setting will change the default maximum navigation time for the following m
[`method: BrowserContext.setDefaultTimeout`] and [`method: BrowserContext.setDefaultNavigationTimeout`].
### param: Page.setDefaultNavigationTimeout.timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum navigation time in milliseconds
@ -2004,7 +2004,7 @@ This setting will change the default maximum time for all the methods accepting
> **NOTE** [`method: Page.setDefaultNavigationTimeout`] takes priority over [`method: Page.setDefaultTimeout`].
### param: Page.setDefaultTimeout.timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum time in milliseconds
@ -2054,8 +2054,8 @@ await page.goto('https://example.com');
### param: Page.setViewportSize.viewportSize
- `viewportSize` <[Object]>
- `width` <[number]> page width in pixels. **required**
- `height` <[number]> page height in pixels. **required**
- `width` <[int]> page width in pixels. **required**
- `height` <[int]> page height in pixels. **required**
## async method: Page.tap
@ -2124,7 +2124,7 @@ Shortcut for main frame's [`method: Frame.type`].
A text to type into a focused element.
### option: Page.type.delay
- `delay` <[number]>
- `delay` <[float]>
Time to wait between key presses in milliseconds. Defaults to 0.
@ -2183,8 +2183,8 @@ Video object associated with this page.
## method: Page.viewportSize
- returns: <[null]|[Object]>
- `width` <[number]> page width in pixels.
- `height` <[number]> page height in pixels.
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
## async method: Page.waitForEvent
- returns: <[Object]>
@ -2202,7 +2202,7 @@ Event name, same one would pass into `page.on(event)`.
### param: Page.waitForEvent.optionsOrPredicate
- `optionsOrPredicate` <[Function]|[Object]>
- `predicate` <[Function]> receives the event data and resolves to truthy value when the waiting should resolve.
- `timeout` <[number]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].
- `timeout` <[float]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].
Either a predicate that receives an event or an options object. Optional.
@ -2246,7 +2246,7 @@ Function to be evaluated in browser context
Optional argument to pass to [`param: pageFunction`]
### option: Page.waitForFunction.polling
- `polling` <[number]|"raf">
- `polling` <[float]|"raf">
If [`option: polling`] is `'raf'`, then [`param: pageFunction`] is constantly executed in `requestAnimationFrame`
callback. If [`option: polling`] is a number, then it is treated as an interval in milliseconds at which the function
@ -2341,7 +2341,7 @@ await page.waitForRequest(request => request.url().searchParams.get('foo') === '
Request URL string, regex or predicate receiving [Request] object.
### option: Page.waitForRequest.timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be
changed by using the [`method: Page.setDefaultTimeout`] method.
@ -2363,7 +2363,7 @@ return finalResponse.ok();
Request URL string, regex or predicate receiving [Response] object.
### option: Page.waitForResponse.timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum wait time in milliseconds, defaults to 30 seconds, pass `0` to disable the timeout. The default value can be
changed by using the [`method: BrowserContext.setDefaultTimeout`] or [`method: Page.setDefaultTimeout`] methods.
@ -2419,7 +2419,7 @@ await page.waitForTimeout(1000);
Shortcut for main frame's [`method: Frame.waitForTimeout`].
### param: Page.waitForTimeout.timeout
- `timeout` <[number]>
- `timeout` <[float]>
A timeout to wait for
@ -2988,7 +2988,7 @@ modifier, modifier is pressed and being held while the subsequent key is being p
Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
### option: Frame.press.delay
- `delay` <[number]>
- `delay` <[float]>
Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
@ -3021,7 +3021,7 @@ frame.selectOption('select#colors', 'red', 'green', 'blue');
- `values` <[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>>
- `value` <[string]> Matches by `option.value`. Optional.
- `label` <[string]> Matches by `option.label`. Optional.
- `index` <[number]> Matches by the index. Optional.
- `index` <[int]> Matches by the index. Optional.
Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the
first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option
@ -3118,7 +3118,7 @@ await frame.type('#mytextarea', 'World', {delay: 100}); // Types slower, like a
A text to type into a focused element.
### option: Frame.type.delay
- `delay` <[number]>
- `delay` <[float]>
Time to wait between key presses in milliseconds. Defaults to 0.
@ -3191,7 +3191,7 @@ Function to be evaluated in browser context
Optional argument to pass to [`param: pageFunction`]
### option: Frame.waitForFunction.polling
- `polling` <[number]|"raf">
- `polling` <[float]|"raf">
If [`option: polling`] is `'raf'`, then [`param: pageFunction`] is constantly executed in `requestAnimationFrame`
callback. If [`option: polling`] is a number, then it is treated as an interval in milliseconds at which the function
@ -3295,7 +3295,7 @@ Note that `frame.waitForTimeout()` should only be used for debugging. Tests usin
be flaky. Use signals such as network events, selectors becoming visible and others instead.
### param: Frame.waitForTimeout.timeout
- `timeout` <[number]>
- `timeout` <[float]>
A timeout to wait for
@ -3410,10 +3410,10 @@ Optional argument to pass to [`param: pageFunction`]
## async method: ElementHandle.boundingBox
- returns: <[null]|[Object]>
- `x` <[number]> the x coordinate of the element in pixels.
- `y` <[number]> the y coordinate of the element in pixels.
- `width` <[number]> the width of the element in pixels.
- `height` <[number]> the height of the element in pixels.
- `x` <[float]> the x coordinate of the element in pixels.
- `y` <[float]> the y coordinate of the element in pixels.
- `width` <[float]> the width of the element in pixels.
- `height` <[float]> the height of the element in pixels.
This method returns the bounding box of the element, or `null` if the element is not visible. The bounding box is
calculated relative to the main frame viewport - which is usually the same as the browser window.
@ -3651,7 +3651,7 @@ modifier, modifier is pressed and being held while the subsequent key is being p
Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
### option: ElementHandle.press.delay
- `delay` <[number]>
- `delay` <[float]>
Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
@ -3680,7 +3680,7 @@ saved to the disk.
Specify screenshot type, defaults to `png`.
### option: ElementHandle.screenshot.quality
- `quality` <[number]>
- `quality` <[int]>
The quality of the image, between 0-100. Not applicable to `png` images.
@ -3729,7 +3729,7 @@ handle.selectOption({ value: 'blue' }, { index: 2 }, 'red');
- `values` <[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>>
- `value` <[string]> Matches by `option.value`. Optional.
- `label` <[string]> Matches by `option.label`. Optional.
- `index` <[number]> Matches by the index. Optional.
- `index` <[int]> Matches by the index. Optional.
Options to select. If the `<select>` has the `multiple` attribute, all matching options are selected, otherwise only the
first option matching one of the passed options is selected. String values are equivalent to `{value:'string'}`. Option
@ -3815,7 +3815,7 @@ await elementHandle.press('Enter');
A text to type into a focused element.
### option: ElementHandle.type.delay
- `delay` <[number]>
- `delay` <[float]>
Time to wait between key presses in milliseconds. Defaults to 0.
@ -4010,8 +4010,8 @@ error if the object has circular references.
## method: ConsoleMessage.location
- returns: <[Object]>
- `url` <[string]> URL of the resource.
- `lineNumber` <[number]> 0-based line number in the resource.
- `columnNumber` <[number]> 0-based column number in the resource.
- `lineNumber` <[int]> 0-based line number in the resource.
- `columnNumber` <[int]> 0-based column number in the resource.
## method: ConsoleMessage.text
- returns: <[string]>
@ -4314,7 +4314,7 @@ Shortcut for [`method: Keyboard.down`] and [`method: Keyboard.up`].
Name of the key to press or a character to generate, such as `ArrowLeft` or `a`.
### option: Keyboard.press.delay
- `delay` <[number]>
- `delay` <[float]>
Time to wait between `keydown` and `keyup` in milliseconds. Defaults to 0.
@ -4337,7 +4337,7 @@ await page.keyboard.type('World', {delay: 100}); // Types slower, like a user
A text to type into a focused element.
### option: Keyboard.type.delay
- `delay` <[number]>
- `delay` <[float]>
Time to wait between key presses in milliseconds. Defaults to 0.
@ -4372,10 +4372,10 @@ await page.mouse.up();
Shortcut for [`method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`].
### param: Mouse.click.x
- `x` <[number]>
- `x` <[float]>
### param: Mouse.click.y
- `y` <[number]>
- `y` <[float]>
### option: Mouse.click.button = %%-input-button-%%
@ -4389,10 +4389,10 @@ Shortcut for [`method: Mouse.move`], [`method: Mouse.down`], [`method: Mouse.up`
[`method: Mouse.up`].
### param: Mouse.dblclick.x
- `x` <[number]>
- `x` <[float]>
### param: Mouse.dblclick.y
- `y` <[number]>
- `y` <[float]>
### option: Mouse.dblclick.button = %%-input-button-%%
@ -4411,13 +4411,13 @@ Dispatches a `mousedown` event.
Dispatches a `mousemove` event.
### param: Mouse.move.x
- `x` <[number]>
- `x` <[float]>
### param: Mouse.move.y
- `y` <[number]>
- `y` <[float]>
### option: Mouse.move.steps
- `steps` <[number]>
- `steps` <[int]>
defaults to 1. Sends intermediate `mousemove` events.
@ -4439,10 +4439,10 @@ touchscreen can only be used in browser contexts that have been intialized with
Dispatches a `touchstart` and `touchend` event with a single touch at the position ([`param: x`],[`param: y`]).
### param: Touchscreen.tap.x
- `x` <[number]>
- `x` <[float]>
### param: Touchscreen.tap.y
- `y` <[number]>
- `y` <[float]>
# class: Request
@ -4560,15 +4560,15 @@ Returns the matching [Response] object, or `null` if the response was not receiv
## method: Request.timing
- returns: <[Object]>
- `startTime` <[number]> Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC
- `domainLookupStart` <[number]> Time immediately before the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `domainLookupEnd` <[number]> Time immediately after the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `connectStart` <[number]> Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `secureConnectionStart` <[number]> Time immediately before the browser starts the handshake process to secure the current connection. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `connectEnd` <[number]> Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `requestStart` <[number]> Time immediately before the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `responseStart` <[number]> Time immediately after the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `responseEnd` <[number]> Time immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `startTime` <[float]> Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC
- `domainLookupStart` <[float]> Time immediately before the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `domainLookupEnd` <[float]> Time immediately after the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `connectStart` <[float]> Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `secureConnectionStart` <[float]> Time immediately before the browser starts the handshake process to secure the current connection. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `connectEnd` <[float]> Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `requestStart` <[float]> Time immediately before the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `responseStart` <[float]> Time immediately after the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to `startTime`, -1 if not available.
- `responseEnd` <[float]> Time immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first. The value is given in milliseconds relative to `startTime`, -1 if not available.
Returns resource timing information for given request. Most of the timing values become available upon the response,
`responseEnd` becomes available when request finishes. Find more information at [Resource Timing
@ -4629,7 +4629,7 @@ Contains a boolean stating whether the response was successful (status in the ra
Returns the matching [Request] object.
## method: Response.status
- returns: <[number]>
- returns: <[int]>
Contains the status code of the response (e.g., 200 for a success).
@ -4789,7 +4789,7 @@ await page.route('**/xhr_endpoint', route => route.fulfill({ path: 'mock_data.js
### param: Route.fulfill.response
- `response` <[Object]>
- `status` <[number]> Response status code, defaults to `200`.
- `status` <[int]> Response status code, defaults to `200`.
- `headers` <[Object]<[string], [string]>> Optional response headers. Header values will be converted to a string.
- `contentType` <[string]> If set, equals to setting `Content-Type` response header.
- `body` <[string]|[Buffer]> Optional response body.
@ -4853,7 +4853,7 @@ Event name, same one would pass into `webSocket.on(event)`.
### param: WebSocket.waitForEvent.optionsOrPredicate
- `optionsOrPredicate` <[Function]|[Object]>
- `predicate` <[Function]> receives the event data and resolves to truthy value when the waiting should resolve.
- `timeout` <[number]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].
- `timeout` <[float]> maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].
Either a predicate that receives an event or an options object. Optional.
@ -4883,7 +4883,7 @@ assistive technologies themselves. By default, Playwright tries to approximate t
- returns: <[null]|[Object]>
- `role` <[string]> The [role](https://www.w3.org/TR/wai-aria/#usage_intro).
- `name` <[string]> A human readable name for the node.
- `value` <[string]|[number]> The current value of the node, if applicable.
- `value` <[string]|[float]> The current value of the node, if applicable.
- `description` <[string]> An additional human readable description of the node, if applicable.
- `keyshortcuts` <[string]> Keyboard shortcuts associated with this node, if applicable.
- `roledescription` <[string]> A human readable alternative to the role, if applicable.
@ -4899,9 +4899,9 @@ assistive technologies themselves. By default, Playwright tries to approximate t
- `selected` <[boolean]> Whether the node is selected in its parent node, if applicable.
- `checked` <[boolean]|"mixed"> Whether the checkbox is checked, or "mixed", if applicable.
- `pressed` <[boolean]|"mixed"> Whether the toggle button is checked, or "mixed", if applicable.
- `level` <[number]> The level of a heading, if applicable.
- `valuemin` <[number]> The minimum value in a node, if applicable.
- `valuemax` <[number]> The maximum value in a node, if applicable.
- `level` <[int]> The level of a heading, if applicable.
- `valuemin` <[float]> The minimum value in a node, if applicable.
- `valuemax` <[float]> The maximum value in a node, if applicable.
- `autocomplete` <[string]> What kind of autocomplete is supported by a control, if applicable.
- `haspopup` <[string]> What kind of popup is currently being shown for a node, if applicable.
- `invalid` <[string]> Whether and in what way this node's value is invalid, if applicable.
@ -5070,9 +5070,9 @@ This methods attaches Playwright to an existing browser instance.
### param: BrowserType.connect.params
- `params` <[Object]>
- `wsEndpoint` <[string]> A browser websocket endpoint to connect to. **required**
- `slowMo` <[number]> Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
- `slowMo` <[float]> Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
- `logger` <[Logger]> Logger sink for Playwright logging. Optional.
- `timeout` <[number]> Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
- `timeout` <[float]> Maximum time in milliseconds to wait for the connection to be established. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
## method: BrowserType.executablePath
- returns: <[string]>
@ -5155,7 +5155,7 @@ deleted when browser is closed.
Enable Chromium sandboxing. Defaults to `false`.
### option: BrowserType.launch.firefoxUserPrefs
- `firefoxUserPrefs` <[Object]<[string], [string]|[number]|[boolean]>>
- `firefoxUserPrefs` <[Object]<[string], [string]|[float]|[boolean]>>
Firefox user preferences. Learn more about the Firefox user preferences at
[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).
@ -5181,13 +5181,13 @@ Close the browser process on SIGHUP. Defaults to `true`.
Logger sink for Playwright logging.
### option: BrowserType.launch.timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to
disable timeout.
### option: BrowserType.launch.env
- `env` <[Object]<[string], [string]|[number]|[boolean]>>
- `env` <[Object]<[string], [string]|[float]|[boolean]>>
Specify environment variables that will be visible to the browser. Defaults to `process.env`.
@ -5198,7 +5198,7 @@ Specify environment variables that will be visible to the browser. Defaults to `
headless`] option will be set `false`.
### option: BrowserType.launch.slowMo
- `slowMo` <[number]>
- `slowMo` <[float]>
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
@ -5280,13 +5280,13 @@ Close the browser process on SIGTERM. Defaults to `true`.
Close the browser process on SIGHUP. Defaults to `true`.
### option: BrowserType.launchPersistentContext.timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to
disable timeout.
### option: BrowserType.launchPersistentContext.env
- `env` <[Object]<[string], [string]|[number]|[boolean]>>
- `env` <[Object]<[string], [string]|[float]|[boolean]>>
Specify environment variables that will be visible to the browser. Defaults to `process.env`.
@ -5297,7 +5297,7 @@ Specify environment variables that will be visible to the browser. Defaults to `
headless`] option will be set `false`.
### option: BrowserType.launchPersistentContext.slowMo
- `slowMo` <[number]>
- `slowMo` <[float]>
Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
Defaults to 0.
@ -5334,7 +5334,7 @@ Whether to run browser in headless mode. More details for
[`option: devtools`] option is `true`.
### option: BrowserType.launchServer.port
- `port` <[number]>
- `port` <[int]>
Port to use for the web socket. Defaults to 0 that picks any available port.
@ -5378,7 +5378,7 @@ deleted when browser is closed.
Enable Chromium sandboxing. Defaults to `true`.
### option: BrowserType.launchServer.firefoxUserPrefs
- `firefoxUserPrefs` <[Object]<[string], [string]|[number]|[boolean]>>
- `firefoxUserPrefs` <[Object]<[string], [string]|[float]|[boolean]>>
Firefox user preferences. Learn more about the Firefox user preferences at
[`about:config`](https://support.mozilla.org/en-US/kb/about-config-editor-firefox).
@ -5404,13 +5404,13 @@ Close the browser process on SIGHUP. Defaults to `true`.
Logger sink for Playwright logging.
### option: BrowserType.launchServer.timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum time in milliseconds to wait for the browser instance to start. Defaults to `30000` (30 seconds). Pass `0` to
disable timeout.
### option: BrowserType.launchServer.env
- `env` <[Object]<[string], [string]|[number]|[boolean]>>
- `env` <[Object]<[string], [string]|[float]|[boolean]>>
Specify environment variables that will be visible to the browser. Defaults to `process.env`.
@ -5628,8 +5628,8 @@ Whether anonymous scripts generated by the page should be reported. Defaults to
- `url` <[string]> StyleSheet URL
- `text` <[string]> StyleSheet content, if available.
- `ranges` <[Array]<[Object]>> StyleSheet ranges that were used. Ranges are sorted and non-overlapping.
- `start` <[number]> A start offset in text, inclusive
- `end` <[number]> An end offset in text, exclusive
- `start` <[int]> A start offset in text, inclusive
- `end` <[int]> An end offset in text, exclusive
Returns the array of coverage reports for all stylesheets
@ -5644,9 +5644,9 @@ Returns the array of coverage reports for all stylesheets
- `functionName` <[string]>
- `isBlockCoverage` <[boolean]>
- `ranges` <[Array]<[Object]>>
- `count` <[number]>
- `startOffset` <[number]>
- `endOffset` <[number]>
- `count` <[int]>
- `startOffset` <[int]>
- `endOffset` <[int]>
Returns the array of coverage reports for all scripts

View File

@ -7,7 +7,7 @@ When to consider operation succeeded, defaults to `load`. Events can be either:
* `'networkidle'` - consider operation to be finished when there are no network connections for at least `500` ms.
## navigation-timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum operation time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout.
The default value can be changed by using the
@ -17,13 +17,13 @@ The default value can be changed by using the
[`method: Page.setDefaultTimeout`] methods.
## wait-for-timeout
- `timeout` <[number]>
- `timeout` <[float]>
maximum time to wait for in milliseconds. Defaults to `30000` (30 seconds). Pass `0` to disable timeout. The default
value can be changed by using the [`method: BrowserContext.setDefaultTimeout`].
## input-timeout
- `timeout` <[number]>
- `timeout` <[float]>
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
using the [`method: BrowserContext.setDefaultTimeout`] or
@ -49,8 +49,8 @@ A selector to search for element. If there are multiple elements satisfying the
## input-position
- `position` <[Object]>
- `x` <[number]>
- `y` <[number]>
- `x` <[float]>
- `y` <[float]>
A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
element.
@ -73,12 +73,12 @@ Defaults to `left`.
- `buffer` <[Buffer]> File content **required**
## input-down-up-delay
- `delay` <[number]>
- `delay` <[float]>
Time to wait between `mousedown` and `mouseup` in milliseconds. Defaults to 0.
## input-click-count
- `clickCount` <[number]>
- `clickCount` <[int]>
defaults to 1. See [UIEvent.detail].
@ -106,7 +106,7 @@ Defaults to `'visible'`. Can be either:
- `url` <[string]> Optional either url or domain / path are required
- `domain` <[string]> Optional either url or domain / path are required
- `path` <[string]> Optional either url or domain / path are required
- `expires` <[number]> Optional Unix time in seconds.
- `expires` <[float]> Optional Unix time in seconds.
- `httpOnly` <[boolean]> Optional httpOnly flag
- `secure` <[boolean]> Optional secure flag
- `sameSite` <"Strict"|"Lax"|"None"> Optional sameSite flag
@ -136,8 +136,8 @@ Toggles bypassing page's Content-Security-Policy.
## context-option-viewport
- `viewport` <[null]|[Object]>
- `width` <[number]> page width in pixels.
- `height` <[number]> page height in pixels.
- `width` <[int]> page width in pixels.
- `height` <[int]> page height in pixels.
Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `null` disables the default viewport.
@ -147,7 +147,7 @@ Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. `nul
Specific user agent to use in this context.
## context-option-devicescalefactor
- `deviceScaleFactor` <[number]>
- `deviceScaleFactor` <[float]>
Specify device scale factor (can be thought of as dpr). Defaults to `1`.
@ -175,9 +175,9 @@ for a list of supported timezone IDs.
## context-option-geolocation
- `geolocation` <[Object]>
- `latitude` <[number]> Latitude between -90 and 90.
- `longitude` <[number]> Longitude between -180 and 180.
- `accuracy` <[number]> Non-negative accuracy value. Defaults to `0`.
- `latitude` <[float]> Latitude between -90 and 90.
- `longitude` <[float]> Longitude between -180 and 180.
- `accuracy` <[float]> Non-negative accuracy value. Defaults to `0`.
## context-option-locale
- `locale` <[string]>
@ -220,15 +220,15 @@ Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`
Logger sink for Playwright logging.
## context-option-videospath
- `videosPath` <[string]>
- `videosPath` <[path]>
**NOTE** Use [`option: recordVideo`] instead, it takes precedence over [`option: videosPath`]. Enables video recording for all pages to [`option: videosPath`] directory. If not specified, videos are not recorded. Make sure to await
[`method: BrowserContext.close`] for videos to be saved.
## context-option-videosize
- `videoSize` <[Object]>
- `width` <[number]> Video frame width.
- `height` <[number]> Video frame height.
- `width` <[int]> Video frame width.
- `height` <[int]> Video frame height.
**NOTE** Use [`option: recordVideo`] instead, it takes precedence over [`option: videoSize`]. Specifies dimensions of the automatically
recorded video. Can only be used if [`option: videosPath`] is set. If not specified the size will be equal to `viewport`. If
@ -239,7 +239,7 @@ down if necessary to fit specified size.
- `recordHar` <[Object]>
- `omitContent` <[boolean]> Optional setting to control whether to omit request content from the HAR. Defaults to
`false`.
- `path` <[string]> Path on the filesystem to write the HAR file to.
- `path` <[path]> Path on the filesystem to write the HAR file to.
Enables [HAR](http://www.softwareishard.com/blog/har-12-spec) recording for all pages into `recordHar.path` file. If not
specified, the HAR is not recorded. Make sure to await [`method: BrowserContext.close`] for the HAR to be
@ -247,12 +247,12 @@ saved.
## context-option-recordvideo
- `recordVideo` <[Object]>
- `dir` <[string]> Path to the directory to put videos into.
- `dir` <[path]> Path to the directory to put videos into.
- `size` <[Object]> Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`.
If `viewport` is not configured explicitly the video size defaults to 1280x720. Actual picture of each page will be
scaled down if necessary to fit the specified size.
- `width` <[number]> Video frame width.
- `height` <[number]> Video frame height.
- `width` <[int]> Video frame width.
- `height` <[int]> Video frame height.
Enables video recording for all pages into `recordVideo.dir` directory. If not specified videos are not recorded. Make
sure to await [`method: BrowserContext.close`] for videos to be saved.

View File

@ -261,6 +261,9 @@ Documentation.Type = class {
static parse(expression, properties = []) {
expression = expression.replace(/\\\(/g, '(').replace(/\\\)/g, ')');
const type = Documentation.Type.fromParsedType(parseTypeExpression(expression));
type.expression = expression;
if (type.name === 'number')
throw new Error('Number types should be either int or float, not number in: ' + expression);
if (!properties.length)
return type;
const types = [];
@ -324,6 +327,8 @@ Documentation.Type = class {
this.returnType;
/** @type {Documentation.Type[]} | undefined */
this.templates;
/** @type {string | undefined } */
this.expression;
}
visit(visitor) {

View File

@ -300,5 +300,9 @@ function renderType(type) {
return `[function]\\(${type.args.map(l => renderType(l)).join(', ')}\\)${type.returnType ? ':' + renderType(type.returnType) : ''}`;
if (type.name.startsWith('"'))
return type.name;
if (type.name === 'int' || type.name === 'float')
return '[number]';
if (type.name === 'path')
return '[string]';
return `[${type.name}]`;
}

View File

@ -42,10 +42,7 @@ const PROJECT_DIR = path.join(__dirname, '..', '..');
* @param {Documentation} documentation
*/
function serialize(documentation) {
const result = {};
for (const clazz of documentation.classesArray)
result[clazz.name] = serializeClass(clazz);
return result;
return documentation.classesArray.map(serializeClass);
}
/**

View File

@ -15,6 +15,6 @@
- `doesNotExist` <[boolean]>
### option: Exists.exists.option
- `option` <[number]>
- `option` <[int]>
## method: Exists.exists2

View File

@ -302,6 +302,9 @@ function stringifySimpleType(type, indent = '', ...namespace) {
return `{ [key: ${keyType}]: ${valueType}; }`;
}
let out = type.name;
if (out === 'int' || out === 'float')
out = 'number';
if (type.name === 'Object' && type.properties && type.properties.length) {
const name = namespace.map(n => n[0].toUpperCase() + n.substring(1)).join('');
const shouldExport = exported[name];