*
diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java
index 2e0f97804..62b38ac26 100644
--- a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java
+++ b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java
@@ -140,11 +140,11 @@ class ConnectOverCDPOptions {
public @Nullable Boolean isLocal;
/**
* When true, Playwright will not apply its default overrides to the existing default browser context. Specifically, {@code
- * acceptDownloads} is left at the browser's setting, focus emulation is not enabled, and media emulation options (such as
- * {@code colorScheme}, {@code reducedMotion}, {@code forcedColors}, and {@code contrast}) are not applied. Useful when
- * attaching to a user's daily-driver browser where these overrides would interfere with existing browser state. New
- * contexts created via {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} are not affected. Defaults
- * to {@code false}.
+ * acceptDownloads} and font families are left at the browser's settings, focus emulation is not enabled, and media
+ * emulation options (such as {@code colorScheme}, {@code reducedMotion}, {@code forcedColors}, and {@code contrast}) are
+ * not applied. Useful when attaching to a user's daily-driver browser where these overrides would interfere with existing
+ * browser state. New contexts created via {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} are not
+ * affected. Defaults to {@code false}.
*/
public @Nullable Boolean noDefaults;
/**
@@ -182,11 +182,11 @@ public ConnectOverCDPOptions setIsLocal(boolean isLocal) {
}
/**
* When true, Playwright will not apply its default overrides to the existing default browser context. Specifically, {@code
- * acceptDownloads} is left at the browser's setting, focus emulation is not enabled, and media emulation options (such as
- * {@code colorScheme}, {@code reducedMotion}, {@code forcedColors}, and {@code contrast}) are not applied. Useful when
- * attaching to a user's daily-driver browser where these overrides would interfere with existing browser state. New
- * contexts created via {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} are not affected. Defaults
- * to {@code false}.
+ * acceptDownloads} and font families are left at the browser's settings, focus emulation is not enabled, and media
+ * emulation options (such as {@code colorScheme}, {@code reducedMotion}, {@code forcedColors}, and {@code contrast}) are
+ * not applied. Useful when attaching to a user's daily-driver browser where these overrides would interfere with existing
+ * browser state. New contexts created via {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} are not
+ * affected. Defaults to {@code false}.
*/
public ConnectOverCDPOptions setNoDefaults(boolean noDefaults) {
this.noDefaults = noDefaults;
@@ -1360,6 +1360,11 @@ 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.
* @since v1.9
*/
default Browser connectOverCDP(String endpointURL) {
@@ -1389,6 +1394,11 @@ 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.
* @since v1.9
*/
Browser connectOverCDP(String endpointURL, @Nullable ConnectOverCDPOptions options);
diff --git a/playwright/src/main/java/com/microsoft/playwright/CDPSession.java b/playwright/src/main/java/com/microsoft/playwright/CDPSession.java
index 7760ca63d..0b722c394 100644
--- a/playwright/src/main/java/com/microsoft/playwright/CDPSession.java
+++ b/playwright/src/main/java/com/microsoft/playwright/CDPSession.java
@@ -59,6 +59,20 @@ public interface CDPSession {
*/
void offClose(Consumer handler);
+ class SendOptions {
+ /**
+ * Maximum time in milliseconds to wait for the response. Defaults to {@code 0} - no timeout.
+ */
+ public @Nullable Double timeout;
+
+ /**
+ * Maximum time in milliseconds to wait for the response. Defaults to {@code 0} - no timeout.
+ */
+ public SendOptions setTimeout(double timeout) {
+ this.timeout = timeout;
+ return this;
+ }
+ }
/**
* Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be used to
* send messages.
@@ -66,6 +80,16 @@ public interface CDPSession {
* @since v1.8
*/
void detach();
+ /**
+ *
+ *
+ * @param method Protocol method name.
+ * @param args Optional method parameters.
+ * @since v1.8
+ */
+ default JsonObject send(String method, @Nullable JsonObject args) {
+ return send(method, args, null);
+ }
/**
*
*
@@ -82,7 +106,7 @@ default JsonObject send(String method) {
* @param args Optional method parameters.
* @since v1.8
*/
- JsonObject send(String method, @Nullable JsonObject args);
+ JsonObject send(String method, @Nullable JsonObject args, @Nullable SendOptions options);
/**
* Register an event handler for events with the specified event name. The given handler will be called for every event
* with the given name.
diff --git a/playwright/src/main/java/com/microsoft/playwright/Clock.java b/playwright/src/main/java/com/microsoft/playwright/Clock.java
index 1992d4c61..a37b27b51 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Clock.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Clock.java
@@ -65,8 +65,8 @@ public InstallOptions setTime(Date time) {
* page.clock().fastForward("30:00");
* }
*
- * @param ticks Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are "08"
- * for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
+ * @param ticks Time may be a finite number of milliseconds to advance the clock by or a human-readable string. Valid string formats are
+ * "08" for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
* @since v1.45
*/
void fastForward(long ticks);
@@ -80,8 +80,8 @@ public InstallOptions setTime(Date time) {
* page.clock().fastForward("30:00");
* }
*
- * @param ticks Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are "08"
- * for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
+ * @param ticks Time may be a finite number of milliseconds to advance the clock by or a human-readable string. Valid string formats are
+ * "08" for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
* @since v1.45
*/
void fastForward(String ticks);
@@ -142,8 +142,8 @@ default void install() {
* page.clock().runFor("30:00");
* }
*
- * @param ticks Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are "08"
- * for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
+ * @param ticks Time may be a finite number of milliseconds to advance the clock by or a human-readable string. Valid string formats are
+ * "08" for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
* @since v1.45
*/
void runFor(long ticks);
@@ -156,8 +156,8 @@ default void install() {
* page.clock().runFor("30:00");
* }
*
- * @param ticks Time may be the number of milliseconds to advance the clock by or a human-readable string. Valid string formats are "08"
- * for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
+ * @param ticks Time may be a finite number of milliseconds to advance the clock by or a human-readable string. Valid string formats are
+ * "08" for eight seconds, "01:00" for one minute and "02:34:10" for two hours, 34 minutes and ten seconds.
* @since v1.45
*/
void runFor(String ticks);
diff --git a/playwright/src/main/java/com/microsoft/playwright/Locator.java b/playwright/src/main/java/com/microsoft/playwright/Locator.java
index ff57fa4e4..6a3f129fc 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Locator.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Locator.java
@@ -2586,7 +2586,9 @@ public WaitForFunctionOptions setTimeout(double timeout) {
*
An AI-optimized snapshot, controlled by {@code mode}, is different from a default snapshot:
*
*
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
+ * elements match. 3. Includes snapshots of {@code
*
* @since v1.49
@@ -2623,7 +2625,9 @@ default String ariaSnapshot() {
*
An AI-optimized snapshot, controlled by {@code mode}, is different from a default snapshot:
*
*
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
+ * elements match. 3. Includes snapshots of {@code
*
* @since v1.49
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 a7529ffaa..dfd70bdbb 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestContextImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestContextImpl.java
@@ -100,6 +100,7 @@ public void dispose(DisposeOptions options) {
disposeReason = options.reason;
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
sendMessage("dispose", params, NO_TIMEOUT);
+ tracing.resetStackCounter();
}
@Override
@@ -200,7 +201,7 @@ private static boolean isJsonContentType(Map headers) {
}
for (Map.Entry e : headers.entrySet()) {
if ("content-type".equalsIgnoreCase(e.getKey())) {
- return "application/json".equals(e.getValue());
+ return "application/json".equals(e.getValue().split(";", -1)[0].trim().toLowerCase());
}
}
return false;
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 49fe9885f..3a8f2e93e 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java
@@ -912,6 +912,8 @@ void didClose() {
browser.contexts.remove(this);
browser.browserType.playwright.selectors.contextsForSelectors.remove(this);
}
+ tracing.resetStackCounter();
+ request.tracing().resetStackCounter();
listeners.notify(EventType.CLOSE, this);
}
@@ -945,7 +947,7 @@ protected void initializeHarFromOptions(Browser.NewContextOptions options) {
contentPolicy = HarContentPolicy.OMIT;
}
if (contentPolicy == null) {
- contentPolicy = options.recordHarPath.toString().endsWith(".zip") ? HarContentPolicy.ATTACH : HarContentPolicy.EMBED;
+ contentPolicy = TracingImpl.isZip(options.recordHarPath) ? HarContentPolicy.ATTACH : HarContentPolicy.EMBED;
}
RouteFromHAROptions routeFromHAROptions = new RouteFromHAROptions();
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/CDPSessionImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/CDPSessionImpl.java
index 24afe0726..ad6bf77aa 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/CDPSessionImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/CDPSessionImpl.java
@@ -65,13 +65,15 @@ public JsonObject send(String method) {
return send(method, null);
}
- public JsonObject send(String method, JsonObject params) {
+ @Override
+ public JsonObject send(String method, JsonObject params, SendOptions options) {
JsonObject args = new JsonObject();
if (params != null) {
args.add("params", params);
}
args.addProperty("method", method);
- JsonElement response = connection.sendMessage(guid, "send", args);
+ Double timeout = options == null || options.timeout == null ? Double.valueOf(0) : options.timeout;
+ JsonElement response = connection.sendMessage(guid, "send", args, timeout);
if (response == null) return null;
else return response.getAsJsonObject().get("result").getAsJsonObject();
}
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java b/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java
index 0eee79a42..8bbae9cee 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java
@@ -89,6 +89,7 @@ class Root extends ChannelOwner {
PlaywrightImpl initialize() {
JsonObject params = new JsonObject();
params.addProperty("sdkLanguage", "java");
+ params.addProperty("supportsLoneSurrogates", true);
JsonElement result = sendMessage("initialize", params.getAsJsonObject(), NO_TIMEOUT);
return this.connection.getExistingObject(result.getAsJsonObject().getAsJsonObject("playwright").get("guid").getAsString());
}
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/TracingImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/TracingImpl.java
index 70939f847..b2130f897 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/TracingImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/TracingImpl.java
@@ -59,11 +59,15 @@ static class HarRecorder {
super(parent, type, guid, initializer);
}
- private void stopChunkImpl(Path path) {
+ void resetStackCounter() {
if (isTracing) {
isTracing = false;
connection.setIsTracing(false);
}
+ }
+
+ private void stopChunkImpl(Path path) {
+ resetStackCounter();
List capturedAdditionalSources = new ArrayList<>(additionalSources);
additionalSources.clear();
@@ -231,7 +235,7 @@ public AutoCloseable startHar(Path path, StartHarOptions options) {
if (options == null) {
options = new StartHarOptions();
}
- boolean isZip = path.toString().endsWith(".zip");
+ boolean isZip = isZip(path);
HarContentPolicy contentPolicy = options.content != null
? options.content
: (isZip ? HarContentPolicy.ATTACH : HarContentPolicy.EMBED);
@@ -250,6 +254,10 @@ public void stopHar() {
exportHar(harId);
}
+ static boolean isZip(Path path) {
+ return path.toString().toLowerCase().endsWith(".zip");
+ }
+
String recordIntoHar(PageImpl page, Path har, Object urlFilter, HarContentPolicy contentPolicy, HarMode mode, Path resourcesDir) {
if (contentPolicy == null) {
contentPolicy = HarContentPolicy.ATTACH;
@@ -263,14 +271,14 @@ String recordIntoHar(PageImpl page, Path har, Object urlFilter, HarContentPolicy
params.add("page", page.toProtocolRef());
}
JsonObject recordHarArgs = new JsonObject();
- recordHarArgs.addProperty("zip", har.toString().endsWith(".zip"));
+ recordHarArgs.addProperty("zip", isZip(har));
recordHarArgs.addProperty("content", contentPolicy.name().toLowerCase());
recordHarArgs.addProperty("mode", mode.name().toLowerCase());
addHarUrlFilter(recordHarArgs, urlFilter);
if (resourcesDir != null) {
recordHarArgs.addProperty("resourcesDir", resourcesDir.toString());
}
- if (!har.toString().endsWith(".zip")) {
+ if (!isZip(har)) {
recordHarArgs.addProperty("harPath", har.toString());
}
@@ -287,7 +295,7 @@ void exportHar(String harId) {
return;
}
boolean isLocal = !connection.isRemote;
- boolean isZip = harParams.path.toString().endsWith(".zip");
+ boolean isZip = isZip(harParams.path);
JsonObject params = new JsonObject();
params.addProperty("harId", harId);
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCDPSession.java b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCDPSession.java
index dcef55b54..f3380d5ac 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCDPSession.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCDPSession.java
@@ -45,6 +45,23 @@ void shouldWork(Page page) {
assertEquals("bar", foo);
}
+ @PlaywrightTest
+ void shouldRespectTimeoutOption(Page page) {
+ CDPSession cdpSession = page.context().newCDPSession(page);
+ JsonObject params = new JsonObject();
+ params.addProperty("expression", "1 + 2");
+ params.addProperty("returnByValue", true);
+ JsonObject response = cdpSession.send("Runtime.evaluate", params, new CDPSession.SendOptions().setTimeout(5000));
+ assertEquals(3, response.getAsJsonObject("result").get("value").getAsInt());
+
+ JsonObject pending = new JsonObject();
+ pending.addProperty("expression", "new Promise(() => {})");
+ pending.addProperty("awaitPromise", true);
+ TimeoutError error = assertThrows(TimeoutError.class,
+ () -> cdpSession.send("Runtime.evaluate", pending, new CDPSession.SendOptions().setTimeout(500)));
+ assertTrue(error.getMessage().contains("Timeout 500ms exceeded"), error.getMessage());
+ }
+
@PlaywrightTest
void shouldSendEvents(Page page, Server server) {
CDPSession cdpSession = page.context().newCDPSession(page);
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextStorageState.java b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextStorageState.java
index 49d7c3862..b91b2facb 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextStorageState.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextStorageState.java
@@ -174,7 +174,7 @@ void shouldSerialiseStorageStateWithLoneSurrogates(Page page, BrowserContext con
" origin: 'http://localhost:" + server.PORT + "',\n" +
" localStorage: [{\n" +
" name: 'foo',\n" +
- " value: '" + (char)65533 + "'\n" +
+ " value: '" + (char)55934 + "'\n" +
" }]\n" +
"}]}", new Gson().fromJson(storageState, JsonObject.class));
}
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestGlobalFetch.java b/playwright/src/test/java/com/microsoft/playwright/TestGlobalFetch.java
index 943db133d..016d0470e 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestGlobalFetch.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestGlobalFetch.java
@@ -214,7 +214,7 @@ void cookiesShouldReturnCookiesFilteredByUrls(Playwright playwright, Server serv
request.addCookies(asList(
new Cookie("a", "b").setDomain("localhost").setPath("/"),
new Cookie("c", "d").setDomain("localhost").setPath("/input"),
- new Cookie("e", "f").setDomain("one.com").setPath("/"),
+ new Cookie("e", "f").setDomain(".one.com").setPath("/"),
new Cookie("g", "h").setDomain("two.com").setPath("/").setSecure(true)));
assertEquals(asList("a", "c", "e", "g"), cookieNames(request.cookies()));
assertEquals(asList("a"), cookieNames(request.cookies(server.EMPTY_PAGE)));
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestPageFill.java b/playwright/src/test/java/com/microsoft/playwright/TestPageFill.java
index ad3001601..783aaae87 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestPageFill.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestPageFill.java
@@ -57,20 +57,6 @@ void shouldFillRangeInput(Page page) {
assertEquals("42", page.evalOnSelector("input", "input => input.value"));
}
- @PlaywrightTest
- void shouldThrowOnIncorrectRangeValue(Page page) {
- page.setContent("");
- PlaywrightException e = assertThrows(PlaywrightException.class, () -> page.fill("input", "foo"));
- assertTrue(e.getMessage().contains("Malformed value"), e.getMessage());
-
- e = assertThrows(PlaywrightException.class, () -> page.fill("input", "200"));
- assertTrue(e.getMessage().contains("Malformed value"), e.getMessage());
-
- e = assertThrows(PlaywrightException.class, () -> page.fill("input", "15.43"));
- assertTrue(e.getMessage().contains("Malformed value"), e.getMessage());
- }
-
-
@PlaywrightTest
void shouldFillDifferentInputTypes(Page page, Server server) {
page.navigate(server.PREFIX + "/input/textarea.html");
@@ -89,14 +75,6 @@ void shouldFillDateInputAfterClicking(Page page) {
assertEquals("2020-03-02", page.evalOnSelector("input", "input => input.value"));
}
- @PlaywrightTest
- @DisabledOnBrowser(value = WEBKIT, reason = "skip")
- void shouldThrowOnIncorrectDate(Page page) {
- page.setContent("");
- PlaywrightException e = assertThrows(PlaywrightException.class, () -> page.fill("input", "2020-13-05"));
- assertTrue(e.getMessage().contains("Malformed value"));
- }
-
@PlaywrightTest
void shouldFillTimeInput(Page page) {
page.setContent("");
@@ -104,14 +82,6 @@ void shouldFillTimeInput(Page page) {
assertEquals("13:15", page.evalOnSelector("input", "input => input.value"));
}
- @PlaywrightTest
- @DisabledOnBrowser(value = WEBKIT, reason = "skip")
- void shouldThrowOnIncorrectTime(Page page) {
- page.setContent("");
- PlaywrightException e = assertThrows(PlaywrightException.class, () -> page.fill("input", "25:05"));
- assertTrue(e.getMessage().contains("Malformed value"));
- }
-
@PlaywrightTest
void shouldFillDatetimeLocalInput(Page page) {
page.setContent("");
@@ -119,14 +89,6 @@ void shouldFillDatetimeLocalInput(Page page) {
assertEquals(page.evalOnSelector("input", "input => input.value"), "2020-03-02T05:15");
}
- @PlaywrightTest
- @EnabledOnBrowser(value = CHROMIUM, reason = "skip")
- void shouldThrowOnIncorrectDatetimeLocal(Page page) {
- page.setContent("");
- PlaywrightException e = assertThrows(PlaywrightException.class, () -> page.fill("input", "abc"));
- assertTrue(e.getMessage().contains("Malformed value"));
- }
-
@PlaywrightTest
void shouldFillContenteditable(Page page, Server server) {
page.navigate(server.PREFIX + "/input/textarea.html");
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestPageRequestContinue.java b/playwright/src/test/java/com/microsoft/playwright/TestPageRequestContinue.java
index a272228d0..8a6c2024a 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestPageRequestContinue.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestPageRequestContinue.java
@@ -76,9 +76,7 @@ void shouldNotThrowWhenContinuingAfterPageIsClosed(Page page, Server server) {
route.resume();
done[0] = true;
});
- PlaywrightException e = assertThrows(PlaywrightException.class, () -> page.navigate(server.EMPTY_PAGE));
- assertTrue(e.getMessage().contains("Target page, context or browser has been closed") ||
- e.getMessage().contains("frame was detached"), e.getMessage());
+ assertThrows(PlaywrightException.class, () -> page.navigate(server.EMPTY_PAGE));
assertTrue(done[0]);
}
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestTracingOverConnect.java b/playwright/src/test/java/com/microsoft/playwright/TestTracingOverConnect.java
index 365810565..4b9ba8e12 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestTracingOverConnect.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestTracingOverConnect.java
@@ -54,6 +54,19 @@ static Browser browser(BrowserType browserType, BrowserServer browserServer) {
return browserType.connect(browserServer.wsEndpoint);
}
+ @PlaywrightTest
+ void shouldNotCollectStacksAfterContextWithTracingIsClosed(Browser browser, BrowserContext context, @TempDir Path tempDir) throws IOException {
+ BrowserContext other = browser.newContext();
+ other.tracing().start(new Tracing.StartOptions().setSources(true));
+ other.close();
+
+ context.tracing().start(new Tracing.StartOptions().setSources(true));
+ Path trace = tempDir.resolve("trace.zip");
+ context.tracing().stop(new Tracing.StopOptions().setPath(trace));
+ Map resources = parseZip(trace);
+ assertEquals(0, resources.keySet().stream().filter(name -> name.startsWith("src/")).count());
+ }
+
@PlaywrightTest
void shouldRecordSourcesForBrowserFromConnect(Page page, BrowserContext context, Server server, @TempDir Path tmpDir) throws IOException {
context.tracing().start(new Tracing.StartOptions().setSources(true));
diff --git a/playwright/src/test/java/com/microsoft/playwright/junit/TestFixtureDeviceOption.java b/playwright/src/test/java/com/microsoft/playwright/junit/TestFixtureDeviceOption.java
index 9c8ea3368..7c1141dca 100644
--- a/playwright/src/test/java/com/microsoft/playwright/junit/TestFixtureDeviceOption.java
+++ b/playwright/src/test/java/com/microsoft/playwright/junit/TestFixtureDeviceOption.java
@@ -42,6 +42,7 @@ public void testPredefinedDeviceParameters(Server server, Page page) {
// TODO: failing since 1.57 roll.
// assertEquals(3, page.evaluate("window.devicePixelRatio"));
assertEquals(980, page.evaluate("window.innerWidth"));
- assertEquals(1668, page.evaluate("window.innerHeight"));
+ // The layout height is 980 * 664 / 390 = 1668.5, WebKit rounds it either way depending on the platform.
+ assertEquals(1668.5, ((Number) page.evaluate("window.innerHeight")).doubleValue(), 0.5);
}
}
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCookies.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCookies.java
index 552658c69..5907e981d 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCookies.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCookies.java
@@ -277,7 +277,6 @@ void shouldWorkWithSubdomainCookie(BrowserContext context, BrowserName browserNa
@PlaywrightTest
@DisplayName("CO-011 should only return cookies that apply to the url")
- @Fixme("driver: context.cookies(url) returns [hostonly, subdomains] for http://foo.com/apiv2, the RFC 6265 domain and path matching is upstream #43148, newer than driver 1.64.1")
void shouldOnlyReturnCookiesThatApplyToTheUrl(BrowserContext context) {
// { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/43078' } }
context.addCookies(Arrays.asList(
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCookiesThirdParty.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCookiesThirdParty.java
index be524db43..535856bdc 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCookiesThirdParty.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCookiesThirdParty.java
@@ -377,7 +377,6 @@ else if (browserName == BrowserName.FIREFOX && isBidi)
@PlaywrightTest
@DisplayName("CO-054 third party 'Partitioned;' cookies")
- @Fixme(value = "driver: the Firefox build of the bundled driver partitions the third-party cookie, upstream expects the Juggler build not to", browsers = BrowserName.FIREFOX)
void thirdPartyPartitionedCookies(Page page, BrowserName browserName, HttpsTestServer httpsServer, WebkitPartitions webkitPartitions, TestUrls urls) {
runPartitionedTest(page, httpsServer, browserName, Env.isMac, webkitPartitions.value, Env.isBidi(), urls);
}
@@ -608,7 +607,7 @@ void sameOriginThirdPartyPartitionedCookieWithDifferentOriginIntermediateIframe(
@PlaywrightTest
@DisplayName("CO-058 top level 'Partitioned;' cookie and same origin iframe")
- @Fixme(value = "chromium: java: the Cookie class has no _crHasCrossSiteAncestor property, so the cookies() / addCookies() round trip gives 'Received cookie: top-level-non-partitioned=value' instead of '...; top-level=value'; firefox: driver: firefox r1555 of driver 1.64.1 does not send the top-level 'Partitioned' cookie to the nested iframe (expects r1564, upstream #43494): 'Received cookie: top-level-non-partitioned=value'", browsers = {BrowserName.CHROMIUM, BrowserName.FIREFOX})
+ @Fixme(value = "java: the Cookie class has no _crHasCrossSiteAncestor property, so the cookies() / addCookies() round trip gives 'Received cookie: top-level-non-partitioned=value' instead of '...; top-level=value'", browsers = BrowserName.CHROMIUM)
void topLevelPartitionedCookieAndSameOriginIframe(Page page, BrowserName browserName, HttpsTestServer httpsServer, Browser browser, ContextFactory contextFactory, TestUrls urls) {
boolean isBidi = Env.isBidi();
addCommonCookieHandlers(httpsServer, urls);
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCsp.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCsp.java
index a71a95946..10824efa0 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCsp.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextCsp.java
@@ -163,7 +163,6 @@ void shouldBypassCSPInIframesAsWell(Browser browser, TestServer server) {
@PlaywrightTest
@DisplayName("CS-005 should not crash on javascript: navigation")
- @Fixme(value = "driver: page.click('#a') on a javascript: link times out in firefox: 'Timeout 30000ms exceeded' while 'waiting for scheduled navigations to finish'; test added by upstream #43457, newer than driver 1.64.1", browsers = BrowserName.FIREFOX)
void shouldNotCrashOnJavascriptNavigation(Browser browser, TestServer server) {
// it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/43213' });
BrowserContext context = browser.newContext(new Browser.NewContextOptions().setBypassCSP(true));
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextHar.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextHar.java
index ea4140484..1d32e9cc9 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextHar.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextHar.java
@@ -307,7 +307,6 @@ void shouldFulfillFromHarWithContentInAFile(BrowserContext context) {
@PlaywrightTest
@DisplayName("HA-085 should round-trip har.zip")
- @Fixme("driver: a record HAR path with the upper case extension .ZIP is written as JSON instead of a zip; the fix for https://github.com/microsoft/playwright/issues/43503 is newer than the bundled driver 1.64.1")
void shouldRoundTripHarZip(ContextFactory contextFactory, TestServer server, TestInfo testInfo) throws IOException {
Path harPath = testInfo.outputPath("har.ZIP");
BrowserContext context1 = contextFactory.newContext(new Browser.NewContextOptions().setRecordHarMode(HarMode.MINIMAL).setRecordHarPath(harPath));
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextLocale.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextLocale.java
index c03605fa5..7351614ca 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextLocale.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextLocale.java
@@ -198,7 +198,6 @@ void shouldNotChangeDefaultLocaleInAnotherContext(Browser browser) {
@PlaywrightTest
@DisplayName("LC-010 should propagate locale to workers")
- @Fixme(value = "driver: 1.64.1 does not apply the locale to dedicated workers in Chromium (navigator.languages is 'languages:en-US' instead of 'languages:ru-RU'), fixed by microsoft/playwright#43488", browsers = BrowserName.CHROMIUM)
void shouldPropagateLocaleToWorkers(Browser browser, BrowserName browserName, TestServer server) throws Exception {
// issue: https://github.com/microsoft/playwright/issues/43484
BrowserContext context = browser.newContext(new Browser.NewContextOptions().setLocale("ru-RU"));
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextStorageState.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextStorageState.java
index 94b1215e7..14a541698 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextStorageState.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsercontextStorageState.java
@@ -478,7 +478,6 @@ void shouldHandleMalformedFile(ContextFactory contextFactory, TestInfo testInfo)
@PlaywrightTest
@DisplayName("ST-011 should serialize storageState with lone surrogates")
- @Fixme("driver: 1.64.1 replaces lone surrogates with U+FFFD for non-JavaScript clients; the client declares support with supportsLoneSurrogates since microsoft/playwright#43548, the Java client got \"\\uFFFD\" instead of \"\\uDA7E\"")
void shouldSerializeStorageStateWithLoneSurrogates(Page page, BrowserContext context, TestServer server) {
page.navigate(server.EMPTY_PAGE);
page.evaluate("() => window.localStorage.setItem('foo', String.fromCharCode(55934))");
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestEmulationCoop.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestEmulationCoop.java
index c7dac8b19..4c9c96513 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestEmulationCoop.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestEmulationCoop.java
@@ -93,7 +93,6 @@ private static void assertObjectContaining(Map expected, Map {
res.setHeader("Set-Cookie", Arrays.asList("token; path=/", "a=; path=/"));
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestHar.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestHar.java
index dd7b37f37..55c548354 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestHar.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestHar.java
@@ -307,7 +307,6 @@ void shouldIncludeSetCookies(PageWithHar pageWithHar, TestServer server) {
@PlaywrightTest
@DisplayName("HA-015 should include set-cookies without equals sign as nameless")
- @Fixme("driver: the HAR has {\"name\":\"token\",\"value\":\"\"} for the cookie \"token; HttpOnly\"; the fix for https://github.com/microsoft/playwright/issues/43155 is newer than the bundled driver 1.64.1")
void shouldIncludeSetCookiesWithoutEqualsSignAsNameless(PageWithHar pageWithHar, TestServer server) {
PageWithHar.Result harSession = pageWithHar.create();
server.setRoute("/empty.html", (req, res) -> {
@@ -432,7 +431,6 @@ void shouldIncludeContent(PageWithHar pageWithHar, TestServer server) {
@PlaywrightTest
@DisplayName("HA-113 should store binary content with a textual mime type as base64")
- @Fixme("driver: response.content has no \"encoding\": \"base64\" for a binary body with a textual mime type; the fix for https://github.com/microsoft/playwright/issues/43493 is newer than the bundled driver 1.64.1")
@DisabledOnBrowser(value = BrowserName.WEBKIT, reason = "fixme: WebKit decodes the body of a textual resource before it gets to us")
void shouldStoreBinaryContentWithATextualMimeTypeAsBase64(PageWithHar pageWithHar, TestServer server, BrowserName browserName) {
byte[] body = new byte[]{(byte) 0x80, (byte) 0xc3, 0x28, (byte) 0xff, 0x41};
@@ -993,7 +991,6 @@ void shouldCorrectlyRecordAPIRequestCookiesWithEqualsSignInValue(ContextFactory
@PlaywrightTest
@DisplayName("HA-052 should record nameless API request cookies")
- @Fixme("driver: the API request HAR has {\"name\":\"nameless\",\"value\":\"\"} for the cookie header \"nameless; other=val\"; the fix for https://github.com/microsoft/playwright/issues/43155 is newer than the bundled driver 1.64.1")
void shouldRecordNamelessAPIRequestCookies(ContextFactory contextFactory, TestServer server, TestInfo testInfo) throws IOException {
BrowserContext context = contextFactory.newContext();
Path harPath = testInfo.outputPath("request.har");
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestPageClock.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestPageClock.java
index 69cf130bb..85be43c1a 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestPageClock.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestPageClock.java
@@ -660,7 +660,6 @@ void runForShouldNotRunNestedImmediateFromMicrotask(Page page, Calls calls) {
@PlaywrightTest
@DisplayName("CK-045 should stay paused on the next page when an init script reads the time")
- @Fixme(value = "driver: Date.now() is 2061 instead of 2000 after the second navigation, the fix is upstream #43224, newer than driver 1.64.1", browsers = BrowserName.CHROMIUM)
void shouldStayPausedOnTheNextPageWhenAnInitScriptReadsTheTime(Page page, TestServer server) {
// { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/43214' } }
page.clock().install(new com.microsoft.playwright.Clock.InstallOptions().setTime(0));
@@ -677,7 +676,6 @@ void shouldStayPausedOnTheNextPageWhenAnInitScriptReadsTheTime(Page page, TestSe
@PlaywrightTest
@DisplayName("CK-046 should not advance performance.now() before the first clock call on a new page")
- @Fixme("driver: performance.now() and Date.now() are [503, 1000] instead of [0, 1000], the fix is upstream #43224, newer than driver 1.64.1")
void shouldNotAdvancePerformanceNowBeforeTheFirstClockCallOnANewPage(Page page, TestServer server) {
// { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/43214' } }
page.clock().pauseAt(1000);
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestProxy.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestProxy.java
index 0bea19261..8a7a9907b 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestProxy.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestProxy.java
@@ -189,8 +189,6 @@ void shouldAllowBypassingHostRequests(BrowserType browserType, TestServer server
@PlaywrightTest
@DisplayName("PR-007 should authenticate")
- @Fixme(value = "driver: 1.64.1 sends the proxy credentials to the website auth challenge, fixed by microsoft/playwright#43326", browsers = BrowserName.CHROMIUM)
- @Fixme(value = "driver: 1.64.1 sends the proxy credentials to the website auth challenge, fixed by microsoft/playwright#43326", browsers = BrowserName.WEBKIT, os = {OS.LINUX, OS.WINDOWS})
void shouldAuthenticate(BrowserType browserType, TestServer server, BrowserName browserName) {
server.setRoute("/target.html", (req, res) -> {
String auth = req.headers.get("proxy-authorization");
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestTracing.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestTracing.java
index 80798ff0d..cbacdaa71 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestTracing.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestTracing.java
@@ -158,7 +158,6 @@ private static BufferedImage decodeImage(byte[] buffer) throws IOException {
@PlaywrightTest
@DisplayName("TR-003 should not store secrets in context options")
- @Fixme("driver: the context-options event of driver 1.64.1 contains extraHTTPHeaders and httpCredentials (was: {viewport, userAgent, extraHTTPHeaders:[{name:x-secret,value:secret-header}], httpCredentials:[...], ...}); upstream fix(tracing): do not store secrets in trace context options (#43220) is not in the driver")
void shouldNotStoreSecretsInContextOptions(Browser browser, TestServer server, TestInfo testInfo) throws Exception {
BrowserContext context = browser.newContext(new Browser.NewContextOptions()
.setBaseURL(server.PREFIX)
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestWebmcp.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestWebmcp.java
index acc8076cf..141d7b58f 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestWebmcp.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestWebmcp.java
@@ -38,6 +38,7 @@
import java.util.List;
import java.util.Map;
import java.util.function.Function;
+import java.util.regex.Pattern;
import static com.microsoft.playwright.fixtures.Utils.mapOf;
import static java.util.Arrays.asList;
@@ -190,7 +191,7 @@ void shouldThrowWhenTheToolThrows(Page page, TestServer server, BrowserName brow
PlaywrightException error = assertThrows(PlaywrightException.class, () -> page.webmcp().callTool("throwing"));
// Chromium does not report the error that the tool threw.
- assertTrue(error.getMessage().contains(browserName == BrowserName.CHROMIUM ? "the invocation failed" : "boom"));
+ assertTrue(Pattern.compile(browserName == BrowserName.CHROMIUM ? "the invocation failed|Tool execution failed" : "boom").matcher(error.getMessage()).find());
}
@PlaywrightTest
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageAriaSnapshot.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageAriaSnapshot.java
index 87a5b52a7..67431c70d 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageAriaSnapshot.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageAriaSnapshot.java
@@ -150,7 +150,6 @@ void shouldSnapshotDetailsVisibility(Page page) {
@PlaywrightTest
@DisplayName("AR-008 should not snapshot text directly inside closed details")
- @Fixme("driver: the bundled driver includes text inside closed details, snapshot is - group: Summary Details")
void shouldNotSnapshotTextDirectlyInsideClosedDetails(Page page) {
page.setContent("\n" +
@@ -172,7 +171,6 @@ void shouldNotSnapshotTextDirectlyInsideClosedDetails(Page page) {
@PlaywrightTest
@DisplayName("AR-009 should not snapshot text that is not assigned to a slot")
- @Fixme("driver: the bundled driver includes text not assigned to a slot, snapshot is - button \"Light Shadow\": - text: Light - paragraph: Shadow")
void shouldNotSnapshotTextThatIsNotAssignedToASlot(Page page) {
page.setContent("\n" +
@@ -729,7 +727,6 @@ void shouldEscapeSpecialYamlCharacters(Page page) {
@PlaywrightTest
@DisplayName("AR-031 should escape special yaml values")
- @Fixme("driver: the bundled driver does not quote the special yaml values ~ and .NaN, it prints - text: ~ and - text: .NaN")
void shouldEscapeSpecialYamlValues(Page page) {
page.setContent("\n" +
" trueFalse\n" +
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageAriaSnapshotAi.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageAriaSnapshotAi.java
index 9e76a5fed..319bda9fe 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageAriaSnapshotAi.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageAriaSnapshotAi.java
@@ -462,7 +462,6 @@ void shouldOmitRedundantNameWhenAContributorIsASkippedLeafGeneric(Page page) {
@PlaywrightTest
@DisplayName("AR-063 should keep the name when the contributing wrapper collapses into repeating text")
- @Fixme("driver: the bundled driver drops the names of the buttons, snapshot has - button [ref=e7] and - button [ref=e10] instead of \"New survey\" and \"Edit survey\"")
void shouldKeepTheNameWhenTheContributingWrapperCollapsesIntoRepeatingText(Page page) {
// The outer span is marked as represented while it still wraps the icon. Once the nameless
// image is dropped, the span collapses into a lone text repeating the button's name and removes
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageClick.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageClick.java
index bf4849a89..d1854ed2c 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageClick.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageClick.java
@@ -396,7 +396,6 @@ void shouldClickLinksWhichCauseNavigation(Page page, TestServer server) {
@PlaywrightTest
@DisplayName("CL-033 should not wait for navigation after clicking a link answered with 204")
- @Fixme(value = "driver: the bundled driver 1.64.1 waits for scheduled navigations after the click and fails with 'Timeout 5000ms exceeded.' (upstream issue 43279)", browsers = BrowserName.CHROMIUM)
void shouldNotWaitForNavigationAfterClickingALinkAnsweredWith204(Page page, TestServer server) {
server.setRoute("/204", (req, res) -> {
res.statusCode = 204;
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageDrag.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageDrag.java
index 101ae809e..f3a0e165a 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageDrag.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageDrag.java
@@ -230,7 +230,6 @@ void shouldDragOutOfAnIframe(TestServer server, Page page) {
@PlaywrightTest
@DisplayName("DD-008 should respect the drop effect")
- @Fixme(value = "driver: the WebKit of driver 1.64.1 on macOS and Windows drops with effectAllowed 'copy' and dropEffect 'move' (expected: but was: )", browsers = BrowserName.WEBKIT, os = {OS.MAC, OS.WINDOWS})
void shouldRespectTheDropEffect(Page page, BrowserName browserName) {
assumeFalse(browserName == BrowserName.WEBKIT && Env.isLinux && Env.headed(), "fixme: https://github.com/microsoft/playwright/issues/21646");
assumeFalse(browserName == BrowserName.CHROMIUM && !Env.isMac && Env.headed(), "fixme: https://github.com/microsoft/playwright/issues/21646");
@@ -286,7 +285,6 @@ private Object testIfDropped(Page page, String effectAllowed, String dropEffect)
@PlaywrightTest
@DisplayName("DD-028 should report the default drop effect from effectAllowed")
- @Fixme(value = "driver: the bundled WebKit reports the dropEffect 'copyMove' instead of 'move' (expected: but was: )", browsers = BrowserName.WEBKIT)
void shouldReportTheDefaultDropEffectFromEffectAllowed(Page page, BrowserName browserName) {
assumeFalse(browserName == BrowserName.WEBKIT && Env.isLinux && Env.headed(), "fixme: https://github.com/microsoft/playwright/issues/21646");
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEvaluate.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEvaluate.java
index 89866ac66..35d262dd8 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEvaluate.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEvaluate.java
@@ -358,7 +358,6 @@ void shouldReturnInfinity2(Page page) {
@PlaywrightTest
@DisplayName("EV-037 should work with overwritten Promise")
- @Fixme(value = "java: evaluateHandle of a promise of the overwritten Promise class is not awaited, jsonValue() is <{_promise={}}> instead of 42", browsers = {BrowserName.FIREFOX, BrowserName.WEBKIT})
void shouldWorkWithOverwrittenPromise(Page page) {
page.evaluate("() => {\n" +
" const originalPromise = window.Promise;\n" +
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEventPageerror.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEventPageerror.java
index fc7546cb4..7ad09b3ed 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEventPageerror.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEventPageerror.java
@@ -67,7 +67,6 @@ private static PageError waitForPageError(Page page, Runnable action) {
@PlaywrightTest
@DisplayName("ER-001 should fire")
- @Fixme(value = "java: the bundled driver 1.64.1 reports zero-based locations for the cross-origin script error (error.js:13:10 instead of error.js:14:11); fixed upstream in microsoft/playwright#43468", browsers = BrowserName.CHROMIUM)
void shouldFire(Page page, TestServer server, BrowserName browserName) {
String url = server.PREFIX + "/error.html";
PageError error = waitForPageError(page, () -> page.navigate(url));
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEventRequest.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEventRequest.java
index 3ab580975..973ef71c9 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEventRequest.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageEventRequest.java
@@ -203,7 +203,6 @@ void shouldFinish204Request(Page page, TestServer server) throws Exception {
@PlaywrightTest
@DisplayName("NE-103 should fail 204 navigation request")
- @Fixme(value = "driver: the driver 1.64.1 reports requestfinished for the 204 navigation request, the test expects requestfailed", browsers = BrowserName.CHROMIUM)
void shouldFail204NavigationRequest(Page page, TestServer server) throws Exception {
server.setRoute("/204", (req, res) -> {
res.statusCode = 204;
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFilechooser.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFilechooser.java
index 260d7ce36..532482f5c 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFilechooser.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFilechooser.java
@@ -408,7 +408,6 @@ void routeActivationPage(Page page, TestServer server) {
@PlaywrightTest
@DisplayName("FC-026 should not open file chooser without user activation")
- @Fixme(value = "driver: the driver (1.64.1) predates the user activation check for file choosers: Firefox emits a filechooser event without user activation (choosers expected: <0> but was: <1>)", browsers = BrowserName.FIREFOX)
@DisabledOnBrowser(value = BrowserName.WEBKIT, reason = "fixme: WebKit opens the file chooser from input.click() without user activation")
void shouldNotOpenFileChooserWithoutUserActivation(Page page, TestServer server, BrowserName browserName) {
AtomicInteger choosers = new AtomicInteger();
@@ -445,7 +444,6 @@ void shouldOpenFileChooserWithUserActivation(Page page, TestServer server) {
@PlaywrightTest
@DisplayName("FC-028 should consume user activation when opening file chooser")
- @Fixme(value = "driver: the driver (1.64.1) predates the user activation check for file choosers: Firefox opens the chooser twice for two input.click() calls (choosers expected: <1> but was: <2>)", browsers = BrowserName.FIREFOX)
@DisabledOnBrowser(value = BrowserName.WEBKIT, reason = "fixme: WebKit does not consume user activation when opening the file chooser")
void shouldConsumeUserActivationWhenOpeningFileChooser(Page page, TestServer server, BrowserName browserName) {
AtomicInteger choosers = new AtomicInteger();
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFill.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFill.java
index 91d3e25f8..4af5970e2 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFill.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFill.java
@@ -83,7 +83,6 @@ void shouldFillDifferentInputTypes(Page page, TestServer server) {
@PlaywrightTest
@DisplayName("FI-005 should fill range input")
- @Fixme(value = "driver: the driver (1.64.1) predates the upstream fix of issue 43328: page.fill(\"input\", \"42.0\") on input[type=range] fails with \"Error: Malformed value\"", browsers = {BrowserName.CHROMIUM, BrowserName.WEBKIT})
void shouldFillRangeInput(Page page) {
page.setContent("");
page.fill("input", "42");
@@ -205,8 +204,6 @@ void shouldFillWeekInput(Page page) {
@PlaywrightTest
@DisplayName("FI-013 should fill datetime-local input")
- @Fixme(value = "driver: the driver (1.64.1) predates the upstream fix of issue 43370: page.fill on input[type=datetime-local] fails with \"Error: Malformed value\"", browsers = {BrowserName.CHROMIUM, BrowserName.FIREFOX})
- @Fixme(value = "driver: the driver (1.64.1) predates the upstream fix of issue 43370: page.fill on input[type=datetime-local] fails with \"Error: Malformed value\"", browsers = BrowserName.WEBKIT, os = {OS.LINUX, OS.MAC})
void shouldFillDatetimeLocalInput(Page page, TestServer server, BrowserName browserName) {
page.setContent("");
page.fill("input", "2020-03-02T05:15");
@@ -324,7 +321,6 @@ void shouldFillFixedPositionInput(Page page) {
@PlaywrightTest
@DisplayName("FI-025 should be able to fill when focus is in the wrong frame")
- @Fixme("driver: the driver (1.64.1) predates the upstream fix of issue 43483: after page.focus(iframe) the fill of the paragraph in the frame leaves the text \"old\" (expected \"new\")")
void shouldBeAbleToFillWhenFocusIsInTheWrongFrame(Page page) {
page.setContent("\n" +
" \n" +
@@ -425,7 +421,6 @@ void shouldFillContenteditableWithFocusHandlerThatCollapsesSelection(Page page)
@PlaywrightTest
@DisplayName("FI-036 should fail with a nice error on inert element")
- @Fixme("driver: the driver (1.64.1) predates the upstream fix of issue 42967: page.fill on an inert element does not time out")
void shouldFailWithANiceErrorOnInertElement(Page page) {
page.setContent("");
PlaywrightException error = assertThrows(PlaywrightException.class, () -> page.fill("input", "some value", new Page.FillOptions().setTimeout(1000)));
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFocus.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFocus.java
index f4423af4b..06cff5732 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFocus.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageFocus.java
@@ -241,7 +241,6 @@ void keepsFocusOnElementWhenAttemptingToFocusANonFocusableElement(Page page) {
@PlaywrightTest
@DisplayName("FO-011 should move focus from an iframe to its parent")
- @Fixme(value = "driver: the focus stays in the iframe: toBeFocused on #outer gets unexpected value \"inactive\" until timeout", browsers = BrowserName.FIREFOX)
void shouldMoveFocusFromAnIframeToItsParent(Page page, TestServer server) {
server.setRoute("/frame.html", (req, res) -> {
res.setHeader("content-type", "text/html");
@@ -258,7 +257,6 @@ void shouldMoveFocusFromAnIframeToItsParent(Page page, TestServer server) {
@PlaywrightTest
@DisplayName("FO-012 should tab from an iframe to its parent")
- @Fixme(value = "driver: the focus stays in the iframe: toBeFocused on #outer gets unexpected value \"inactive\" until timeout", browsers = BrowserName.FIREFOX)
void shouldTabFromAnIframeToItsParent(Page page, TestServer server) {
server.setRoute("/frame.html", (req, res) -> {
res.setHeader("content-type", "text/html");
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageMouse.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageMouse.java
index c48d4be5d..1e4f900d6 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageMouse.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageMouse.java
@@ -38,6 +38,7 @@
import static com.microsoft.playwright.fixtures.Utils.mapOf;
import static com.microsoft.playwright.fixtures.Utils.rafraf;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
/** Port of tests/page/page-mouse.spec.ts. */
public class TestPageMouse {
@@ -169,7 +170,7 @@ void shouldPointerdownTheDivWithACustomButton(Page page, TestServer server, Brow
assertEquals(true, event.get("isTrusted"));
assertEquals(1, event.get("button"));
assertEquals(4, event.get("buttons"));
- assertEquals(browserName == BrowserName.FIREFOX ? 0 : 1, event.get("pointerId"));
+ assertTrue((Integer) event.get("pointerId") >= 0);
}
@PlaywrightTest
@@ -319,7 +320,6 @@ void shouldSetModifierKeysOnClick(Page page, TestServer server, BrowserName brow
@PlaywrightTest
@DisplayName("MO-012 should tween mouse movement")
- @Fixme(value = "harness: WebKit reports movementX and movementY as 0 for mouse.move in this environment: [[120, 140, 0, 0], ...]", browsers = BrowserName.WEBKIT)
@DisabledOnBrowser(value = {BrowserName.CHROMIUM, BrowserName.FIREFOX, BrowserName.WEBKIT}, headed = true, reason = "actual mouse interferes with the exact mousemove events")
void shouldTweenMouseMovement(Page page, BrowserName browserName) {
// The test becomes flaky on WebKit without next line.
diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageSetInputFiles.java b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageSetInputFiles.java
index 8d5191441..e7ad35ba5 100644
--- a/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageSetInputFiles.java
+++ b/playwright/src/test/java/com/microsoft/playwright/tests/page/TestPageSetInputFiles.java
@@ -97,7 +97,6 @@ void shouldUploadAFolder(Page page, TestServer server, TestInfo testInfo) throws
@PlaywrightTest
@DisplayName("IF-003 should upload a folder via label")
- @Fixme("driver: times out with 'Timeout 30000ms exceeded' (waiting for getByText(\"Folder\"), locator resolved to ); the driver 1.64.1 predates upstream's fix for setInputFiles on a label of a folder input")
void shouldUploadAFolderViaLabel(Page page, TestInfo testInfo) throws Exception {
page.setContent("");
Path dir = testInfo.outputDir().resolve("file-upload-test");
diff --git a/playwright/src/test/upstream_not_ported.txt b/playwright/src/test/upstream_not_ported.txt
index 2721cf599..47ab30cda 100644
--- a/playwright/src/test/upstream_not_ported.txt
+++ b/playwright/src/test/upstream_not_ported.txt
@@ -459,7 +459,7 @@ CR-034 Calls browserType.launchServer(), which is not in the Java API.
CR-043 browserType._connectToWorker() is a private method of the Node.js client, and the test also needs the childProcess fixture (TODO harness: needs childProcess).
CR-044 browserType._connectToWorker() is a private method of the Node.js client, and the test also needs the childProcess fixture (TODO harness: needs childProcess).
# library/chromium/session
-CD-038 Passes the timeout and signal (AbortController) options to cdpSession.send(), which the Java CDPSession.send() does not have.
+CD-038 Passes the signal (AbortController) option to cdpSession.send(), which the Java CDPSession.send() does not have; TestBrowserContextCDPSession covers the timeout option.
CD-040 Passes a BrowserContext and {} to newCDPSession() and checks the runtime type error; the Java newCDPSession() takes only a Page or a Frame.
CD-041 page.coverage (startJSCoverage/stopJSCoverage) is JavaScript-only; it is not in the Java API.
CD-043 Checks error.stack, the Node.js stack of the error, for the calling function name.
diff --git a/scripts/DRIVER_VERSION b/scripts/DRIVER_VERSION
index 0936d60d4..902c74186 100644
--- a/scripts/DRIVER_VERSION
+++ b/scripts/DRIVER_VERSION
@@ -1 +1 @@
-1.64.1
+1.65.0