diff --git a/README.md b/README.md index f827efe5..121478aa 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 99.0.4812.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 99.0.4837.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 15.4 | ✅ | ✅ | ✅ | -| Firefox 95.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 96.0.1 | :white_check_mark: | :white_check_mark: | :white_check_mark: | Headless execution is supported for all the browsers on all platforms. Check out [system requirements](https://playwright.dev/java/docs/next/intro/#system-requirements) for details. diff --git a/driver/src/main/java/com/microsoft/playwright/impl/Driver.java b/driver/src/main/java/com/microsoft/playwright/impl/Driver.java index 788379a1..c71446b3 100644 --- a/driver/src/main/java/com/microsoft/playwright/impl/Driver.java +++ b/driver/src/main/java/com/microsoft/playwright/impl/Driver.java @@ -66,8 +66,8 @@ public abstract class Driver { } public static void setRequiredEnvironmentVariables(ProcessBuilder pb) { - pb.environment().put("PW_CLI_TARGET_LANG", "java"); - pb.environment().put("PW_CLI_TARGET_LANG_VERSION", getMajorJavaVersion()); + pb.environment().put("PW_LANG_NAME", "java"); + pb.environment().put("PW_LANG_NAME_VERSION", getMajorJavaVersion()); String version = Driver.class.getPackage().getImplementationVersion(); if (version != null) { pb.environment().put("PW_CLI_DISPLAY_VERSION", version); diff --git a/playwright/src/main/java/com/microsoft/playwright/Locator.java b/playwright/src/main/java/com/microsoft/playwright/Locator.java index b60e1c78..3f70703f 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Locator.java +++ b/playwright/src/main/java/com/microsoft/playwright/Locator.java @@ -2180,6 +2180,10 @@ public interface Locator { * Returns locator to the n-th matching element. */ Locator nth(int index); + /** + * A page this locator belongs to. + */ + Page page(); /** * Focuses the element, and then uses {@link Keyboard#down Keyboard.down()} and {@link Keyboard#up Keyboard.up()}. * diff --git a/playwright/src/main/java/com/microsoft/playwright/Route.java b/playwright/src/main/java/com/microsoft/playwright/Route.java index 6200ee7f..d84f6706 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Route.java +++ b/playwright/src/main/java/com/microsoft/playwright/Route.java @@ -100,6 +100,11 @@ public interface Route { * is resolved relative to the current working directory. */ public Path path; + /** + * {@code APIResponse} to fulfill route's request with. Individual fields of the response (such as headers) can be overridden + * using fulfill options. + */ + public APIResponse response; /** * Response status code, defaults to {@code 200}. */ @@ -141,6 +146,14 @@ public interface Route { this.path = path; return this; } + /** + * {@code APIResponse} to fulfill route's request with. Individual fields of the response (such as headers) can be overridden + * using fulfill options. + */ + public FulfillOptions setResponse(APIResponse response) { + this.response = response; + return this; + } /** * Response status code, defaults to {@code 200}. */ 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 0f154130..36c9a660 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestContextImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/APIRequestContextImpl.java @@ -21,8 +21,11 @@ import static com.microsoft.playwright.impl.Serialization.*; import static com.microsoft.playwright.impl.Utils.toFilePayload; class APIRequestContextImpl extends ChannelOwner implements APIRequestContext { + private final TracingImpl tracing; + APIRequestContextImpl(ChannelOwner parent, String type, String guid, JsonObject initializer) { super(parent, type, guid, initializer); + this.tracing = connection.getExistingObject(initializer.getAsJsonObject("tracing").get("guid").getAsString()); } @Override diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/APIResponseImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/APIResponseImpl.java index db2f3817..ee8d6724 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/APIResponseImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/APIResponseImpl.java @@ -109,7 +109,7 @@ class APIResponseImpl implements APIResponse { return initializer.get("url").getAsString(); } - private String fetchUid() { + String fetchUid() { return initializer.get("fetchUid").getAsString(); } 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 41a503e1..0da52c78 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java @@ -55,7 +55,6 @@ class BrowserContextImpl extends ChannelOwner implements BrowserContext { Path videosDir; URL baseUrl; Path recordHarPath; - LocalUtils localUtils; enum EventType { CLOSE, @@ -73,7 +72,8 @@ class BrowserContextImpl extends ChannelOwner implements BrowserContext { } else { browser = null; } - this.tracing = new TracingImpl(this); + this.tracing = connection.getExistingObject(initializer.getAsJsonObject("tracing").get("guid").getAsString()); + tracing.isRemote = browser != null && browser.isRemote; this.request = connection.getExistingObject(initializer.getAsJsonObject("APIRequestContext").get("guid").getAsString()); } @@ -429,7 +429,7 @@ class BrowserContextImpl extends ChannelOwner implements BrowserContext { } @Override - public Tracing tracing() { + public TracingImpl tracing() { return tracing; } diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/BrowserImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/BrowserImpl.java index bffefb17..449da1f5 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/BrowserImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/BrowserImpl.java @@ -172,7 +172,7 @@ class BrowserImpl extends ChannelOwner implements Browser { context.setBaseUrl(options.baseURL); } context.recordHarPath = options.recordHarPath; - context.localUtils = localUtils; + context.tracing().localUtils = localUtils; contexts.add(context); return context; } 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 a827c9e9..d9af419e 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/BrowserTypeImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/BrowserTypeImpl.java @@ -180,7 +180,7 @@ class BrowserTypeImpl extends ChannelOwner implements BrowserType { context.setBaseUrl(options.baseURL); } context.recordHarPath = options.recordHarPath; - context.localUtils = localUtils; + context.tracing().localUtils = localUtils; return context; } 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 31935db0..0831e2b5 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/Connection.java @@ -295,6 +295,9 @@ public class Connection { case "Selectors": result = new SelectorsImpl(parent, type, guid, initializer); break; + case "Tracing": + result = new TracingImpl(parent, type, guid, initializer); + break; case "WebSocket": result = new WebSocketImpl(parent, type, guid, initializer); break; 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 86d876ab..f652a911 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/LocatorImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/LocatorImpl.java @@ -281,6 +281,11 @@ class LocatorImpl implements Locator { return new LocatorImpl(frame, selector + " >> nth=" + index, null); } + @Override + public Page page() { + return frame.page(); + } + @Override public void press(String key, PressOptions options) { if (options == null) { diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/RouteImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/RouteImpl.java index c1e392c7..a3b3ae2b 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/RouteImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/RouteImpl.java @@ -91,8 +91,25 @@ public class RouteImpl extends ChannelOwner implements Route { options = new FulfillOptions(); } - int status = options.status == null ? 200 : options.status; - String body = ""; + Integer status = options.status; + Map headersOption = options.headers; + String fetchResponseUid = null; + + if (options.response != null) { + if (status == null) { + status = options.response.status(); + } + if (headersOption == null) { + headersOption = options.response.headers(); + } + if (options.body == null && options.path == null) { + fetchResponseUid = ((APIResponseImpl) options.response).fetchUid(); + } + } + if (status == null) { + status = 200; + } + String body = null; boolean isBase64 = false; int length = 0; if (options.path != null) { @@ -115,8 +132,8 @@ public class RouteImpl extends ChannelOwner implements Route { } Map headers = new LinkedHashMap<>(); - if (options.headers != null) { - for (Map.Entry h : options.headers.entrySet()) { + if (headersOption != null) { + for (Map.Entry h : headersOption.entrySet()) { headers.put(h.getKey().toLowerCase(), h.getValue()); } } @@ -133,6 +150,9 @@ public class RouteImpl extends ChannelOwner implements Route { params.add("headers", Serialization.toProtocol(headers)); params.addProperty("isBase64", isBase64); params.addProperty("body", body); + if (fetchResponseUid != null) { + params.addProperty("fetchResponseUid", fetchResponseUid); + } sendMessageAsync("fulfill", params); } 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 b9a4d6a7..c5626f9e 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/TracingImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/TracingImpl.java @@ -25,16 +25,16 @@ import java.nio.file.Path; import static com.microsoft.playwright.impl.Serialization.gson; -class TracingImpl implements Tracing { - private final BrowserContextImpl context; +class TracingImpl extends ChannelOwner implements Tracing { + LocalUtils localUtils; + boolean isRemote; private boolean includeSources; - TracingImpl(BrowserContextImpl context) { - this.context = context; + TracingImpl(ChannelOwner parent, String type, String guid, JsonObject initializer) { + super(parent, type, guid, initializer); } private void stopChunkImpl(Path path) { - boolean isRemote = context.browser() != null && context.browser().isRemote; JsonObject params = new JsonObject(); String mode = "doNotSave"; if (path != null) { @@ -45,11 +45,11 @@ class TracingImpl implements Tracing { } } params.addProperty("mode", mode); - JsonObject json = context.sendMessage("tracingStopChunk", params).getAsJsonObject(); + JsonObject json = sendMessage("tracingStopChunk", params).getAsJsonObject(); if (!json.has("artifact")) { return; } - ArtifactImpl artifact = context.connection.getExistingObject(json.getAsJsonObject("artifact").get("guid").getAsString()); + ArtifactImpl artifact = connection.getExistingObject(json.getAsJsonObject("artifact").get("guid").getAsString()); // In case of CDP connection browser is null but since the connection is established by // the driver it is safe to consider the artifact local. if (isRemote) { @@ -61,18 +61,18 @@ class TracingImpl implements Tracing { // Add local sources to the remote trace if necessary. if (isRemote && json.has("sourceEntries")) { JsonArray entries = json.getAsJsonArray("sourceEntries"); - context.localUtils.zip(path, entries); + localUtils.zip(path, entries); } } @Override public void start(StartOptions options) { - context.withLogging("Tracing.start", () -> startImpl(options)); + withLogging("Tracing.start", () -> startImpl(options)); } @Override public void startChunk(StartChunkOptions options) { - context.withLogging("Tracing.startChunk", () -> { + withLogging("Tracing.startChunk", () -> { startChunkImpl(options); }); } @@ -82,7 +82,7 @@ class TracingImpl implements Tracing { options = new StartChunkOptions(); } JsonObject params = gson().toJsonTree(options).getAsJsonObject(); - context.sendMessage("tracingStartChunk", params); + sendMessage("tracingStartChunk", params); } private void startImpl(StartOptions options) { @@ -92,26 +92,26 @@ class TracingImpl implements Tracing { JsonObject params = gson().toJsonTree(options).getAsJsonObject(); includeSources = options.sources != null; if (includeSources) { - if (!context.connection.isCollectingStacks()) { + if (!connection.isCollectingStacks()) { throw new PlaywrightException("Source root directory must be specified via PLAYWRIGHT_JAVA_SRC environment variable when source collection is enabled"); } params.addProperty("sources", true); } - context.sendMessage("tracingStart", params); - context.sendMessage("tracingStartChunk"); + sendMessage("tracingStart", params); + sendMessage("tracingStartChunk"); } @Override public void stop(StopOptions options) { - context.withLogging("Tracing.stop", () -> { + withLogging("Tracing.stop", () -> { stopChunkImpl(options == null ? null : options.path); - context.sendMessage("tracingStop"); + sendMessage("tracingStop"); }); } @Override public void stopChunk(StopChunkOptions options) { - context.withLogging("Tracing.stopChunk", () -> { + withLogging("Tracing.stopChunk", () -> { stopChunkImpl(options == null ? null : options.path); }); } diff --git a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextAddCookies.java b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextAddCookies.java index 68b05b71..1703eae1 100644 --- a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextAddCookies.java +++ b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextAddCookies.java @@ -57,6 +57,7 @@ public class TestBrowserContextAddCookies extends TestBase { .setDomain(cookies.get(0).domain) .setPath(cookies.get(0).path) .setExpires(cookies.get(0).expires) + .setSameSite(cookies.get(0).sameSite) )); assertJsonEquals(new Gson().toJson(cookies), context.cookies()); } @@ -345,21 +346,7 @@ public class TestBrowserContextAddCookies extends TestBase { "}", server.CROSS_PROCESS_PREFIX + "/grid.html"); page.frames().get(1).evaluate("document.cookie = 'username=John Doe'"); page.waitForTimeout(2000); - boolean allowsThirdParty = isFirefox(); List cookies = context.cookies(server.CROSS_PROCESS_PREFIX + "/grid.html"); - if (allowsThirdParty) { - assertJsonEquals("[{\n" + - " 'domain': '127.0.0.1',\n" + - " 'expires': -1,\n" + - " 'httpOnly': false,\n" + - " 'name': 'username',\n" + - " 'path': '/',\n" + - " 'sameSite': 'NONE',\n" + - " 'secure': false,\n" + - " 'value': 'John Doe'\n" + - "}]", cookies); - } else { - assertEquals(0, cookies.size()); - } + assertEquals(0, cookies.size()); } } diff --git a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCookies.java b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCookies.java index fb405932..1d191fcd 100644 --- a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCookies.java +++ b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextCookies.java @@ -50,7 +50,7 @@ public class TestBrowserContextCookies extends TestBase { " expires: -1,\n" + " httpOnly: false,\n" + " secure: false,\n" + - " sameSite: '" + (isChromium() ? "LAX" : "NONE") +"'\n" + + " sameSite: '" + (isChromium() || isFirefox() ? "LAX" : "NONE") +"'\n" + " }]", cookies); } @@ -74,7 +74,7 @@ public class TestBrowserContextCookies extends TestBase { assertEquals(timestamp, cookie.expires); assertEquals(false, cookie.httpOnly); assertEquals(false, cookie.secure); - if (isChromium()) { + if (isChromium() || isFirefox()) { assertEquals(SameSiteAttribute.LAX, cookie.sameSite); } else { assertEquals(SameSiteAttribute.NONE, cookie.sameSite); @@ -146,7 +146,7 @@ public class TestBrowserContextCookies extends TestBase { " expires: -1,\n" + " httpOnly: false,\n" + " secure: false,\n" + - " sameSite: '" + (isChromium() ? "LAX" : "NONE") +"'\n" + + " sameSite: '" + (isChromium() || isFirefox() ? "LAX" : "NONE") +"'\n" + " },\n" + " {\n" + " name: 'username',\n" + @@ -156,7 +156,7 @@ public class TestBrowserContextCookies extends TestBase { " expires: -1,\n" + " httpOnly: false,\n" + " secure: false,\n" + - " sameSite: '" + (isChromium() ? "LAX" : "NONE") +"'\n" + + " sameSite: '" + (isChromium() || isFirefox() ? "LAX" : "NONE") +"'\n" + " }\n" + "]", cookies); } diff --git a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextStorageState.java b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextStorageState.java index 3ad573c0..81269481 100644 --- a/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextStorageState.java +++ b/playwright/src/test/java/com/microsoft/playwright/TestBrowserContextStorageState.java @@ -109,7 +109,7 @@ public class TestBrowserContextStorageState extends TestBase { " 'expires':-1,\n" + " 'httpOnly':false,\n" + " 'secure':false,\n" + - " 'sameSite':'" + (isChromium() ? "Lax" : "None") + "'\n" + + " 'sameSite':'" + (isChromium() || isFirefox() ? "Lax" : "None") + "'\n" + " }],\n" + " 'origins':[\n" + " {\n" + diff --git a/playwright/src/test/java/com/microsoft/playwright/TestPageLocatorConvenience.java b/playwright/src/test/java/com/microsoft/playwright/TestPageLocatorConvenience.java new file mode 100644 index 00000000..91106282 --- /dev/null +++ b/playwright/src/test/java/com/microsoft/playwright/TestPageLocatorConvenience.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.microsoft.playwright; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class TestPageLocatorConvenience extends TestBase { + @Test + void shouldReturnPage() { + page.navigate(server.PREFIX + "/frames/two-frames.html"); + Locator outer = page.locator("#outer"); + assertEquals(page, outer.page()); + Locator inner = outer.locator("#inner"); + assertEquals(page, inner.page()); + Locator inFrame = page.frames().get(1).locator("div"); + assertEquals(page, inFrame.page()); + } +} diff --git a/playwright/src/test/java/com/microsoft/playwright/TestPageRequestFulfill.java b/playwright/src/test/java/com/microsoft/playwright/TestPageRequestFulfill.java new file mode 100644 index 00000000..3f1781e7 --- /dev/null +++ b/playwright/src/test/java/com/microsoft/playwright/TestPageRequestFulfill.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) Microsoft Corporation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.microsoft.playwright; + +import org.junit.jupiter.api.Test; + +import static com.microsoft.playwright.Utils.mapOf; +import static org.junit.jupiter.api.Assertions.assertEquals; + +public class TestPageRequestFulfill extends TestBase { + @Test + void shouldFulfillWithGlobalFetchResult() { + page.route("**/*", route -> { + APIRequestContext request = playwright.request().newContext(); + APIResponse response = request.get(server.PREFIX + "/simple.json"); + route.fulfill(new Route.FulfillOptions().setResponse(response)); + }); + Response response = page.navigate(server.EMPTY_PAGE); + assertEquals("application/json", response.headers().get("content-type")); + assertEquals(200, response.status()); + assertEquals("{\"foo\": \"bar\"}\n", response.text()); + } + + @Test + void shouldFulfillWithFetchResult() { + page.route("**/*", route -> { + APIResponse response = page.request().get(server.PREFIX + "/simple.json"); + route.fulfill(new Route.FulfillOptions().setResponse(response)); + }); + Response response = page.navigate(server.EMPTY_PAGE); + assertEquals("application/json", response.headers().get("content-type")); + assertEquals(200, response.status()); + assertEquals("{\"foo\": \"bar\"}\n", response.text()); + } + + @Test + void shouldFulfillWithFetchResultAndOverrides() { + page.route("**/*", route -> { + APIResponse response = page.request().get(server.PREFIX + "/simple.json"); + route.fulfill(new Route.FulfillOptions().setResponse(response) + .setStatus(201).setHeaders(mapOf("Content-Type", "application/json", "foo", "bar"))); + }); + Response response = page.navigate(server.EMPTY_PAGE); + assertEquals("application/json", response.headers().get("content-type")); + assertEquals(201, response.status()); + assertEquals("bar", response.allHeaders().get("foo")); + assertEquals("{\"foo\": \"bar\"}\n", response.text()); + } +} diff --git a/playwright/src/test/java/com/microsoft/playwright/TestPageWaitForNavigation.java b/playwright/src/test/java/com/microsoft/playwright/TestPageWaitForNavigation.java index 9595cee3..e622a190 100644 --- a/playwright/src/test/java/com/microsoft/playwright/TestPageWaitForNavigation.java +++ b/playwright/src/test/java/com/microsoft/playwright/TestPageWaitForNavigation.java @@ -23,6 +23,8 @@ import java.io.OutputStreamWriter; import java.net.MalformedURLException; import java.net.URL; import java.util.List; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Future; import java.util.regex.Pattern; import static com.microsoft.playwright.Utils.expectedSSLError; @@ -239,15 +241,18 @@ public class TestPageWaitForNavigation extends TestBase { server.setRoute("/empty.html", exchange -> {}); try { frame.waitForNavigation(() -> { - page.evaluate("() => {\n" + - " frames[0].location.href = '/empty.html';\n" + - " setTimeout(() => document.querySelector('iframe').remove());\n" + - "}\n"); + Future req = server.futureRequest("/empty.html"); + page.evalOnSelector("iframe", "frame => { frame.contentWindow.location.href = '/empty.html'; }"); + try { + req.get(); + } catch (InterruptedException | ExecutionException e) { + throw new RuntimeException(e); + } + page.evaluate("setTimeout(() => document.querySelector('iframe').remove());"); }); fail("did not throw"); } catch (PlaywrightException e) { -// assertTrue(e.getMessage().contains("waiting for navigation until \"load\"")); - assertTrue(e.getMessage().contains("frame was detached")); + assertTrue(e.getMessage().contains("frame was detached"), e.getMessage()); } } diff --git a/scripts/CLI_VERSION b/scripts/CLI_VERSION index 7126c05b..78e1480f 100644 --- a/scripts/CLI_VERSION +++ b/scripts/CLI_VERSION @@ -1 +1 @@ -1.18.0-beta-1642620709000 +1.19.0-alpha-1643327018000