diff --git a/README.md b/README.md index 54b078e1..4ebc2889 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 97.0.4666.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 97.0.4681.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 15.4 | ✅ | ✅ | ✅ | | Firefox 93.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | diff --git a/assertions/src/main/java/com/microsoft/playwright/assertions/PlaywrightAssertions.java b/assertions/src/main/java/com/microsoft/playwright/assertions/PlaywrightAssertions.java index a780acfc..95a124cb 100644 --- a/assertions/src/main/java/com/microsoft/playwright/assertions/PlaywrightAssertions.java +++ b/assertions/src/main/java/com/microsoft/playwright/assertions/PlaywrightAssertions.java @@ -28,7 +28,18 @@ import com.microsoft.playwright.impl.PageAssertionsImpl; * *

Consider the following example: *

{@code
- * assertThat(page.locator('.status')).hasText('Submitted');
+ * ...
+ * import static com.microsoft.playwright.assertions.PlaywrightAssertions.assertThat;
+ *
+ * public class TestExample {
+ *   ...
+ *   @Test
+ *   void statusBecomesSubmitted() {
+ *     ...
+ *     page.click("#submit-button");
+ *     assertThat(page.locator(".status")).hasText("Submitted");
+ *   }
+ * }
  * }
* *

Playwright will be re-testing the node with the selector {@code .status} until fetched Node has the {@code "Submitted"} text. It @@ -36,6 +47,8 @@ import com.microsoft.playwright.impl.PageAssertionsImpl; * You can pass this timeout as an option. * *

By default, the timeout for assertions is set to 5 seconds. + * + *

To use Playwright assertions add the following dependency into the {@code pom.xml} of your Maven project: */ public interface PlaywrightAssertions { /** diff --git a/assertions/src/test/java/com/microsoft/playwright/TestLocatorAssertions.java b/assertions/src/test/java/com/microsoft/playwright/TestLocatorAssertions.java index b959e075..978c9b54 100644 --- a/assertions/src/test/java/com/microsoft/playwright/TestLocatorAssertions.java +++ b/assertions/src/test/java/com/microsoft/playwright/TestLocatorAssertions.java @@ -447,13 +447,13 @@ public class TestLocatorAssertions extends TestBase { void hasJSPropertyNumberFail() { page.setContent("

Text content
"); Locator locator = page.locator("#node"); - page.evalOnSelector("div", "e => e.foo = { a: 1, b: 'string' }"); + page.evalOnSelector("div", "e => e.foo = 2021"); try { assertThat(locator).hasJSProperty("foo", 1, new LocatorAssertions.HasJSPropertyOptions().setTimeout(1000)); fail("did not throw"); } catch (AssertionFailedError e) { assertEquals("1", e.getExpected().getStringRepresentation()); - assertEquals("{a=1, b=string}", e.getActual().getStringRepresentation()); + assertEquals("2021", e.getActual().getStringRepresentation()); assertTrue(e.getMessage().contains("Locator expected to have JavaScript property 'foo'"), e.getMessage()); } } @@ -474,7 +474,6 @@ public class TestLocatorAssertions extends TestBase { } @Test - @Disabled("https://github.com/microsoft/playwright/pull/9865") void hasJSPropertyStringFail() { page.setContent("
Text content
"); Locator locator = page.locator("#node"); @@ -485,9 +484,9 @@ public class TestLocatorAssertions extends TestBase { assertEquals("foo", e.getExpected().getStringRepresentation()); assertEquals("node", e.getActual().getStringRepresentation()); assertTrue(e.getMessage().contains("Locator expected to have JavaScript property 'id'"), e.getMessage()); - throw e; } } + @Test void hasValueTextPass() { page.setContent(""); 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 446836fe..92e99530 100644 --- a/playwright/src/main/java/com/microsoft/playwright/impl/TracingImpl.java +++ b/playwright/src/main/java/com/microsoft/playwright/impl/TracingImpl.java @@ -34,6 +34,7 @@ class TracingImpl implements Tracing { private void stopChunkImpl(Path path) { JsonObject params = new JsonObject(); params.addProperty("save", path != null); + params.addProperty("skipCompress", false); JsonObject json = context.sendMessage("tracingStopChunk", params).getAsJsonObject(); if (!json.has("artifact")) { return; diff --git a/scripts/CLI_VERSION b/scripts/CLI_VERSION index 061bdf01..b8b348d1 100644 --- a/scripts/CLI_VERSION +++ b/scripts/CLI_VERSION @@ -1 +1 @@ -1.17.0-next-1635196647000 +1.17.0-next-1635526444000