-
Notifications
You must be signed in to change notification settings - Fork 943
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(roll): roll Playwright 1.15.0-next-1630006646000 #871
Merged
mxschmitt
merged 2 commits into
microsoft:master
from
mxschmitt:roll/1.15.0-next-1630006646000
Aug 27, 2021
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2467,7 +2467,8 @@ async def wait_for_selector( | |
selector: str, | ||
*, | ||
state: Literal["attached", "detached", "hidden", "visible"] = None, | ||
timeout: float = None | ||
timeout: float = None, | ||
strict: bool = None | ||
) -> typing.Optional["ElementHandle"]: | ||
"""ElementHandle.wait_for_selector | ||
|
||
|
@@ -2503,6 +2504,9 @@ async def wait_for_selector( | |
timeout : Union[float, NoneType] | ||
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by | ||
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods. | ||
strict : Union[bool, NoneType] | ||
When true, the call requires selector to resolve to a single element. If given selector resolves to more then one | ||
element, the call throws an exception. | ||
|
||
Returns | ||
------- | ||
|
@@ -2513,7 +2517,7 @@ async def wait_for_selector( | |
await self._async( | ||
"element_handle.wait_for_selector", | ||
self._impl_obj.wait_for_selector( | ||
selector=selector, state=state, timeout=timeout | ||
selector=selector, state=state, timeout=timeout, strict=strict | ||
), | ||
) | ||
) | ||
|
@@ -3339,8 +3343,8 @@ async def is_hidden( | |
When true, the call requires selector to resolve to a single element. If given selector resolves to more then one | ||
element, the call throws an exception. | ||
timeout : Union[float, NoneType] | ||
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by | ||
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods. | ||
**DEPRECATED** This option is ignored. `frame.is_hidden()` does not wait for the element to become hidden and | ||
returns immediately. | ||
|
||
Returns | ||
------- | ||
|
@@ -3373,8 +3377,8 @@ async def is_visible( | |
When true, the call requires selector to resolve to a single element. If given selector resolves to more then one | ||
element, the call throws an exception. | ||
timeout : Union[float, NoneType] | ||
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by | ||
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods. | ||
**DEPRECATED** This option is ignored. `frame.is_visible()` does not wait for the element to become visible and | ||
mxschmitt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
returns immediately. | ||
|
||
Returns | ||
------- | ||
|
@@ -5790,8 +5794,8 @@ async def is_hidden( | |
When true, the call requires selector to resolve to a single element. If given selector resolves to more then one | ||
element, the call throws an exception. | ||
timeout : Union[float, NoneType] | ||
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by | ||
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods. | ||
**DEPRECATED** This option is ignored. `page.is_hidden()` does not wait for the element to become hidden and | ||
returns immediately. | ||
|
||
Returns | ||
------- | ||
|
@@ -5824,8 +5828,8 @@ async def is_visible( | |
When true, the call requires selector to resolve to a single element. If given selector resolves to more then one | ||
element, the call throws an exception. | ||
timeout : Union[float, NoneType] | ||
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by | ||
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods. | ||
**DEPRECATED** This option is ignored. `page.is_visible()` does not wait for the element to become visible and | ||
returns immediately. | ||
|
||
Returns | ||
------- | ||
|
@@ -6865,6 +6869,8 @@ async def route( | |
typing.Callable[["Route"], typing.Any], | ||
typing.Callable[["Route", "Request"], typing.Any], | ||
], | ||
*, | ||
times: int = None | ||
) -> NoneType: | ||
"""Page.route | ||
|
||
|
@@ -6873,6 +6879,9 @@ async def route( | |
Once routing is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. | ||
|
||
> NOTE: The handler will only be called for the first url if the response is a redirect. | ||
> NOTE: `page.route()` will not intercept requests intercepted by Service Worker. See | ||
[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using | ||
request interception. Via `await context.addInitScript(() => delete window.navigator.serviceWorker);` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The snippet should be of python not js/ts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. feel free to follow up upstream. |
||
|
||
An example of a naive handler that aborts all image requests: | ||
|
||
|
@@ -6919,13 +6928,17 @@ def handle_route(route): | |
[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. | ||
handler : Union[Callable[[Route, Request], Any], Callable[[Route], Any]] | ||
handler function to route the request. | ||
times : Union[int, NoneType] | ||
How often a route should be used. By default it will be used every time. | ||
""" | ||
|
||
return mapping.from_maybe_impl( | ||
await self._async( | ||
"page.route", | ||
self._impl_obj.route( | ||
url=self._wrap_handler(url), handler=self._wrap_handler(handler) | ||
url=self._wrap_handler(url), | ||
handler=self._wrap_handler(handler), | ||
times=times, | ||
), | ||
) | ||
) | ||
|
@@ -9265,12 +9278,18 @@ async def route( | |
typing.Callable[["Route"], typing.Any], | ||
typing.Callable[["Route", "Request"], typing.Any], | ||
], | ||
*, | ||
times: int = None | ||
) -> NoneType: | ||
"""BrowserContext.route | ||
|
||
Routing provides the capability to modify network requests that are made by any page in the browser context. Once route | ||
is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. | ||
|
||
> NOTE: `page.route()` will not intercept requests intercepted by Service Worker. See | ||
[this](https://github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using | ||
request interception. Via `await context.addInitScript(() => delete window.navigator.serviceWorker);` | ||
|
||
An example of a naive handler that aborts all image requests: | ||
|
||
```py | ||
|
@@ -9319,13 +9338,17 @@ def handle_route(route): | |
[`new URL()`](https://developer.mozilla.org/en-US/docs/Web/API/URL/URL) constructor. | ||
handler : Union[Callable[[Route, Request], Any], Callable[[Route], Any]] | ||
handler function to route the request. | ||
times : Union[int, NoneType] | ||
How often a route should be used. By default it will be used every time. | ||
""" | ||
|
||
return mapping.from_maybe_impl( | ||
await self._async( | ||
"browser_context.route", | ||
self._impl_obj.route( | ||
url=self._wrap_handler(url), handler=self._wrap_handler(handler) | ||
url=self._wrap_handler(url), | ||
handler=self._wrap_handler(handler), | ||
times=times, | ||
), | ||
) | ||
) | ||
|
@@ -9512,7 +9535,7 @@ async def new_cdp_session( | |
Parameters | ||
---------- | ||
page : Union[Frame, Page] | ||
Target to create new session for. For backwards-compatability, this parameter is named `page`, but it can be a `Page` or | ||
Target to create new session for. For backwards-compatibility, this parameter is named `page`, but it can be a `Page` or | ||
`Frame` type. | ||
|
||
Returns | ||
|
@@ -11559,8 +11582,8 @@ async def is_hidden(self, *, timeout: float = None) -> bool: | |
Parameters | ||
---------- | ||
timeout : Union[float, NoneType] | ||
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by | ||
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods. | ||
**DEPRECATED** This option is ignored. `locator.is_hidden()` does not wait for the element to become hidden and | ||
returns immediately. | ||
|
||
Returns | ||
------- | ||
|
@@ -11581,8 +11604,8 @@ async def is_visible(self, *, timeout: float = None) -> bool: | |
Parameters | ||
---------- | ||
timeout : Union[float, NoneType] | ||
Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by | ||
using the `browser_context.set_default_timeout()` or `page.set_default_timeout()` methods. | ||
**DEPRECATED** This option is ignored. `locator.is_visible()` does not wait for the element to become visible and | ||
returns immediately. | ||
|
||
Returns | ||
------- | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DeprecationWarning should be emitted for this