docs: move common screenshot options to params.md (#12008)

This commit is contained in:
Andrey Lushnikov 2022-02-10 13:31:17 -07:00 committed by GitHub
parent 00e8a6440d
commit 3c88d4126c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 89 deletions

View file

@ -622,35 +622,7 @@ Returns the buffer with the captured screenshot.
This method waits for the [actionability](./actionability.md) checks, then scrolls element into view before taking a
screenshot. If the element is detached from DOM, the method throws an error.
### option: ElementHandle.screenshot.path
- `path` <[path]>
The file path to save the image to. The screenshot type will be inferred from file extension. If [`option: 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.
### option: ElementHandle.screenshot.type = %%-screenshot-type-%%
### option: ElementHandle.screenshot.quality
- `quality` <[int]>
The quality of the image, between 0-100. Not applicable to `png` images.
### option: ElementHandle.screenshot.omitBackground
- `omitBackground` <[boolean]>
Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.
Defaults to `false`.
### option: ElementHandle.screenshot.disableAnimations
- `disableAnimations` <[boolean]>
When true, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:
- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
- infinite animations are canceled to initial state, and then played over after the screenshot.
### option: ElementHandle.screenshot.timeout = %%-input-timeout-%%
### option: ElementHandle.screenshot.-inline- = %%-screenshot-options-common-list-%%
## async method: ElementHandle.scrollIntoViewIfNeeded

View file

@ -600,34 +600,7 @@ Returns the buffer with the captured screenshot.
This method waits for the [actionability](./actionability.md) checks, then scrolls element into view before taking a
screenshot. If the element is detached from DOM, the method throws an error.
### option: Locator.screenshot.path
- `path` <[path]>
The file path to save the image to. The screenshot type will be inferred from file extension. If [`option: 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.
### option: Locator.screenshot.type = %%-screenshot-type-%%
### option: Locator.screenshot.quality
- `quality` <[int]>
The quality of the image, between 0-100. Not applicable to `png` images.
### option: Locator.screenshot.omitBackground
- `omitBackground` <[boolean]>
Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.
Defaults to `false`.
### option: Locator.screenshot.disableAnimations
- `disableAnimations` <[boolean]>
When true, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:
- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
- infinite animations are canceled to initial state, and then played over after the screenshot.
### option: Locator.screenshot.timeout = %%-input-timeout-%%
### option: Locator.screenshot.-inline- = %%-screenshot-options-common-list-%%
## async method: Locator.scrollIntoViewIfNeeded

View file

@ -2648,19 +2648,7 @@ How often a route should be used. By default it will be used every time.
Returns the buffer with the captured screenshot.
### option: Page.screenshot.path
- `path` <[path]>
The file path to save the image to. The screenshot type will be inferred from file extension. If [`option: 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.
### option: Page.screenshot.type = %%-screenshot-type-%%
### option: Page.screenshot.quality
- `quality` <[int]>
The quality of the image, between 0-100. Not applicable to `png` images.
### option: Page.screenshot.-inline- = %%-screenshot-options-common-list-%%
### option: Page.screenshot.fullPage
- `fullPage` <[boolean]>
@ -2668,12 +2656,6 @@ The quality of the image, between 0-100. Not applicable to `png` images.
When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to
`false`.
### option: Page.screenshot.disableAnimations
- `disableAnimations` <[boolean]>
When true, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:
- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
- infinite animations are canceled to initial state, and then played over after the screenshot.
### option: Page.screenshot.clip
- `clip` <[Object]>
@ -2684,14 +2666,6 @@ When true, stops CSS animations, CSS transitions and Web Animations. Animations
An object which specifies clipping of the resulting image. Should have the following fields:
### option: Page.screenshot.omitBackground
- `omitBackground` <[boolean]>
Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.
Defaults to `false`.
### option: Page.screenshot.timeout = %%-input-timeout-%%
## async method: Page.selectOption
- returns: <[Array]<[string]>>

View file

@ -646,11 +646,6 @@ method resolves immediately. Can be one of:
* `'domcontentloaded'` - wait for the `DOMContentLoaded` event to be fired.
* `'networkidle'` - wait until there are no network connections for at least `500` ms.
## screenshot-type
- `type` <[ScreenshotType]<"png"|"jpeg">>
Specify screenshot type, defaults to `png`.
## java-wait-for-event-callback
* langs: java
- `callback` <[Runnable]>
@ -887,3 +882,42 @@ Note that outer and inner locators must belong to the same frame. Inner locator
## locator-options-list
- %%-locator-option-has-text-%%
- %%-locator-option-has-%%
## screenshot-option-disable-animations
- `disableAnimations` <[boolean]>
When true, stops CSS animations, CSS transitions and Web Animations. Animations get different treatment depending on their duration:
- finite animations are fast-forwarded to completion, so they'll fire `transitionend` event.
- infinite animations are canceled to initial state, and then played over after the screenshot.
## screenshot-option-omit-background
- `omitBackground` <[boolean]>
Hides default white background and allows capturing screenshots with transparency. Not applicable to `jpeg` images.
Defaults to `false`.
## screenshot-option-quality
- `quality` <[int]>
The quality of the image, between 0-100. Not applicable to `png` images.
## screenshot-option-path
- `path` <[path]>
The file path to save the image to. The screenshot type will be inferred from file extension. If [`option: 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.
## screenshot-option-type
- `type` <[ScreenshotType]<"png"|"jpeg">>
Specify screenshot type, defaults to `png`.
## screenshot-options-common-list
- %%-screenshot-option-disable-animations-%%
- %%-screenshot-option-omit-background-%%
- %%-screenshot-option-quality-%%
- %%-screenshot-option-path-%%
- %%-screenshot-option-type-%%
- %%-input-timeout-%%