From 880f7bbdf7700ce95428632dd8c713df84e90393 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Fri, 27 Mar 2026 10:58:04 -0700 Subject: [PATCH 1/3] chore: roll to 1.59.0-alpha-1774622285000 - Add Overlay API (page.overlay()) with show/chapter/setVisible - Add Debugger.requestPause(), change pausedDetails() to return single PausedDetails - Fix Video.start() to handle path option locally and pass annotate/size to protocol - Fix Response.httpVersion() to call protocol method - Fix ResponseImpl to set request.existingResponse in constructor - Fix TracingImpl to track additionalSources from group() locations - Fix DialogImpl.dismiss() to swallow TargetClosedErrors for beforeunload dialogs - Fix HarRouter to merge set-cookie headers - Fix ConsoleMessagesFilter.SINCE_NAVIGATION serialization to kebab-case - Fix Locator.normalize() to use resolveSelector protocol message --- .../com/microsoft/playwright/Debugger.java | 12 +- .../com/microsoft/playwright/Locator.java | 20 +++- .../com/microsoft/playwright/Overlay.java | 109 ++++++++++++++++++ .../java/com/microsoft/playwright/Page.java | 14 ++- .../playwright/impl/DebuggerImpl.java | 17 +-- .../microsoft/playwright/impl/DialogImpl.java | 6 +- .../microsoft/playwright/impl/HARRouter.java | 23 +++- .../microsoft/playwright/impl/LocalUtils.java | 9 +- .../playwright/impl/LocatorImpl.java | 4 +- .../playwright/impl/OverlayImpl.java | 68 +++++++++++ .../microsoft/playwright/impl/PageImpl.java | 7 ++ .../playwright/impl/ResponseImpl.java | 7 +- .../playwright/impl/Serialization.java | 2 +- .../playwright/impl/TracingImpl.java | 15 ++- .../microsoft/playwright/impl/VideoImpl.java | 12 +- .../playwright/options/Annotate.java | 28 ++++- .../playwright/options/AnnotatePosition.java | 26 +++++ .../microsoft/playwright/TestDebugger.java | 39 +++---- scripts/DRIVER_VERSION | 2 +- 19 files changed, 361 insertions(+), 59 deletions(-) create mode 100644 playwright/src/main/java/com/microsoft/playwright/Overlay.java create mode 100644 playwright/src/main/java/com/microsoft/playwright/impl/OverlayImpl.java create mode 100644 playwright/src/main/java/com/microsoft/playwright/options/AnnotatePosition.java diff --git a/playwright/src/main/java/com/microsoft/playwright/Debugger.java b/playwright/src/main/java/com/microsoft/playwright/Debugger.java index 4b50975de..633f9518c 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Debugger.java +++ b/playwright/src/main/java/com/microsoft/playwright/Debugger.java @@ -35,11 +35,11 @@ public interface Debugger { void offPausedStateChanged(Runnable handler); /** - * Returns details about the currently paused calls. Returns an empty array if the debugger is not paused. + * Returns details about the currently paused call. Returns {@code null} if the debugger is not paused. * * @since v1.59 */ - List pausedDetails(); + PausedDetails pausedDetails(); /** * Configures the debugger to pause before the next action is executed. * @@ -47,13 +47,13 @@ public interface Debugger { * com.microsoft.playwright.Debugger#runTo Debugger.runTo()} to step while paused. * *

Note that {@link com.microsoft.playwright.Page#pause Page.pause()} is equivalent to a "debugger" statement — it pauses - * execution at the call site immediately. On the contrary, {@link com.microsoft.playwright.Debugger#pause - * Debugger.pause()} is equivalent to "pause on next statement" — it configures the debugger to pause before the next - * action is executed. + * execution at the call site immediately. On the contrary, {@link com.microsoft.playwright.Debugger#requestPause + * Debugger.requestPause()} is equivalent to "pause on next statement" — it configures the debugger to pause before the + * next action is executed. * * @since v1.59 */ - void pause(); + void requestPause(); /** * Resumes script execution. Throws if the debugger is not paused. * diff --git a/playwright/src/main/java/com/microsoft/playwright/Locator.java b/playwright/src/main/java/com/microsoft/playwright/Locator.java index e05d86c9f..f4fe34399 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Locator.java +++ b/playwright/src/main/java/com/microsoft/playwright/Locator.java @@ -35,8 +35,8 @@ class AriaSnapshotOptions { */ public Integer depth; /** - * When set to {@code "ai"}, returns a snapshot optimized for AI consumption with element references. Defaults to {@code - * "default"}. + * When set to {@code "ai"}, returns a snapshot optimized for AI consumption. Defaults to {@code "default"}. See details + * for more information. */ public AriaSnapshotMode mode; /** @@ -55,8 +55,8 @@ public AriaSnapshotOptions setDepth(int depth) { return this; } /** - * When set to {@code "ai"}, returns a snapshot optimized for AI consumption with element references. Defaults to {@code - * "default"}. + * When set to {@code "ai"}, returns a snapshot optimized for AI consumption. Defaults to {@code "default"}. See details + * for more information. */ public AriaSnapshotOptions setMode(AriaSnapshotMode mode) { this.mode = mode; @@ -2322,6 +2322,12 @@ public WaitForOptions setTimeout(double timeout) { * *

Below is the HTML markup and the respective ARIA snapshot: * + *

An AI-optimized snapshot, controlled by {@code mode}, is different from a default snapshot: + *

    + *
  1. Includes element references {@code [ref=e2]}. 2. Does not wait for an element matching the locator, and throws when no + * elements match. 3. Includes snapshots of {@code