Skip to content

Commit

Permalink
chore: roll to playwright v1.42.1
Browse files Browse the repository at this point in the history
  • Loading branch information
canstand committed Mar 2, 2024
1 parent aca4495 commit 85fd401
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 37 deletions.
38 changes: 22 additions & 16 deletions generated-interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -3521,30 +3521,36 @@ type Page interface {
// [locators]: https://playwright.dev/docs/locators
QuerySelectorAll(selector string) ([]ElementHandle, error)

// Sometimes, the web page can show an overlay that obstructs elements behind it and prevents certain actions, like
// click, from completing. When such an overlay is shown predictably, we recommend dismissing it as a part of your
// test flow. However, sometimes such an overlay may appear non-deterministically, for example certain cookies consent
// dialogs behave this way. In this case, [Page.AddLocatorHandler] allows handling an overlay during an action that it
// would block.
// This method registers a handler for an overlay that is executed once the locator is visible on the page. The
// handler should get rid of the overlay so that actions blocked by it can proceed. This is useful for
// nondeterministic interstitial pages or dialogs, like a cookie consent dialog.
// Note that execution time of the handler counts towards the timeout of the action/assertion that executed the
// handler.
// You can register multiple handlers. However, only a single handler will be running at a time. Any actions inside a
// handler must not require another handler to run.
// **NOTE** Running the interceptor will alter your page state mid-test. For example it will change the currently
// focused element and move the mouse. Make sure that the actions that run after the interceptor are self-contained
// and do not rely on the focus and mouse state. <br /> <br /> For example, consider a test that calls [Locator.Focus]
// When testing a web page, sometimes unexpected overlays like a coookie consent dialog appear and block actions you
// want to automate, e.g. clicking a button. These overlays don't always show up in the same way or at the same time,
// making them tricky to handle in automated tests.
// This method lets you set up a special function, called a handler, that activates when it detects that overlay is
// visible. The handler's job is to remove the overlay, allowing your test to continue as if the overlay wasn't there.
// Things to keep in mind:
// - When an overlay is shown predictably, we recommend explicitly waiting for it in your test and dismissing it as
// a part of your normal test flow, instead of using [Page.AddLocatorHandler].
// - Playwright checks for the overlay every time before executing or retrying an action that requires an
// [actionability check], or before performing an auto-waiting assertion check. When overlay
// is visible, Playwright calls the handler first, and then proceeds with the action/assertion.
// - The execution time of the handler counts towards the timeout of the action/assertion that executed the handler.
// If your handler takes too long, it might cause timeouts.
// - You can register multiple handlers. However, only a single handler will be running at a time. Make sure the
// actions within a handler don't depend on another handler.
// **NOTE** Running the handler will alter your page state mid-test. For example it will change the currently focused
// element and move the mouse. Make sure that actions that run after the handler are self-contained and do not rely on
// the focus and mouse state being unchanged. <br /> <br /> For example, consider a test that calls [Locator.Focus]
// followed by [Keyboard.Press]. If your handler clicks a button between these two actions, the focused element most
// likely will be wrong, and key press will happen on the unexpected element. Use [Locator.Press] instead to avoid
// this problem. <br /> <br /> Another example is a series of mouse actions, where [Mouse.Move] is followed by
// [Mouse.Down]. Again, when the handler runs between these two actions, the mouse position will be wrong during the
// mouse down. Prefer methods like [Locator.Click] that are self-contained.
// mouse down. Prefer self-contained actions like [Locator.Click] that do not rely on the state being unchanged by a
// handler.
//
// 1. locator: Locator that triggers the handler.
// 2. handler: Function that should be run once “locator” appears. This function should get rid of the element that blocks actions
// like click.
//
// [actionability check]: https://playwright.dev/docs/actionability
AddLocatorHandler(locator Locator, handler func()) error

// This method reloads the current page, in the same way as if the user had triggered a browser refresh. Returns the
Expand Down
38 changes: 19 additions & 19 deletions patches/main.patch
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ index ad06c2514..d4f56009d 100644

Expected options currently selected.
diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md
index 922a7df3b..6ffd9d117 100644
index c0cd3d0be..dde66ae7a 100644
--- a/docs/src/api/class-page.md
+++ b/docs/src/api/class-page.md
@@ -618,7 +618,7 @@ The order of evaluation of multiple scripts installed via [`method: BrowserConte
Expand Down Expand Up @@ -679,7 +679,7 @@ index 922a7df3b..6ffd9d117 100644
- `margin` <[Object]>
- `top` ?<[string]> Top margin, accepts values labeled with units. Defaults to `0`.
- `right` ?<[string]> Right margin, accepts values labeled with units. Defaults to `0`.
@@ -3344,7 +3344,7 @@ await page.GetByRole("button", new() { Name = "Start here" }).ClickAsync();
@@ -3346,7 +3346,7 @@ await page.GetByRole("button", new() { Name = "Start here" }).ClickAsync();
Locator that triggers the handler.

### param: Page.addLocatorHandler.handler
Expand All @@ -688,7 +688,7 @@ index 922a7df3b..6ffd9d117 100644
* since: v1.42
- `handler` <[function]>

@@ -3551,6 +3551,13 @@ it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/We
@@ -3553,6 +3553,13 @@ it gets merged via the [`new URL()`](https://developer.mozilla.org/en-US/docs/We

handler function to route the request.

Expand All @@ -702,7 +702,7 @@ index 922a7df3b..6ffd9d117 100644
### param: Page.route.handler
* since: v1.8
* langs: csharp, java
@@ -3932,12 +3939,12 @@ await page.GotoAsync("https://www.microsoft.com");
@@ -3934,12 +3941,12 @@ await page.GotoAsync("https://www.microsoft.com");

### param: Page.setViewportSize.width
* since: v1.10
Expand All @@ -717,7 +717,7 @@ index 922a7df3b..6ffd9d117 100644
- `height` <[int]> page height in pixels.

## async method: Page.tap
@@ -4124,6 +4131,13 @@ A glob pattern, regex pattern or predicate receiving [URL] to match while routin
@@ -4126,6 +4133,13 @@ A glob pattern, regex pattern or predicate receiving [URL] to match while routin

Optional handler function to route the request.

Expand All @@ -731,7 +731,7 @@ index 922a7df3b..6ffd9d117 100644
### param: Page.unroute.handler
* since: v1.8
* langs: csharp, java
@@ -4162,7 +4176,8 @@ Performs action and waits for the Page to close.
@@ -4164,7 +4178,8 @@ Performs action and waits for the Page to close.

## async method: Page.waitForConsoleMessage
* since: v1.9
Expand All @@ -741,7 +741,7 @@ index 922a7df3b..6ffd9d117 100644
- alias-python: expect_console_message
- alias-csharp: RunAndWaitForConsoleMessage
- returns: <[ConsoleMessage]>
@@ -4193,7 +4208,8 @@ Receives the [ConsoleMessage] object and resolves to truthy value when the waiti
@@ -4195,7 +4210,8 @@ Receives the [ConsoleMessage] object and resolves to truthy value when the waiti

## async method: Page.waitForDownload
* since: v1.9
Expand All @@ -751,7 +751,7 @@ index 922a7df3b..6ffd9d117 100644
- alias-python: expect_download
- alias-csharp: RunAndWaitForDownload
- returns: <[Download]>
@@ -4224,7 +4240,8 @@ Receives the [Download] object and resolves to truthy value when the waiting sho
@@ -4226,7 +4242,8 @@ Receives the [Download] object and resolves to truthy value when the waiting sho

## async method: Page.waitForEvent
* since: v1.8
Expand All @@ -761,7 +761,7 @@ index 922a7df3b..6ffd9d117 100644
- alias-python: expect_event
- returns: <[any]>

@@ -4277,7 +4294,8 @@ Either a predicate that receives an event or an options object. Optional.
@@ -4279,7 +4296,8 @@ Either a predicate that receives an event or an options object. Optional.

## async method: Page.waitForFileChooser
* since: v1.9
Expand All @@ -771,7 +771,7 @@ index 922a7df3b..6ffd9d117 100644
- alias-python: expect_file_chooser
- alias-csharp: RunAndWaitForFileChooser
- returns: <[FileChooser]>
@@ -4435,7 +4453,7 @@ await page.WaitForFunctionAsync("selector => !!document.querySelector(selector)"
@@ -4437,7 +4455,7 @@ await page.WaitForFunctionAsync("selector => !!document.querySelector(selector)"

Optional argument to pass to [`param: expression`].

Expand All @@ -780,7 +780,7 @@ index 922a7df3b..6ffd9d117 100644
* since: v1.8

### option: Page.waitForFunction.polling = %%-csharp-java-wait-for-function-polling-%%
@@ -4528,6 +4546,11 @@ Console.WriteLine(await popup.TitleAsync()); // popup is ready to use.
@@ -4530,6 +4548,11 @@ Console.WriteLine(await popup.TitleAsync()); // popup is ready to use.
```

### param: Page.waitForLoadState.state = %%-wait-for-load-state-state-%%
Expand All @@ -792,15 +792,15 @@ index 922a7df3b..6ffd9d117 100644
* since: v1.8

### option: Page.waitForLoadState.timeout = %%-navigation-timeout-%%
@@ -4540,6 +4563,7 @@ Console.WriteLine(await popup.TitleAsync()); // popup is ready to use.
@@ -4542,6 +4565,7 @@ Console.WriteLine(await popup.TitleAsync()); // popup is ready to use.
* since: v1.8
* deprecated: This method is inherently racy, please use [`method: Page.waitForURL`] instead.
* langs:
+ * alias-go: ExpectNavigation
* alias-python: expect_navigation
* alias-csharp: RunAndWaitForNavigation
- returns: <[null]|[Response]>
@@ -4624,7 +4648,8 @@ a navigation.
@@ -4626,7 +4650,8 @@ a navigation.

## async method: Page.waitForPopup
* since: v1.9
Expand All @@ -810,15 +810,15 @@ index 922a7df3b..6ffd9d117 100644
- alias-python: expect_popup
- alias-csharp: RunAndWaitForPopup
- returns: <[Page]>
@@ -4656,6 +4681,7 @@ Receives the [Page] object and resolves to truthy value when the waiting should
@@ -4658,6 +4683,7 @@ Receives the [Page] object and resolves to truthy value when the waiting should
## async method: Page.waitForRequest
* since: v1.8
* langs:
+ * alias-go: ExpectRequest
* alias-python: expect_request
* alias-csharp: RunAndWaitForRequest
- returns: <[Request]>
@@ -4763,7 +4789,8 @@ changed by using the [`method: Page.setDefaultTimeout`] method.
@@ -4765,7 +4791,8 @@ changed by using the [`method: Page.setDefaultTimeout`] method.

## async method: Page.waitForRequestFinished
* since: v1.12
Expand All @@ -828,15 +828,15 @@ index 922a7df3b..6ffd9d117 100644
- alias-python: expect_request_finished
- alias-csharp: RunAndWaitForRequestFinished
- returns: <[Request]>
@@ -4795,6 +4822,7 @@ Receives the [Request] object and resolves to truthy value when the waiting shou
@@ -4797,6 +4824,7 @@ Receives the [Request] object and resolves to truthy value when the waiting shou
## async method: Page.waitForResponse
* since: v1.8
* langs:
+ * alias-go: ExpectResponse
* alias-python: expect_response
* alias-csharp: RunAndWaitForResponse
- returns: <[Response]>
@@ -5157,7 +5185,8 @@ await page.WaitForURLAsync("**/target.html");
@@ -5159,7 +5187,8 @@ await page.WaitForURLAsync("**/target.html");

## async method: Page.waitForWebSocket
* since: v1.9
Expand All @@ -846,7 +846,7 @@ index 922a7df3b..6ffd9d117 100644
- alias-python: expect_websocket
- alias-csharp: RunAndWaitForWebSocket
- returns: <[WebSocket]>
@@ -5188,7 +5217,8 @@ Receives the [WebSocket] object and resolves to truthy value when the waiting sh
@@ -5190,7 +5219,8 @@ Receives the [WebSocket] object and resolves to truthy value when the waiting sh

## async method: Page.waitForWorker
* since: v1.9
Expand All @@ -856,7 +856,7 @@ index 922a7df3b..6ffd9d117 100644
- alias-python: expect_worker
- alias-csharp: RunAndWaitForWorker
- returns: <[Worker]>
@@ -5230,7 +5260,8 @@ This does not contain ServiceWorkers
@@ -5232,7 +5262,8 @@ This does not contain ServiceWorkers

## async method: Page.waitForEvent2
* since: v1.8
Expand Down
2 changes: 1 addition & 1 deletion playwright
Submodule playwright updated 38 files
+10 −8 docs/src/api/class-page.md
+40 −46 package-lock.json
+1 −1 package.json
+2 −2 packages/playwright-browser-chromium/package.json
+2 −2 packages/playwright-browser-firefox/package.json
+2 −2 packages/playwright-browser-webkit/package.json
+1 −1 packages/playwright-chromium/cli.js
+2 −2 packages/playwright-chromium/package.json
+1 −1 packages/playwright-core/package.json
+30 −17 packages/playwright-core/src/server/injected/roleSelectorEngine.ts
+0 −42 packages/playwright-core/src/server/injected/roleUtils.ts
+1 −2 packages/playwright-core/src/utils/network.ts
+26 −23 packages/playwright-core/types/types.d.ts
+3 −3 packages/playwright-ct-core/package.json
+27 −2 packages/playwright-ct-core/src/tsxTransform.ts
+0 −2 packages/playwright-ct-core/types/component.d.ts
+3 −4 packages/playwright-ct-react/package.json
+1 −3 packages/playwright-ct-react17/cli.js
+3 −4 packages/playwright-ct-react17/package.json
+1 −3 packages/playwright-ct-solid/cli.js
+3 −4 packages/playwright-ct-solid/package.json
+1 −3 packages/playwright-ct-svelte/cli.js
+3 −4 packages/playwright-ct-svelte/package.json
+1 −3 packages/playwright-ct-vue/cli.js
+3 −4 packages/playwright-ct-vue/package.json
+1 −3 packages/playwright-ct-vue2/cli.js
+3 −4 packages/playwright-ct-vue2/package.json
+1 −1 packages/playwright-firefox/cli.js
+2 −2 packages/playwright-firefox/package.json
+2 −2 packages/playwright-test/package.json
+1 −1 packages/playwright-webkit/cli.js
+2 −2 packages/playwright-webkit/package.json
+2 −2 packages/playwright/package.json
+7 −3 packages/playwright/src/third_party/tsconfig-loader.ts
+6 −0 tests/installation/playwright-cli-install-should-work.spec.ts
+17 −0 tests/page/selectors-role.spec.ts
+34 −0 tests/playwright-test/playwright.ct-react.spec.ts
+1 −1 tests/playwright-test/web-server.spec.ts
2 changes: 1 addition & 1 deletion run.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
)

const (
playwrightCliVersion = "1.42.0"
playwrightCliVersion = "1.42.1"
)

var playwrightCDNMirrors = []string{
Expand Down

0 comments on commit 85fd401

Please sign in to comment.