From 9d09fc503a8f391ea1758e5cabd0fa6ce27e2390 Mon Sep 17 00:00:00 2001 From: "microsoft-playwright-automation[bot]" <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com> Date: Mon, 23 Nov 2026 20:03:02 +0000 Subject: [PATCH] chore(driver): roll to 1.66.0-next (61775c1ae6) --- README.md | 2 +- .../microsoft/playwright/BrowserContext.java | 11 ++- .../com/microsoft/playwright/BrowserType.java | 78 +++++++++++++++++-- .../java/com/microsoft/playwright/Frame.java | 8 ++ .../microsoft/playwright/FrameLocator.java | 8 ++ .../com/microsoft/playwright/Keyboard.java | 5 ++ .../com/microsoft/playwright/Locator.java | 8 ++ .../java/com/microsoft/playwright/Page.java | 8 ++ .../playwright/impl/BrowserTypeImpl.java | 16 ++-- .../microsoft/playwright/impl/FrameImpl.java | 8 -- .../microsoft/playwright/impl/RouteImpl.java | 4 +- .../microsoft/playwright/impl/WorkerImpl.java | 14 ---- .../impl/isomorphic/StringUtils.java | 49 +++++++++++- .../protocol/BrowserContextInitializer.java | 1 + .../BrowserNewContextForReuseParams.java | 1 + .../protocol/BrowserNewContextParams.java | 1 + .../impl/protocol/BrowserTypeChannel.java | 4 - .../BrowserTypeConnectOverCDPParams.java | 1 + .../BrowserTypeConnectToWorkerParams.java | 23 ------ .../BrowserTypeConnectToWorkerResult.java | 23 ------ ...wserTypeLaunchPersistentContextParams.java | 1 + .../impl/protocol/WorkerChannel.java | 4 - .../impl/protocol/WorkerDisconnectParams.java | 23 ------ .../test/assets/extension-mv3-simple/index.js | 4 + .../playwright/TestFrameNavigate.java | 7 +- .../playwright/fixtures/TestChildProcess.java | 8 ++ .../playwright/fixtures/TestServer.java | 19 +++++ .../library/TestBrowsercontextFetch.java | 18 ++--- .../TestBrowsercontextNetworkEvent.java | 26 +++++++ .../TestBrowsercontextStorageState.java | 3 +- .../tests/library/TestBrowsertypeConnect.java | 54 ++++++------- .../tests/library/TestBrowsertypeLaunch.java | 3 +- .../tests/library/TestEmulationFocus.java | 24 ++++++ .../tests/library/TestGlobalFetch.java | 23 +++++- .../playwright/tests/library/TestHar.java | 10 ++- .../tests/library/TestHitTarget.java | 6 +- .../tests/library/TestPageClock.java | 25 ++++-- .../tests/library/TestScreencast.java | 13 ++-- .../tests/library/TestSelectorsRegister.java | 9 +-- .../tests/library/TestWebSocket.java | 18 +++++ .../library/chromium/TestConnectOverCdp.java | 14 ++-- .../page/TestElementhandleEvalOnSelector.java | 3 +- .../page/TestElementhandleScreenshot.java | 3 +- .../tests/page/TestFrameEvaluate.java | 3 +- .../playwright/tests/page/TestFrameGoto.java | 3 +- .../tests/page/TestFrameHierarchy.java | 31 ++++++++ .../page/TestLocatorWaitForFunction.java | 27 ++++++- .../playwright/tests/page/TestPageBasic.java | 10 +++ .../tests/page/TestPageClickReact.java | 3 +- .../tests/page/TestPageClickTimeout1.java | 6 +- .../tests/page/TestPageClickTimeout2.java | 6 +- .../tests/page/TestPageClickTimeout3.java | 6 +- .../tests/page/TestPageClickTimeout4.java | 3 +- .../tests/page/TestPageEvaluate.java | 2 +- .../tests/page/TestPageEventPopup.java | 33 ++++++++ .../tests/page/TestPageExposeFunction.java | 3 +- .../tests/page/TestPageFilechooser.java | 32 +++++--- .../playwright/tests/page/TestPageFill.java | 4 +- .../playwright/tests/page/TestPageGoto.java | 21 ++--- .../tests/page/TestPageNetworkResponse.java | 24 ++++++ .../tests/page/TestPageRequestIntercept.java | 3 +- .../tests/page/TestPageScreenshot.java | 41 ++++++++++ .../tests/page/TestPageSetContent.java | 3 +- .../tests/page/TestPageWaitForFunction.java | 12 ++- .../tests/page/TestPageWaitForLoadState.java | 3 +- .../tests/page/TestPageWaitForNavigation.java | 3 +- .../tests/page/TestPageWaitForSelector2.java | 20 +++-- .../tests/page/TestPageWaitForUrl.java | 3 +- .../tests/page/TestSelectorsFrame.java | 5 +- .../tests/page/TestSelectorsGetBy.java | 20 +++++ .../playwright/tests/page/TestWorkers.java | 40 +++++++++- playwright/src/test/upstream_base.txt | 2 +- playwright/src/test/upstream_not_ported.txt | 8 +- playwright/src/test/upstream_registry.md | 27 +++++-- scripts/DRIVER_VERSION | 2 +- 75 files changed, 689 insertions(+), 311 deletions(-) delete mode 100644 playwright/src/main/java/com/microsoft/playwright/impl/protocol/BrowserTypeConnectToWorkerParams.java delete mode 100644 playwright/src/main/java/com/microsoft/playwright/impl/protocol/BrowserTypeConnectToWorkerResult.java delete mode 100644 playwright/src/main/java/com/microsoft/playwright/impl/protocol/WorkerDisconnectParams.java diff --git a/README.md b/README.md index aa9ab07c3..5a4a7f0b1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 158.0.8127.18 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 159.0.8154.13 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 27.2 | ✅ | ✅ | ✅ | | Firefox 159.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java index a8920e118..413ab4152 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java @@ -1520,10 +1520,13 @@ default void routeFromHAR(Path har) { * * @param offline Whether to emulate network being offline for the browser context. * - *

NOTE: Offline emulation only affects requests that go through the browser's regular network stack, such as page navigations, - * {@code fetch()}, {@code XMLHttpRequest} and WebSockets. It does not affect WebRTC traffic: established {@code - * RTCPeerConnection}s keep sending and receiving media over UDP. To test WebRTC connection loss, interrupt the connection - * outside the browser, for example by stopping the TURN server or using an OS-level firewall. + *

NOTE: Offline emulation affects HTTP requests, such as page navigations, {@code fetch()} and {@code XMLHttpRequest}.WebSocket behavior depends on the browser and whether the connection is already established. Chromium and Firefox fail + * new WebSocket connections while offline, but do not close already-open connections. Chromium can defer incoming messages + * until the context goes back online, rather than lose them; Firefox can continue delivering messages while offline. + * WebKit can allow both new WebSocket connections and traffic on established connections while offline. Do not rely on + * offline emulation to test WebSocket message loss or connection closure.Offline emulation does not affect WebRTC traffic: established {@code RTCPeerConnection}s keep sending and receiving + * media over UDP. To test WebRTC connection loss, interrupt the connection outside the browser, for example by stopping + * the TURN server or using an OS-level firewall. * @since v1.8 */ void setOffline(boolean offline); diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java index 62b38ac26..90e854a4b 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java @@ -131,6 +131,20 @@ class ConnectOverCDPOptions { public @Nullable Path artifactsDir; /** * Additional HTTP headers to be sent with connect request. Optional. + * + *

When {@code endpointURL} is an extension URL such as {@code extension://chrome}, the headers are not sent. They are the + * options of the connection: + *

*/ public @Nullable Map headers; /** @@ -167,6 +181,20 @@ public ConnectOverCDPOptions setArtifactsDir(Path artifactsDir) { } /** * Additional HTTP headers to be sent with connect request. Optional. + * + *

When {@code endpointURL} is an extension URL such as {@code extension://chrome}, the headers are not sent. They are the + * options of the connection: + *

*/ public ConnectOverCDPOptions setHeaders(Map headers) { this.headers = headers; @@ -1361,10 +1389,27 @@ default Browser connect(String endpoint) { * @param endpointURL A CDP websocket endpoint or http url to connect to. For example {@code http://localhost:9222/} or {@code * ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4}. * - *

Alternatively, a browser channel name such as {@code chrome} or {@code msedge} to connect to a browser with remote - * debugging enabled in its default user data directory. On Linux, Playwright uses {@code CHROME_USER_DATA_DIR} when set. - * Otherwise, it uses {@code CHROME_CONFIG_HOME}, then {@code XDG_CONFIG_HOME}, then {@code ~/.config} to locate that - * directory. + *

Alternatively, a URL that tells which running browser to connect to: + *

+ * + *

The values of {@code userDataDir} and {@code executablePath} must be URL-encoded, for example with {@code + * encodeURIComponent} or {@code URLSearchParams}. The channel is a browser channel name such as {@code chrome}, {@code + * chrome-beta} or {@code msedge}. The default user data directory of the channel is where the browser keeps its data. On + * Linux, Playwright uses {@code CHROME_USER_DATA_DIR} when set. Otherwise, it uses {@code CHROME_CONFIG_HOME}, then {@code + * XDG_CONFIG_HOME}, then {@code ~/.config} to locate that directory. * @since v1.9 */ default Browser connectOverCDP(String endpointURL) { @@ -1395,10 +1440,27 @@ default Browser connectOverCDP(String endpointURL) { * @param endpointURL A CDP websocket endpoint or http url to connect to. For example {@code http://localhost:9222/} or {@code * ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4}. * - *

Alternatively, a browser channel name such as {@code chrome} or {@code msedge} to connect to a browser with remote - * debugging enabled in its default user data directory. On Linux, Playwright uses {@code CHROME_USER_DATA_DIR} when set. - * Otherwise, it uses {@code CHROME_CONFIG_HOME}, then {@code XDG_CONFIG_HOME}, then {@code ~/.config} to locate that - * directory. + *

Alternatively, a URL that tells which running browser to connect to: + *

+ * + *

The values of {@code userDataDir} and {@code executablePath} must be URL-encoded, for example with {@code + * encodeURIComponent} or {@code URLSearchParams}. The channel is a browser channel name such as {@code chrome}, {@code + * chrome-beta} or {@code msedge}. The default user data directory of the channel is where the browser keeps its data. On + * Linux, Playwright uses {@code CHROME_USER_DATA_DIR} when set. Otherwise, it uses {@code CHROME_CONFIG_HOME}, then {@code + * XDG_CONFIG_HOME}, then {@code ~/.config} to locate that directory. * @since v1.9 */ Browser connectOverCDP(String endpointURL, @Nullable ConnectOverCDPOptions options); diff --git a/playwright/src/main/java/com/microsoft/playwright/Frame.java b/playwright/src/main/java/com/microsoft/playwright/Frame.java index a8b5e7b1d..db86d78f3 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Frame.java +++ b/playwright/src/main/java/com/microsoft/playwright/Frame.java @@ -3470,6 +3470,8 @@ default Locator getByAltText(Pattern text) { * Allows locating input elements by the text of the associated {@code

Associated {@code

Usage * *

For example, this method will find inputs by label "Username" and "Password" in the following DOM: @@ -3488,6 +3490,8 @@ default Locator getByLabel(String text) { * Allows locating input elements by the text of the associated {@code

Associated {@code

Usage * *

For example, this method will find inputs by label "Username" and "Password" in the following DOM: @@ -3504,6 +3508,8 @@ default Locator getByLabel(String text) { * Allows locating input elements by the text of the associated {@code

Associated {@code

Usage * *

For example, this method will find inputs by label "Username" and "Password" in the following DOM: @@ -3522,6 +3528,8 @@ default Locator getByLabel(Pattern text) { * Allows locating input elements by the text of the associated {@code

Associated {@code

Usage * *

For example, this method will find inputs by label "Username" and "Password" in the following DOM: diff --git a/playwright/src/main/java/com/microsoft/playwright/FrameLocator.java b/playwright/src/main/java/com/microsoft/playwright/FrameLocator.java index 2559fdb49..8deee87e6 100644 --- a/playwright/src/main/java/com/microsoft/playwright/FrameLocator.java +++ b/playwright/src/main/java/com/microsoft/playwright/FrameLocator.java @@ -510,6 +510,8 @@ default Locator getByAltText(Pattern text) { * Allows locating input elements by the text of the associated {@code

Associated {@code

Usage * *

For example, this method will find inputs by label "Username" and "Password" in the following DOM: @@ -528,6 +530,8 @@ default Locator getByLabel(String text) { * Allows locating input elements by the text of the associated {@code

Associated {@code

Usage * *

For example, this method will find inputs by label "Username" and "Password" in the following DOM: @@ -544,6 +548,8 @@ default Locator getByLabel(String text) { * Allows locating input elements by the text of the associated {@code

Associated {@code

Usage * *

For example, this method will find inputs by label "Username" and "Password" in the following DOM: @@ -562,6 +568,8 @@ default Locator getByLabel(Pattern text) { * Allows locating input elements by the text of the associated {@code

Associated {@code

Usage * *

For example, this method will find inputs by label "Username" and "Password" in the following DOM: diff --git a/playwright/src/main/java/com/microsoft/playwright/Keyboard.java b/playwright/src/main/java/com/microsoft/playwright/Keyboard.java index 8b6225b55..1053eb0b0 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Keyboard.java +++ b/playwright/src/main/java/com/microsoft/playwright/Keyboard.java @@ -28,6 +28,11 @@ * com.microsoft.playwright.Keyboard#up Keyboard.up()}, and {@link com.microsoft.playwright.Keyboard#insertText * Keyboard.insertText()} to manually fire events as if they were generated from a real keyboard. * + *

NOTE: Caps Lock state emulation is not supported. Pressing {@code CapsLock} dispatches keyboard events, but does not make + * subsequent lowercase input uppercase. To type uppercase text, pass uppercase characters to {@link + * com.microsoft.playwright.Locator#pressSequentially Locator.pressSequentially()} or {@link + * com.microsoft.playwright.Keyboard#type Keyboard.type()}. + * *

An example of holding down {@code Shift} in order to select and delete some text: *

{@code
  * page.keyboard().type("Hello World!");
diff --git a/playwright/src/main/java/com/microsoft/playwright/Locator.java b/playwright/src/main/java/com/microsoft/playwright/Locator.java
index 6a3f129fc..2b3976301 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Locator.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Locator.java
@@ -3700,6 +3700,8 @@ default Locator getByAltText(Pattern text) {
    * Allows locating input elements by the text of the associated {@code