mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
docs: improve enum naming (#5359)
This commit is contained in:
parent
551338e953
commit
f35acc258b
@ -111,7 +111,7 @@ browser_context.add_cookies([cookie_object1, cookie_object2])
|
|||||||
- `expires` <[float]> Unix time in seconds. Optional.
|
- `expires` <[float]> Unix time in seconds. Optional.
|
||||||
- `httpOnly` <[boolean]> Optional.
|
- `httpOnly` <[boolean]> Optional.
|
||||||
- `secure` <[boolean]> Optional.
|
- `secure` <[boolean]> Optional.
|
||||||
- `sameSite` <[SameSiteEnum]<"Strict"|"Lax"|"None">> Optional.
|
- `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">> Optional.
|
||||||
|
|
||||||
## async method: BrowserContext.addInitScript
|
## async method: BrowserContext.addInitScript
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ The default browser context cannot be closed.
|
|||||||
- `expires` <[float]> Unix time in seconds.
|
- `expires` <[float]> Unix time in seconds.
|
||||||
- `httpOnly` <[boolean]>
|
- `httpOnly` <[boolean]>
|
||||||
- `secure` <[boolean]>
|
- `secure` <[boolean]>
|
||||||
- `sameSite` <[SameSiteEnum]<"Strict"|"Lax"|"None">>
|
- `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">>
|
||||||
|
|
||||||
If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs
|
If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs
|
||||||
are returned.
|
are returned.
|
||||||
@ -710,7 +710,7 @@ Whether to emulate network being offline for the browser context.
|
|||||||
- `expires` <[float]> Unix time in seconds.
|
- `expires` <[float]> Unix time in seconds.
|
||||||
- `httpOnly` <[boolean]>
|
- `httpOnly` <[boolean]>
|
||||||
- `secure` <[boolean]>
|
- `secure` <[boolean]>
|
||||||
- `sameSite` <[SameSiteEnum]<"Strict"|"Lax"|"None">>
|
- `sameSite` <[SameSiteAttribute]<"Strict"|"Lax"|"None">>
|
||||||
- `origins` <[Array]<[Object]>>
|
- `origins` <[Array]<[Object]>>
|
||||||
- `origin` <[string]>
|
- `origin` <[string]>
|
||||||
- `localStorage` <[Array]<[Object]>>
|
- `localStorage` <[Array]<[Object]>>
|
||||||
|
@ -734,7 +734,7 @@ to pass. This method throws when the element is detached while waiting, unless w
|
|||||||
If the element does not satisfy the condition for the [`option: timeout`] milliseconds, this method will throw.
|
If the element does not satisfy the condition for the [`option: timeout`] milliseconds, this method will throw.
|
||||||
|
|
||||||
### param: ElementHandle.waitForElementState.state
|
### param: ElementHandle.waitForElementState.state
|
||||||
- `state` <[ElementStateEnum]<"visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable">>
|
- `state` <[ElementState]<"visible"|"hidden"|"stable"|"enabled"|"disabled"|"editable">>
|
||||||
|
|
||||||
A state to wait for, see below for more details.
|
A state to wait for, see below for more details.
|
||||||
|
|
||||||
|
@ -712,13 +712,13 @@ page.evaluate("matchMedia('(prefers-color-scheme: no-preference)').matches")
|
|||||||
```
|
```
|
||||||
|
|
||||||
### option: Page.emulateMedia.media
|
### option: Page.emulateMedia.media
|
||||||
- `media` <null|[MediaEnum]<"screen"|"print">>
|
- `media` <null|[Media]<"screen"|"print">>
|
||||||
|
|
||||||
Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`.
|
Changes the CSS media type of the page. The only allowed values are `'screen'`, `'print'` and `null`.
|
||||||
Passing `null` disables CSS media emulation.
|
Passing `null` disables CSS media emulation.
|
||||||
|
|
||||||
### option: Page.emulateMedia.colorScheme
|
### option: Page.emulateMedia.colorScheme
|
||||||
- `colorScheme` <null|[ColorSchemeEnum]<"light"|"dark"|"no-preference">>
|
- `colorScheme` <null|[ColorScheme]<"light"|"dark"|"no-preference">>
|
||||||
|
|
||||||
Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. Passing
|
Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. Passing
|
||||||
`null` disables color scheme emulation.
|
`null` disables color scheme emulation.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
## navigation-wait-until
|
## navigation-wait-until
|
||||||
- `waitUntil` <[WaitUntilEnum]<"load"|"domcontentloaded"|"networkidle">>
|
- `waitUntil` <[WaitUntilState]<"load"|"domcontentloaded"|"networkidle">>
|
||||||
|
|
||||||
When to consider operation succeeded, defaults to `load`. Events can be either:
|
When to consider operation succeeded, defaults to `load`. Events can be either:
|
||||||
* `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
|
* `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
|
||||||
@ -56,13 +56,13 @@ A point to use relative to the top-left corner of element padding box. If not sp
|
|||||||
element.
|
element.
|
||||||
|
|
||||||
## input-modifiers
|
## input-modifiers
|
||||||
- `modifiers` <[Array]<[ModifierEnum]<"Alt"|"Control"|"Meta"|"Shift">>>
|
- `modifiers` <[Array]<[KeyboardModifier]<"Alt"|"Control"|"Meta"|"Shift">>>
|
||||||
|
|
||||||
Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
|
Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
|
||||||
modifiers back. If not specified, currently pressed modifiers are used.
|
modifiers back. If not specified, currently pressed modifiers are used.
|
||||||
|
|
||||||
## input-button
|
## input-button
|
||||||
- `button` <[ButtonEnum]<"left"|"right"|"middle">>
|
- `button` <[MouseButton]<"left"|"right"|"middle">>
|
||||||
|
|
||||||
Defaults to `left`.
|
Defaults to `left`.
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ defaults to 1. See [UIEvent.detail].
|
|||||||
A selector to query for. See [working with selectors](./selectors.md) for more details.
|
A selector to query for. See [working with selectors](./selectors.md) for more details.
|
||||||
|
|
||||||
## wait-for-selector-state
|
## wait-for-selector-state
|
||||||
- `state` <[ElementStateEnum]<"attached"|"detached"|"visible"|"hidden">>
|
- `state` <[WaitForSelectorState]<"attached"|"detached"|"visible"|"hidden">>
|
||||||
|
|
||||||
Defaults to `'visible'`. Can be either:
|
Defaults to `'visible'`. Can be either:
|
||||||
* `'attached'` - wait for element to be present in DOM.
|
* `'attached'` - wait for element to be present in DOM.
|
||||||
@ -155,7 +155,7 @@ Specify environment variables that will be visible to the browser. Defaults to `
|
|||||||
- `expires` <[float]> Optional Unix time in seconds.
|
- `expires` <[float]> Optional Unix time in seconds.
|
||||||
- `httpOnly` <[boolean]> Optional httpOnly flag
|
- `httpOnly` <[boolean]> Optional httpOnly flag
|
||||||
- `secure` <[boolean]> Optional secure flag
|
- `secure` <[boolean]> Optional secure flag
|
||||||
- `sameSite` <["SameSiteEnum"]<"Strict"|"Lax"|"None">> Optional sameSite flag
|
- `sameSite` <["SameSiteAttribute"]<"Strict"|"Lax"|"None">> Optional sameSite flag
|
||||||
- `origins` <[Array]<[Object]>> Optional localStorage to set for context
|
- `origins` <[Array]<[Object]>> Optional localStorage to set for context
|
||||||
- `origin` <[string]>
|
- `origin` <[string]>
|
||||||
- `localStorage` <[Array]<[Object]>>
|
- `localStorage` <[Array]<[Object]>>
|
||||||
@ -321,7 +321,7 @@ Whether to emulate network being offline. Defaults to `false`.
|
|||||||
Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).
|
Credentials for [HTTP authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication).
|
||||||
|
|
||||||
## context-option-colorscheme
|
## context-option-colorscheme
|
||||||
- `colorScheme` <[ColorSchemeEnum]<"light"|"dark"|"no-preference">>
|
- `colorScheme` <[ColorScheme]<"light"|"dark"|"no-preference">>
|
||||||
|
|
||||||
Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
|
Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See
|
||||||
[`method: Page.emulateMedia`] for more details. Defaults to '`light`'.
|
[`method: Page.emulateMedia`] for more details. Defaults to '`light`'.
|
||||||
@ -432,7 +432,7 @@ A glob pattern, regex pattern or predicate receiving [URL] to match while waitin
|
|||||||
Event name, same one typically passed into `*.on(event)`.
|
Event name, same one typically passed into `*.on(event)`.
|
||||||
|
|
||||||
## wait-for-load-state-state
|
## wait-for-load-state-state
|
||||||
- `state` <[LoadStateEnum]<"load"|"domcontentloaded"|"networkidle">>
|
- `state` <[LoadState]<"load"|"domcontentloaded"|"networkidle">>
|
||||||
|
|
||||||
Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the
|
Optional load state to wait for, defaults to `load`. If the state has been already reached while loading current document, the
|
||||||
method resolves immediately. Can be one of:
|
method resolves immediately. Can be one of:
|
||||||
@ -441,7 +441,7 @@ method resolves immediately. Can be one of:
|
|||||||
* `'networkidle'` - wait until there are no network connections for at least `500` ms.
|
* `'networkidle'` - wait until there are no network connections for at least `500` ms.
|
||||||
|
|
||||||
## screenshot-type
|
## screenshot-type
|
||||||
- `type` <[ScreenshotTypeEnum]<"png"|"jpeg">>
|
- `type` <[ScreenshotType]<"png"|"jpeg">>
|
||||||
|
|
||||||
Specify screenshot type, defaults to `png`.
|
Specify screenshot type, defaults to `png`.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user