diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/ArtifactImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/ArtifactImpl.java index ce83e2c6a..5f0ccaa47 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/ArtifactImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/ArtifactImpl.java @@ -67,7 +67,7 @@ public String failure() { public Path pathAfterFinished() { if (connection.isRemote()) { - throw new PlaywrightException("Path is not available when using browserType.connect(). Use download.saveAs() to save a local copy."); + throw new PlaywrightException("Path is not available when connecting remotely. Use saveAs() to save a local copy."); } return FileSystems.getDefault().getPath(channel.pathAfterFinished(NO_TIMEOUT).value); } diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/VideoImpl.java b/playwright/src/main/java/com/microsoft/playwright/impl/VideoImpl.java index ca5e45424..8cee30e23 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/VideoImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/VideoImpl.java @@ -44,7 +44,7 @@ public void delete() { @Override public Path path() { if (page.connection.isRemote()) { - throw new PlaywrightException("Path is not available when using browserType.connect(). Use saveAs() to save a local copy."); + throw new PlaywrightException("Path is not available when connecting remotely. Use saveAs() to save a local copy."); } if (artifact == null) throw new PlaywrightException("Video recording has not been started."); diff --git a/playwright/src/test/java/com/microsoft/playwright/TestBrowserTypeConnect.java b/playwright/src/test/java/com/microsoft/playwright/TestBrowserTypeConnect.java index d576fb4bd..213181661 100644 --- a/playwright/src/test/java/com/microsoft/playwright/TestBrowserTypeConnect.java +++ b/playwright/src/test/java/com/microsoft/playwright/TestBrowserTypeConnect.java @@ -331,7 +331,7 @@ void shouldSaveAsVideosFromRemoteBrowser(Browser browser, @TempDir Path tempDir) page.video().saveAs(savedAsPath); assertTrue(Files.exists(savedAsPath)); PlaywrightException e = assertThrows(PlaywrightException.class, () -> page.video().path()); - assertTrue(e.getMessage().contains("Path is not available when using browserType.connect(). Use saveAs() to save a local copy.")); + assertTrue(e.getMessage().contains("Path is not available when connecting remotely. Use saveAs() to save a local copy.")); } @@ -354,7 +354,7 @@ void shouldSaveDownload(Browser browser, Server server, @TempDir Path tempDir) t assertTrue(Files.exists(nestedPath)); assertEquals("Hello world", new String(Files.readAllBytes(nestedPath), StandardCharsets.UTF_8)); PlaywrightException e = assertThrows(PlaywrightException.class, () -> download.path()); - assertTrue(e.getMessage().contains("Path is not available when using browserType.connect(). Use download.saveAs() to save a local copy.")); + assertTrue(e.getMessage().contains("Path is not available when connecting remotely. Use saveAs() to save a local copy.")); page.close(); } diff --git a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsertypeConnect.java b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsertypeConnect.java index d7e9e283e..cddeb2a4f 100644 --- a/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsertypeConnect.java +++ b/playwright/src/test/java/com/microsoft/playwright/tests/library/TestBrowsertypeConnect.java @@ -895,7 +895,6 @@ void shouldBeAbleToConnect20TimesToASingleServerWithoutWarnings(Connect connect, @PlaywrightTest @DisplayName("BT-068 should save download") - @Fixme("java: the message of download.path() differs: 'Path is not available when using browserType.connect(). Use download.saveAs() to save a local copy.'") void shouldSaveDownload(TestServer server, Connect connect, StartRemoteServer startRemoteServer, TestInfo testInfo) throws Exception { server.setRoute("/download", (req, res) -> { res.setHeader("Content-Type", "application/octet-stream");