[} locator immediately after capturing the
- * snapshot to perform actions on the element.
- */
- public AriaSnapshotOptions setRef(boolean ref) {
- this.ref = ref;
- return this;
- }
/**
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
@@ -2615,6 +2602,14 @@ default void dblclick() {
* @since v1.14
*/
void dblclick(DblclickOptions options);
+ /**
+ * Describes the locator, description is used in the trace viewer and reports. Returns the locator pointing to the same
+ * element.
+ *
+ * @param description Locator description.
+ * @since v1.53
+ */
+ Locator describe(String description);
/**
* Programmatically dispatch an event on the matching element.
*
@@ -2861,6 +2856,14 @@ default ElementHandle elementHandle() {
*
* ] Usage
*
+ *
Passing argument to {@code expression}:
+ *
{@code
+ * Object result = page.getByTestId("myId").evaluate("(element, [x, y]) => {\n" +
+ * " return element.textContent + ' ' + x * y;\n" +
+ * "}", Arrays.asList(7, 8));
+ * System.out.println(result); // prints "myId text 56"
+ * }
+ *
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
* automatically invoked.
* @param arg Optional argument to pass to {@code expression}.
@@ -2885,6 +2888,14 @@ default Object evaluate(String expression, Object arg) {
*
* Usage
*
+ *
Passing argument to {@code expression}:
+ *
{@code
+ * Object result = page.getByTestId("myId").evaluate("(element, [x, y]) => {\n" +
+ * " return element.textContent + ' ' + x * y;\n" +
+ * "}", Arrays.asList(7, 8));
+ * System.out.println(result); // prints "myId text 56"
+ * }
+ *
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
* automatically invoked.
* @since v1.14
@@ -2908,6 +2919,14 @@ default Object evaluate(String expression) {
*
* Usage
*
+ *
Passing argument to {@code expression}:
+ *
{@code
+ * Object result = page.getByTestId("myId").evaluate("(element, [x, y]) => {\n" +
+ * " return element.textContent + ' ' + x * y;\n" +
+ * "}", Arrays.asList(7, 8));
+ * System.out.println(result); // prints "myId text 56"
+ * }
+ *
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
* automatically invoked.
* @param arg Optional argument to pass to {@code expression}.
diff --git a/playwright/src/main/java/com/microsoft/playwright/Tracing.java b/playwright/src/main/java/com/microsoft/playwright/Tracing.java
index 63521e37f..987218b41 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Tracing.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Tracing.java
@@ -23,6 +23,12 @@
* API for collecting and saving Playwright traces. Playwright traces can be opened in Trace Viewer after Playwright script runs.
*
+ * NOTE: You probably want to enable tracing in
+ * your config file instead of using {@code context.tracing}.The {@code context.tracing} API captures browser operations and network activity, but it doesn't record test assertions
+ * (like {@code expect} calls). We recommend enabling tracing through Playwright Test
+ * configuration, which includes those assertions and provides a more complete trace for debugging test failures.
+ *
*
Start recording a trace before performing actions. At the end, stop tracing and save it to a file.
*
{@code
* Browser browser = chromium.launch();
@@ -200,6 +206,12 @@ public StopChunkOptions setPath(Path path) {
/**
* Start tracing.
*
+ * NOTE: You probably want to enable tracing in
+ * your config file instead of using {@code Tracing.start}.The {@code context.tracing} API captures browser operations and network activity, but it doesn't record test assertions
+ * (like {@code expect} calls). We recommend enabling tracing through Playwright Test
+ * configuration, which includes those assertions and provides a more complete trace for debugging test failures.
+ *
*
Usage
*
{@code
* context.tracing().start(new Tracing.StartOptions()
@@ -219,6 +231,12 @@ default void start() {
/**
* Start tracing.
*
+ * NOTE: You probably want to enable tracing in
+ * your config file instead of using {@code Tracing.start}.The {@code context.tracing} API captures browser operations and network activity, but it doesn't record test assertions
+ * (like {@code expect} calls). We recommend enabling tracing through Playwright Test
+ * configuration, which includes those assertions and provides a more complete trace for debugging test failures.
+ *
*
Usage
*
{@code
* context.tracing().start(new Tracing.StartOptions()
diff --git a/playwright/src/main/java/com/microsoft/playwright/assertions/LocatorAssertions.java b/playwright/src/main/java/com/microsoft/playwright/assertions/LocatorAssertions.java
index a8607fdfd..e541404af 100644
--- a/playwright/src/main/java/com/microsoft/playwright/assertions/LocatorAssertions.java
+++ b/playwright/src/main/java/com/microsoft/playwright/assertions/LocatorAssertions.java
@@ -885,7 +885,7 @@ default void isVisible() {
* When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected
* class lists. Each element's class attribute is matched against the corresponding class in the array:
*
{@code
- * assertThat(page.locator("list > .component")).containsClass(new String[] {"inactive", "active", "inactive"});
+ * assertThat(page.locator(".list > .component")).containsClass(new String[] {"inactive", "active", "inactive"});
* }
*
* @param expected A string containing expected class names, separated by spaces, or a list of such strings to assert multiple elements.
@@ -909,7 +909,7 @@ default void containsClass(String expected) {
* When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected
* class lists. Each element's class attribute is matched against the corresponding class in the array:
*
{@code
- * assertThat(page.locator("list > .component")).containsClass(new String[] {"inactive", "active", "inactive"});
+ * assertThat(page.locator(".list > .component")).containsClass(new String[] {"inactive", "active", "inactive"});
* }
*
* @param expected A string containing expected class names, separated by spaces, or a list of such strings to assert multiple elements.
@@ -931,7 +931,7 @@ default void containsClass(String expected) {
* When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected
* class lists. Each element's class attribute is matched against the corresponding class in the array:
*
{@code
- * assertThat(page.locator("list > .component")).containsClass(new String[] {"inactive", "active", "inactive"});
+ * assertThat(page.locator(".list > .component")).containsClass(new String[] {"inactive", "active", "inactive"});
* }
*
* @param expected A string containing expected class names, separated by spaces, or a list of such strings to assert multiple elements.
@@ -955,7 +955,7 @@ default void containsClass(List expected) {
* When an array is passed, the method asserts that the list of elements located matches the corresponding list of expected
* class lists. Each element's class attribute is matched against the corresponding class in the array:
*
{@code
- * assertThat(page.locator("list > .component")).containsClass(new String[] {"inactive", "active", "inactive"});
+ * assertThat(page.locator(".list > .component")).containsClass(new String[] {"inactive", "active", "inactive"});
* }
*
* @param expected A string containing expected class names, separated by spaces, or a list of such strings to assert multiple elements.
@@ -1565,7 +1565,7 @@ default void hasAttribute(String name, Pattern value) {
* class values. Each element's class attribute is matched against the corresponding string or regular expression in the
* array:
* {@code
- * assertThat(page.locator("list > .component")).hasClass(new String[] {"component", "component selected", "component"});
+ * assertThat(page.locator(".list > .component")).hasClass(new String[] {"component", "component selected", "component"});
* }
*
* @param expected Expected class or RegExp or a list of those.
@@ -1589,7 +1589,7 @@ default void hasClass(String expected) {
* class values. Each element's class attribute is matched against the corresponding string or regular expression in the
* array:
* {@code
- * assertThat(page.locator("list > .component")).hasClass(new String[] {"component", "component selected", "component"});
+ * assertThat(page.locator(".list > .component")).hasClass(new String[] {"component", "component selected", "component"});
* }
*
* @param expected Expected class or RegExp or a list of those.
@@ -1611,7 +1611,7 @@ default void hasClass(String expected) {
* class values. Each element's class attribute is matched against the corresponding string or regular expression in the
* array:
* {@code
- * assertThat(page.locator("list > .component")).hasClass(new String[] {"component", "component selected", "component"});
+ * assertThat(page.locator(".list > .component")).hasClass(new String[] {"component", "component selected", "component"});
* }
*
* @param expected Expected class or RegExp or a list of those.
@@ -1635,7 +1635,7 @@ default void hasClass(Pattern expected) {
* class values. Each element's class attribute is matched against the corresponding string or regular expression in the
* array:
* {@code
- * assertThat(page.locator("list > .component")).hasClass(new String[] {"component", "component selected", "component"});
+ * assertThat(page.locator(".list > .component")).hasClass(new String[] {"component", "component selected", "component"});
* }
*
* @param expected Expected class or RegExp or a list of those.
@@ -1657,7 +1657,7 @@ default void hasClass(Pattern expected) {
* class values. Each element's class attribute is matched against the corresponding string or regular expression in the
* array:
* {@code
- * assertThat(page.locator("list > .component")).hasClass(new String[] {"component", "component selected", "component"});
+ * assertThat(page.locator(".list > .component")).hasClass(new String[] {"component", "component selected", "component"});
* }
*
* @param expected Expected class or RegExp or a list of those.
@@ -1681,7 +1681,7 @@ default void hasClass(String[] expected) {
* class values. Each element's class attribute is matched against the corresponding string or regular expression in the
* array:
* {@code
- * assertThat(page.locator("list > .component")).hasClass(new String[] {"component", "component selected", "component"});
+ * assertThat(page.locator(".list > .component")).hasClass(new String[] {"component", "component selected", "component"});
* }
*
* @param expected Expected class or RegExp or a list of those.
@@ -1703,7 +1703,7 @@ default void hasClass(String[] expected) {
* class values. Each element's class attribute is matched against the corresponding string or regular expression in the
* array:
* {@code
- * assertThat(page.locator("list > .component")).hasClass(new String[] {"component", "component selected", "component"});
+ * assertThat(page.locator(".list > .component")).hasClass(new String[] {"component", "component selected", "component"});
* }
*
* @param expected Expected class or RegExp or a list of those.
@@ -1727,7 +1727,7 @@ default void hasClass(Pattern[] expected) {
* class values. Each element's class attribute is matched against the corresponding string or regular expression in the
* array:
* {@code
- * assertThat(page.locator("list > .component")).hasClass(new String[] {"component", "component selected", "component"});
+ * assertThat(page.locator(".list > .component")).hasClass(new String[] {"component", "component selected", "component"});
* }
*
* @param expected Expected class or RegExp or a list of those.
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestContextImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestContextImpl.java
index 3ee5506fb..90152d6c5 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestContextImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestContextImpl.java
@@ -39,6 +39,8 @@ class APIRequestContextImpl extends ChannelOwner implements APIRequestContext {
private final TracingImpl tracing;
private String disposeReason;
+ protected TimeoutSettings timeoutSettings = new TimeoutSettings();
+
APIRequestContextImpl(ChannelOwner parent, String type, String guid, JsonObject initializer) {
super(parent, type, guid, initializer);
this.tracing = connection.getExistingObject(initializer.getAsJsonObject("tracing").get("guid").getAsString());
@@ -93,6 +95,7 @@ private APIResponse fetchImpl(String url, RequestOptionsImpl options) {
if (options == null) {
options = new RequestOptionsImpl();
}
+ options.timeout = timeoutSettings.timeout(options.timeout);
JsonObject params = new JsonObject();
params.addProperty("url", url);
if (options.params != null) {
@@ -132,9 +135,7 @@ private APIResponse fetchImpl(String url, RequestOptionsImpl options) {
if (options.multipart != null) {
params.add("multipartData", serializeMultipartData(options.multipart.fields));
}
- if (options.timeout != null) {
- params.addProperty("timeout", options.timeout);
- }
+ params.addProperty("timeout", timeoutSettings.timeout(options.timeout));
if (options.failOnStatusCode != null) {
params.addProperty("failOnStatusCode", options.failOnStatusCode);
}
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestImpl.java
index eb6181f03..670e0e64d 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestImpl.java
@@ -74,6 +74,7 @@ private APIRequestContextImpl newContextImpl(NewContextOptions options) {
addToProtocol(params, clientCertificateList);
JsonObject result = playwright.sendMessage("newRequest", params).getAsJsonObject();
APIRequestContextImpl context = playwright.connection.getExistingObject(result.getAsJsonObject("request").get("guid").getAsString());
+ context.timeoutSettings.setDefaultTimeout(options.timeout);
return context;
}
}
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java
index 4d0f84025..b06d127de 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java
@@ -105,6 +105,7 @@ enum EventType {
}
tracing = connection.getExistingObject(initializer.getAsJsonObject("tracing").get("guid").getAsString());
request = connection.getExistingObject(initializer.getAsJsonObject("requestContext").get("guid").getAsString());
+ request.timeoutSettings = timeoutSettings;
clock = new ClockImpl(this);
closePromise = new WaitableEvent<>(listeners, EventType.CLOSE);
}
@@ -559,30 +560,12 @@ void recordIntoHar(PageImpl page, Path har, RouteFromHAROptions options) {
@Override
public void setDefaultNavigationTimeout(double timeout) {
- setDefaultNavigationTimeoutImpl(timeout);
- }
-
- void setDefaultNavigationTimeoutImpl(Double timeout) {
- withLogging("BrowserContext.setDefaultNavigationTimeout", () -> {
- timeoutSettings.setDefaultNavigationTimeout(timeout);
- JsonObject params = new JsonObject();
- params.addProperty("timeout", timeout);
- sendMessage("setDefaultNavigationTimeoutNoReply", params);
- });
+ timeoutSettings.setDefaultNavigationTimeout(timeout);
}
@Override
public void setDefaultTimeout(double timeout) {
- setDefaultTimeoutImpl(timeout);
- }
-
- void setDefaultTimeoutImpl(Double timeout) {
- withLogging("BrowserContext.setDefaultTimeout", () -> {
- timeoutSettings.setDefaultTimeout(timeout);
- JsonObject params = new JsonObject();
- params.addProperty("timeout", timeout);
- sendMessage("setDefaultTimeoutNoReply", params);
- });
+ timeoutSettings.setDefaultTimeout(timeout);
}
@Override
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/BrowserTypeImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/BrowserTypeImpl.java
index 9521f77a7..a00e42d00 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/BrowserTypeImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/BrowserTypeImpl.java
@@ -48,6 +48,7 @@ private BrowserImpl launchImpl(LaunchOptions options) {
if (options == null) {
options = new LaunchOptions();
}
+ options.timeout = TimeoutSettings.launchTimeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
JsonElement result = sendMessage("launch", params);
BrowserImpl browser = connection.getExistingObject(result.getAsJsonObject().getAsJsonObject("browser").get("guid").getAsString());
@@ -84,6 +85,10 @@ private Browser connectImpl(String wsEndpoint, ConnectOptions options) {
headers.addProperty("x-playwright-browser", name());
}
+ if (!params.has("timeout")) {
+ params.addProperty("timeout", 0);
+ }
+
JsonObject json = connection.localUtils().sendMessage("connect", params).getAsJsonObject();
JsonPipe pipe = connection.getExistingObject(json.getAsJsonObject("pipe").get("guid").getAsString());
Connection connection = new Connection(pipe, this.connection.env, this.connection.localUtils);
@@ -126,6 +131,7 @@ private Browser connectOverCDPImpl(String endpointURL, ConnectOverCDPOptions opt
if (options == null) {
options = new ConnectOverCDPOptions();
}
+ options.timeout = TimeoutSettings.launchTimeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("endpointURL", endpointURL);
@@ -195,6 +201,7 @@ private BrowserContextImpl launchPersistentContextImpl(Path userDataDir, LaunchP
throw new PlaywrightException("recordHarContent is set but recordHarPath is null");
}
}
+ options.timeout = TimeoutSettings.launchTimeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
if (!userDataDir.isAbsolute() && !userDataDir.toString().isEmpty()) {
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/ElementHandleImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/ElementHandleImpl.java
index 7ef0f942e..0736a4935 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/ElementHandleImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/ElementHandleImpl.java
@@ -40,8 +40,11 @@
import static com.microsoft.playwright.options.ScreenshotType.PNG;
public class ElementHandleImpl extends JSHandleImpl implements ElementHandle {
+ private final FrameImpl frame;
+
ElementHandleImpl(ChannelOwner parent, String type, String guid, JsonObject initializer) {
super(parent, type, guid, initializer);
+ this.frame = (FrameImpl)parent;
}
@Override
@@ -127,6 +130,7 @@ private void checkImpl(CheckOptions options) {
if (options == null) {
options = new CheckOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
sendMessage("check", params);
}
@@ -140,6 +144,7 @@ private void clickImpl(ClickOptions options) {
if (options == null) {
options = new ClickOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
sendMessage("click", params);
}
@@ -166,6 +171,7 @@ private void dblclickImpl(DblclickOptions options) {
if (options == null) {
options = new DblclickOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
sendMessage("dblclick", params);
}
@@ -189,6 +195,7 @@ private void fillImpl(String value, FillOptions options) {
if (options == null) {
options = new FillOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("value", value);
sendMessage("fill", params);
@@ -218,6 +225,7 @@ private void hoverImpl(HoverOptions options) {
if (options == null) {
options = new HoverOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
sendMessage("hover", params);
}
@@ -319,6 +327,7 @@ private void pressImpl(String key, PressOptions options) {
if (options == null) {
options = new PressOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("key", key);
sendMessage("press", params);
@@ -333,6 +342,7 @@ private byte[] screenshotImpl(ScreenshotOptions options) {
if (options == null) {
options = new ScreenshotOptions();
}
+ options.timeout = frame.timeout(options.timeout);
if (options.type == null) {
options.type = PNG;
if (options.path != null) {
@@ -379,6 +389,7 @@ public List selectOption(String[] values, SelectOptionOptions options) {
if (options == null) {
options = new SelectOptionOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
if (values != null) {
params.add("options", toSelectValueOrLabel(values));
@@ -396,6 +407,7 @@ private void scrollIntoViewIfNeededImpl(ScrollIntoViewIfNeededOptions options) {
if (options == null) {
options = new ScrollIntoViewIfNeededOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
sendMessage("scrollIntoViewIfNeeded", params);
}
@@ -454,6 +466,7 @@ private void selectTextImpl(SelectTextOptions options) {
if (options == null) {
options = new SelectTextOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
sendMessage("selectText", params);
}
@@ -471,6 +484,7 @@ void setInputFilesImpl(Path[] files, SetInputFilesOptions options) {
if (options == null) {
options = new SetInputFilesOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
addFilePathUploadParams(files, params, frame.page().context());
sendMessage("setInputFiles", params);
@@ -491,6 +505,7 @@ void setInputFilesImpl(FilePayload[] files, SetInputFilesOptions options) {
if (options == null) {
options = new SetInputFilesOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.add("payloads", Serialization.toJsonArray(files));
sendMessage("setInputFiles", params);
@@ -505,6 +520,7 @@ private void tapImpl(TapOptions options) {
if (options == null) {
options = new TapOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
sendMessage("tap", params);
}
@@ -530,6 +546,7 @@ private void typeImpl(String text, TypeOptions options) {
if (options == null) {
options = new TypeOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("text", text);
sendMessage("type", params);
@@ -544,6 +561,7 @@ private void uncheckImpl(UncheckOptions options) {
if (options == null) {
options = new UncheckOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
sendMessage("uncheck", params);
}
@@ -557,6 +575,7 @@ private void waitForElementStateImpl(ElementState state, WaitForElementStateOpti
if (options == null) {
options = new WaitForElementStateOptions();
}
+ options.timeout = frame.timeout(options.timeout);
if (state == null) {
throw new IllegalArgumentException("State cannot be null");
}
@@ -578,6 +597,7 @@ private ElementHandle waitForSelectorImpl(String selector, WaitForSelectorOption
if (options == null) {
options = new WaitForSelectorOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonElement json = sendMessage("waitForSelector", params);
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/FrameImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/FrameImpl.java
index e74eb5412..d31a0949a 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/FrameImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/FrameImpl.java
@@ -228,6 +228,7 @@ void checkImpl(String selector, CheckOptions options) {
if (options == null) {
options = new CheckOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
sendMessage("check", params);
@@ -247,6 +248,7 @@ void clickImpl(String selector, ClickOptions options) {
if (options == null) {
options = new ClickOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
sendMessage("click", params);
@@ -270,6 +272,7 @@ void dblclickImpl(String selector, DblclickOptions options) {
if (options == null) {
options = new DblclickOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
sendMessage("dblclick", params);
@@ -284,6 +287,7 @@ void dispatchEventImpl(String selector, String type, Object eventInit, DispatchE
if (options == null) {
options = new DispatchEventOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
params.addProperty("type", type);
@@ -329,6 +333,7 @@ void fillImpl(String selector, String value, FillOptions options) {
if (options == null) {
options = new FillOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
params.addProperty("value", value);
@@ -344,6 +349,7 @@ void focusImpl(String selector, FocusOptions options) {
if (options == null) {
options = new FocusOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
sendMessage("focus", params);
@@ -439,6 +445,7 @@ String getAttributeImpl(String selector, String name, GetAttributeOptions option
if (options == null) {
options = new GetAttributeOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
params.addProperty("name", name);
@@ -458,6 +465,7 @@ ResponseImpl navigateImpl(String url, NavigateOptions options) {
if (options == null) {
options = new NavigateOptions();
}
+ options.timeout = navigationTimeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("url", url);
JsonElement result = sendMessage("goto", params);
@@ -477,6 +485,7 @@ void hoverImpl(String selector, HoverOptions options) {
if (options == null) {
options = new HoverOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
sendMessage("hover", params);
@@ -491,6 +500,7 @@ void dragAndDropImpl(String source, String target, DragAndDropOptions options) {
if (options == null) {
options = new DragAndDropOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("source", source);
params.addProperty("target", target);
@@ -506,6 +516,7 @@ String innerHTMLImpl(String selector, InnerHTMLOptions options) {
if (options == null) {
options = new InnerHTMLOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonObject json = sendMessage("innerHTML", params).getAsJsonObject();
@@ -521,6 +532,7 @@ String innerTextImpl(String selector, InnerTextOptions options) {
if (options == null) {
options = new InnerTextOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonObject json = sendMessage("innerText", params).getAsJsonObject();
@@ -536,6 +548,7 @@ String inputValueImpl(String selector, InputValueOptions options) {
if (options == null) {
options = new InputValueOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonObject json = sendMessage("inputValue", params).getAsJsonObject();
@@ -551,6 +564,7 @@ boolean isCheckedImpl(String selector, IsCheckedOptions options) {
if (options == null) {
options = new IsCheckedOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonObject json = sendMessage("isChecked", params).getAsJsonObject();
@@ -571,6 +585,7 @@ boolean isDisabledImpl(String selector, IsDisabledOptions options) {
if (options == null) {
options = new IsDisabledOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonObject json = sendMessage("isDisabled", params).getAsJsonObject();
@@ -586,6 +601,7 @@ boolean isEditableImpl(String selector, IsEditableOptions options) {
if (options == null) {
options = new IsEditableOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonObject json = sendMessage("isEditable", params).getAsJsonObject();
@@ -601,6 +617,7 @@ boolean isEnabledImpl(String selector, IsEnabledOptions options) {
if (options == null) {
options = new IsEnabledOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonObject json = sendMessage("isEnabled", params).getAsJsonObject();
@@ -616,6 +633,7 @@ boolean isHiddenImpl(String selector, IsHiddenOptions options) {
if (options == null) {
options = new IsHiddenOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonObject json = sendMessage("isHidden", params).getAsJsonObject();
@@ -666,6 +684,7 @@ void pressImpl(String selector, String key, PressOptions options) {
if (options == null) {
options = new PressOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
params.addProperty("key", key);
@@ -681,6 +700,7 @@ List selectOptionImpl(String selector, SelectOption[] values, SelectOpti
if (options == null) {
options = new SelectOptionOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
if (values != null) {
@@ -693,6 +713,7 @@ List selectOptionImpl(String selector, String[] values, SelectOptionOpti
if (options == null) {
options = new SelectOptionOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
if (values != null) {
@@ -710,6 +731,7 @@ List selectOptionImpl(String selector, ElementHandle[] values, SelectOpt
if (options == null) {
options = new SelectOptionOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
if (values != null) {
@@ -750,6 +772,7 @@ void setContentImpl(String html, SetContentOptions options) {
if (options == null) {
options = new SetContentOptions();
}
+ options.timeout = navigationTimeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("html", html);
sendMessage("setContent", params);
@@ -764,6 +787,7 @@ void setInputFilesImpl(String selector, Path[] files, SetInputFilesOptions optio
if (options == null) {
options = new SetInputFilesOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
addFilePathUploadParams(files, params, page.context());
params.addProperty("selector", selector);
@@ -785,6 +809,7 @@ void setInputFilesImpl(String selector, FilePayload[] files, SetInputFilesOption
if (options == null) {
options = new SetInputFilesOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
params.add("payloads", toJsonArray(files));
@@ -799,6 +824,7 @@ void tapImpl(String selector, TapOptions options) {
if (options == null) {
options = new TapOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
sendMessage("tap", params);
@@ -813,6 +839,7 @@ String textContentImpl(String selector, TextContentOptions options) {
if (options == null) {
options = new TextContentOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
return sendMessage("textContent", params).getAsJsonObject().get("value").getAsString();
@@ -837,6 +864,7 @@ void typeImpl(String selector, String text, TypeOptions options) {
if (options == null) {
options = new TypeOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
params.addProperty("text", text);
@@ -852,6 +880,7 @@ void uncheckImpl(String selector, UncheckOptions options) {
if (options == null) {
options = new UncheckOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
sendMessage("uncheck", params);
@@ -871,6 +900,7 @@ JSHandle waitForFunctionImpl(String pageFunction, Object arg, WaitForFunctionOpt
if (options == null) {
options = new WaitForFunctionOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("expression", pageFunction);
params.add("arg", gson().toJsonTree(serializeArgument(arg)));
@@ -1054,6 +1084,7 @@ ElementHandle waitForSelectorImpl(String selector, WaitForSelectorOptions option
if (options == null) {
options = new WaitForSelectorOptions();
}
+ options.timeout = timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
params.addProperty("omitReturnValue", omitReturnValue);
@@ -1151,4 +1182,18 @@ protected void handleEvent(String event, JsonObject params) {
internalListeners.notify(InternalEventType.NAVIGATED, params);
}
}
+
+ protected double timeout(Double timeout) {
+ if (page != null) {
+ return page.timeoutSettings.timeout(timeout);
+ }
+ return new TimeoutSettings().timeout(timeout);
+ }
+
+ protected double navigationTimeout(Double timeout) {
+ if (page != null) {
+ return page.timeoutSettings.navigationTimeout(timeout);
+ }
+ return new TimeoutSettings().navigationTimeout(timeout);
+ }
}
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/LocatorImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/LocatorImpl.java
index ea66f9ec2..90f7b77e9 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/LocatorImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/LocatorImpl.java
@@ -127,6 +127,7 @@ private String ariaSnapshotImpl(AriaSnapshotOptions options) {
if (options == null) {
options = new AriaSnapshotOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
JsonObject result = frame.sendMessage("ariaSnapshot", params).getAsJsonObject();
@@ -142,6 +143,7 @@ private void blurImpl(BlurOptions options) {
if (options == null) {
options = new BlurOptions();
}
+ options.timeout = frame.timeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
params.addProperty("selector", selector);
params.addProperty("strict", true);
@@ -179,6 +181,11 @@ public int count() {
return frame.queryCount(selector);
}
+ @Override
+ public Locator describe(String description) {
+ return locator(describeSelector(description));
+ }
+
@Override
public void dblclick(DblclickOptions options) {
if (options == null) {
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/LocatorUtils.java b/playwright/src/main/java/com/microsoft/playwright/impl/LocatorUtils.java
index 025cce926..08e45028c 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/LocatorUtils.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/LocatorUtils.java
@@ -39,6 +39,10 @@ private static String getByAttributeTextSelector(String attrName, Object value,
return "internal:attr=[" + attrName + "=" + escapeForAttributeSelector(value, exact) + "]";
}
+ static String describeSelector(String description) {
+ return "internal:describe=" + gson().toJson(description);
+ }
+
static String getByTestIdSelector(Object testId, PlaywrightImpl playwright) {
String testIdAttributeName = ((SharedSelectors) playwright.selectors()).testIdAttributeName;
return getByAttributeTextSelector(testIdAttributeName, testId, true);
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/PageImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/PageImpl.java
index 2eff38309..8dbf29731 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/PageImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/PageImpl.java
@@ -95,7 +95,7 @@ private static final Map eventSubscriptions() {
BrowserContextImpl ownedContext;
private boolean isClosed;
final Set workers = new HashSet<>();
- private final TimeoutSettings timeoutSettings;
+ protected final TimeoutSettings timeoutSettings;
private VideoImpl video;
private final PageImpl opener;
private String closeReason;
@@ -908,6 +908,7 @@ Response goBackImpl(GoBackOptions options) {
if (options == null) {
options = new GoBackOptions();
}
+ options.timeout = timeoutSettings.navigationTimeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
JsonObject json = sendMessage("goBack", params).getAsJsonObject();
if (json.has("response")) {
@@ -925,6 +926,7 @@ Response goForwardImpl(GoForwardOptions options) {
if (options == null) {
options = new GoForwardOptions();
}
+ options.timeout = timeoutSettings.navigationTimeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
JsonObject json = sendMessage("goForward", params).getAsJsonObject();
if (json.has("response")) {
@@ -1045,13 +1047,13 @@ public void pause() {
withLogging("Page.pause", () -> {
Double defaultNavigationTimeout = browserContext.timeoutSettings.defaultNavigationTimeout();
Double defaultTimeout = browserContext.timeoutSettings.defaultTimeout();
- browserContext.setDefaultNavigationTimeoutImpl(0.0);
- browserContext.setDefaultTimeoutImpl(0.0);
+ browserContext.setDefaultNavigationTimeout(0.0);
+ browserContext.setDefaultTimeout(0.0);
try {
runUntil(() -> {}, new WaitableRace<>(asList(context().pause(), (Waitable) waitableClosedOrCrashed)));
} finally {
- browserContext.setDefaultNavigationTimeoutImpl(defaultNavigationTimeout);
- browserContext.setDefaultTimeoutImpl(defaultTimeout);
+ browserContext.setDefaultNavigationTimeout(defaultNavigationTimeout);
+ browserContext.setDefaultTimeout(defaultTimeout);
}
});
}
@@ -1095,6 +1097,7 @@ private Response reloadImpl(ReloadOptions options) {
if (options == null) {
options = new ReloadOptions();
}
+ options.timeout = timeoutSettings.navigationTimeout(options.timeout);
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
JsonObject json = sendMessage("reload", params).getAsJsonObject();
if (json.has("response")) {
@@ -1195,6 +1198,7 @@ private byte[] screenshotImpl(ScreenshotOptions options) {
if (options == null) {
options = new ScreenshotOptions();
}
+ options.timeout = timeoutSettings.timeout(options.timeout);
if (options.type == null) {
options.type = PNG;
if (options.path != null) {
@@ -1257,9 +1261,6 @@ public void setContent(String html, SetContentOptions options) {
public void setDefaultNavigationTimeout(double timeout) {
withLogging("Page.setDefaultNavigationTimeout", () -> {
timeoutSettings.setDefaultNavigationTimeout(timeout);
- JsonObject params = new JsonObject();
- params.addProperty("timeout", timeout);
- sendMessage("setDefaultNavigationTimeoutNoReply", params);
});
}
@@ -1267,9 +1268,6 @@ public void setDefaultNavigationTimeout(double timeout) {
public void setDefaultTimeout(double timeout) {
withLogging("Page.setDefaultTimeout", () -> {
timeoutSettings.setDefaultTimeout(timeout);
- JsonObject params = new JsonObject();
- params.addProperty("timeout", timeout);
- sendMessage("setDefaultTimeoutNoReply", params);
});
}
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/TimeoutSettings.java b/playwright/src/main/java/com/microsoft/playwright/impl/TimeoutSettings.java
index 3a311d43c..099e2d703 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/TimeoutSettings.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/TimeoutSettings.java
@@ -18,6 +18,7 @@
class TimeoutSettings {
private static final int DEFAULT_TIMEOUT_MS = 30_000;
+ private static final int DEFAULT_LAUNCH_TIMEOUT_MS = 180_000;
private final TimeoutSettings parent;
private Double defaultTimeout ;
@@ -80,4 +81,11 @@ Waitable createWaitable(Double timeout) {
}
return new WaitableTimeout<>(timeout(timeout));
}
+
+ static double launchTimeout(Double timeout) {
+ if (timeout != null) {
+ return timeout;
+ }
+ return DEFAULT_LAUNCH_TIMEOUT_MS;
+ }
}
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestBrowserTypeConnect.java b/playwright/src/test/java/com/microsoft/playwright/TestBrowserTypeConnect.java
index 618a36604..19705c0ac 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestBrowserTypeConnect.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestBrowserTypeConnect.java
@@ -20,6 +20,7 @@
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Assumptions;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@@ -296,6 +297,7 @@ void shouldEmitCloseEventsOnPagesAndContexts() throws InterruptedException {
assertEquals(Arrays.asList("page", "context"), events);
}
+ @Disabled("Temporarily skipping until the roll that contains https://github.com/microsoft/playwright/pull/36227")
@Test
void shouldRespectSelectors() {
String mycss = "{\n" +
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestDefaultBrowserContext2.java b/playwright/src/test/java/com/microsoft/playwright/TestDefaultBrowserContext2.java
index 41b85535a..b11525dbf 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestDefaultBrowserContext2.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestDefaultBrowserContext2.java
@@ -20,6 +20,7 @@
import com.microsoft.playwright.options.Geolocation;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Assumptions;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIf;
import org.junit.jupiter.api.io.TempDir;
@@ -226,6 +227,7 @@ void coverageShouldBeMissing() {
// TODO:
}
+ @Disabled("Temporarily skipping until the roll that contains https://github.com/microsoft/playwright/pull/36227")
@Test
void shouldRespectSelectors() {
Page page = launchPersistent();
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestElementHandleConvenience.java b/playwright/src/test/java/com/microsoft/playwright/TestElementHandleConvenience.java
index 90322262f..343374cf2 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestElementHandleConvenience.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestElementHandleConvenience.java
@@ -16,6 +16,7 @@
package com.microsoft.playwright;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.util.Collections;
@@ -112,6 +113,7 @@ void textContentShouldWork() {
assertEquals("Text,\nmore text", page.textContent("#inner"));
}
+ @Disabled("Temporarily skipping until the roll that contains https://github.com/microsoft/playwright/pull/36227")
@Test
void textContentShouldBeAtomic() {
String createDummySelector = "{\n" +
@@ -135,6 +137,7 @@ void textContentShouldBeAtomic() {
assertEquals("modified", page.evaluate("() => document.querySelector('div').textContent"));
}
+ @Disabled("Temporarily skipping until the roll that contains https://github.com/microsoft/playwright/pull/36227")
@Test
void innerTextShouldBeAtomic() {
String createDummySelector = "{\n" +
@@ -158,6 +161,7 @@ void innerTextShouldBeAtomic() {
assertEquals("modified", page.evaluate("() => document.querySelector('div').innerText"));
}
+ @Disabled("Temporarily skipping until the roll that contains https://github.com/microsoft/playwright/pull/36227")
@Test
void innerHTMLShouldBeAtomic() {
String createDummySelector = "{\n" +
@@ -181,6 +185,7 @@ void innerHTMLShouldBeAtomic() {
assertEquals("modified", page.evaluate("() => document.querySelector('div').innerHTML"));
}
+ @Disabled("Temporarily skipping until the roll that contains https://github.com/microsoft/playwright/pull/36227")
@Test
void getAttributeShouldBeAtomic() {
String createDummySelector = "{\n" +
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestPageAriaSnapshot.java b/playwright/src/test/java/com/microsoft/playwright/TestPageAriaSnapshot.java
index 726c05be4..3f51c7977 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestPageAriaSnapshot.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestPageAriaSnapshot.java
@@ -73,12 +73,6 @@ void shouldSnapshotComplex(Page page) {
checkAndMatchSnapshot(page.locator("body"), "- list:\n - listitem:\n - link \"link\":\n - /url: about:blank");
}
- @Test
- void shouldSnapshotRef(Page page) {
- page.setContent("");
- assertEquals(unshift("- list [ref=s1e3]:\n - listitem [ref=s1e4]: foo"), page.locator("body").ariaSnapshot(new AriaSnapshotOptions().setRef(true)));
- }
-
@Test
void shouldAllowTextNodes(Page page) {
page.setContent("Microsoft
Open source projects and samples from Microsoft
");
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestSelectorsRegister.java b/playwright/src/test/java/com/microsoft/playwright/TestSelectorsRegister.java
index 4d50891ce..9d65b42a3 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestSelectorsRegister.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestSelectorsRegister.java
@@ -16,12 +16,14 @@
package com.microsoft.playwright;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import java.nio.file.Paths;
import static org.junit.jupiter.api.Assertions.*;
+@Disabled("Temporarily skipping until the roll that contains https://github.com/microsoft/playwright/pull/36227")
public class TestSelectorsRegister extends TestBase {
@Test
void shouldWork() {
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestTracing.java b/playwright/src/test/java/com/microsoft/playwright/TestTracing.java
index d0bd31d47..938ef80cc 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestTracing.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestTracing.java
@@ -17,7 +17,6 @@
package com.microsoft.playwright;
import com.google.gson.Gson;
-import com.google.gson.JsonObject;
import com.microsoft.playwright.options.AriaRole;
import com.microsoft.playwright.options.Location;
import com.microsoft.playwright.options.MouseButton;
@@ -182,7 +181,7 @@ void canCallTracingGroupGroupEndAtAnyTimeAndAutoClose(@TempDir Path tempDir) thr
List events = parseTraceEvents(traceFile1);
List groups = events.stream().filter(e -> "tracingGroup".equals(e.method)).collect(Collectors.toList());
assertEquals(1, groups.size());
- assertEquals("actual", groups.get(0).apiName);
+ assertEquals("actual", groups.get(0).title);
}
@@ -203,7 +202,7 @@ void traceGroupGroupEnd(@TempDir Path tempDir) throws Exception {
context.tracing().stop(new Tracing.StopOptions().setPath(traceFile1));
List events = parseTraceEvents(traceFile1);
- List calls = events.stream().filter(e -> e.apiName != null).map(e -> e.apiName).collect(Collectors.toList());
+ List calls = events.stream().filter(e -> e.title != null).map(e -> e.title).collect(Collectors.toList());
assertEquals(asList("outer group", "Page.navigate", "inner group 1", "Frame.click", "inner group 2", "Page.isVisible"), calls);
}
@@ -241,7 +240,7 @@ void shouldTraceVariousAPIs(@TempDir Path tempDir) throws Exception {
context.tracing().stop(new Tracing.StopOptions().setPath(traceFile1));
List events = parseTraceEvents(traceFile1);
- List calls = events.stream().filter(e -> e.apiName != null).map(e -> e.apiName)
+ List calls = events.stream().filter(e -> e.title != null).map(e -> e.title)
.collect(Collectors.toList());
assertEquals(asList(
"Clock.install",
@@ -285,7 +284,7 @@ public void shouldNotRecordNetworkActions(@TempDir Path tempDir) throws IOExcept
context.tracing().stop(new Tracing.StopOptions().setPath(traceFile1));
List events = parseTraceEvents(traceFile1);
- List calls = events.stream().filter(e -> e.apiName != null).map(e -> e.apiName)
+ List calls = events.stream().filter(e -> e.title != null).map(e -> e.title)
.collect(Collectors.toList());
assertEquals(asList("Page.navigate"), calls);
}
@@ -294,6 +293,7 @@ private static class TraceEvent {
String type;
String name;
String apiName;
+ String title;
String method;
Double startTime;
Double endTime;
diff --git a/scripts/DRIVER_VERSION b/scripts/DRIVER_VERSION
index a63cb35e6..a6c040f60 100644
--- a/scripts/DRIVER_VERSION
+++ b/scripts/DRIVER_VERSION
@@ -1 +1 @@
-1.52.0
+1.53.0-alpha-2025-05-21