diff --git a/README.md b/README.md index 727a21475..105c09fc8 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 113.0.5672.24 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 113.0.5672.53 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 16.4 | ✅ | ✅ | ✅ | -| Firefox 111.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 112.0 | :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/playwright/src/main/java/com/microsoft/playwright/Browser.java b/playwright/src/main/java/com/microsoft/playwright/Browser.java index a67150196..5a77201c7 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Browser.java +++ b/playwright/src/main/java/com/microsoft/playwright/Browser.java @@ -88,7 +88,8 @@ class NewContextOptions { */ public Optional colorScheme; /** - * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. + * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. Learn more about emulating devices with device scale factor. */ public Double deviceScaleFactor; /** @@ -103,7 +104,8 @@ class NewContextOptions { public Optional forcedColors; public Geolocation geolocation; /** - * Specifies if viewport supports touch events. Defaults to false. + * Specifies if viewport supports touch events. Defaults to false. Learn more about mobile emulation. */ public Boolean hasTouch; /** @@ -116,21 +118,25 @@ class NewContextOptions { */ public Boolean ignoreHTTPSErrors; /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not - * supported in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. isMobile is a part of device, + * so you don't actually need to set it manually. Defaults to {@code false} and is not supported in Firefox. Learn more + * about mobile emulation. */ public Boolean isMobile; /** - * Whether or not to enable JavaScript in the context. Defaults to {@code true}. + * Whether or not to enable JavaScript in the context. Defaults to {@code true}. Learn more about disabling JavaScript. */ public Boolean javaScriptEnabled; /** * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, - * {@code Accept-Language} request header value as well as number and date formatting rules. + * {@code Accept-Language} request header value as well as number and date formatting rules. Learn more about emulation in + * our emulation guide. */ public String locale; /** - * Whether to emulate network being offline. Defaults to {@code false}. + * Whether to emulate network being offline. Defaults to {@code false}. Learn more about network emulation. */ public Boolean offline; /** @@ -228,8 +234,9 @@ class NewContextOptions { */ public String userAgent; /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent - * viewport emulation. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the + * consistent viewport emulation. Learn more about viewport + * emulation. * *

NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the * operating system. It makes the execution of the tests non-deterministic. @@ -279,7 +286,8 @@ public NewContextOptions setColorScheme(ColorScheme colorScheme) { return this; } /** - * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. + * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. Learn more about emulating devices with device scale factor. */ public NewContextOptions setDeviceScaleFactor(double deviceScaleFactor) { this.deviceScaleFactor = deviceScaleFactor; @@ -309,7 +317,8 @@ public NewContextOptions setGeolocation(Geolocation geolocation) { return this; } /** - * Specifies if viewport supports touch events. Defaults to false. + * Specifies if viewport supports touch events. Defaults to false. Learn more about mobile emulation. */ public NewContextOptions setHasTouch(boolean hasTouch) { this.hasTouch = hasTouch; @@ -338,15 +347,17 @@ public NewContextOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) { return this; } /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not - * supported in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. isMobile is a part of device, + * so you don't actually need to set it manually. Defaults to {@code false} and is not supported in Firefox. Learn more + * about mobile emulation. */ public NewContextOptions setIsMobile(boolean isMobile) { this.isMobile = isMobile; return this; } /** - * Whether or not to enable JavaScript in the context. Defaults to {@code true}. + * Whether or not to enable JavaScript in the context. Defaults to {@code true}. Learn more about disabling JavaScript. */ public NewContextOptions setJavaScriptEnabled(boolean javaScriptEnabled) { this.javaScriptEnabled = javaScriptEnabled; @@ -354,14 +365,16 @@ public NewContextOptions setJavaScriptEnabled(boolean javaScriptEnabled) { } /** * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, - * {@code Accept-Language} request header value as well as number and date formatting rules. + * {@code Accept-Language} request header value as well as number and date formatting rules. Learn more about emulation in + * our emulation guide. */ public NewContextOptions setLocale(String locale) { this.locale = locale; return this; } /** - * Whether to emulate network being offline. Defaults to {@code false}. + * Whether to emulate network being offline. Defaults to {@code false}. Learn more about network emulation. */ public NewContextOptions setOffline(boolean offline) { this.offline = offline; @@ -542,8 +555,9 @@ public NewContextOptions setUserAgent(String userAgent) { return this; } /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent - * viewport emulation. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the + * consistent viewport emulation. Learn more about viewport + * emulation. * *

NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the * operating system. It makes the execution of the tests non-deterministic. @@ -552,8 +566,9 @@ public NewContextOptions setViewportSize(int width, int height) { return setViewportSize(new ViewportSize(width, height)); } /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent - * viewport emulation. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the + * consistent viewport emulation. Learn more about viewport + * emulation. * *

NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the * operating system. It makes the execution of the tests non-deterministic. @@ -595,7 +610,8 @@ class NewPageOptions { */ public Optional colorScheme; /** - * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. + * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. Learn more about emulating devices with device scale factor. */ public Double deviceScaleFactor; /** @@ -610,7 +626,8 @@ class NewPageOptions { public Optional forcedColors; public Geolocation geolocation; /** - * Specifies if viewport supports touch events. Defaults to false. + * Specifies if viewport supports touch events. Defaults to false. Learn more about mobile emulation. */ public Boolean hasTouch; /** @@ -623,21 +640,25 @@ class NewPageOptions { */ public Boolean ignoreHTTPSErrors; /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not - * supported in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. isMobile is a part of device, + * so you don't actually need to set it manually. Defaults to {@code false} and is not supported in Firefox. Learn more + * about mobile emulation. */ public Boolean isMobile; /** - * Whether or not to enable JavaScript in the context. Defaults to {@code true}. + * Whether or not to enable JavaScript in the context. Defaults to {@code true}. Learn more about disabling JavaScript. */ public Boolean javaScriptEnabled; /** * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, - * {@code Accept-Language} request header value as well as number and date formatting rules. + * {@code Accept-Language} request header value as well as number and date formatting rules. Learn more about emulation in + * our emulation guide. */ public String locale; /** - * Whether to emulate network being offline. Defaults to {@code false}. + * Whether to emulate network being offline. Defaults to {@code false}. Learn more about network emulation. */ public Boolean offline; /** @@ -735,8 +756,9 @@ class NewPageOptions { */ public String userAgent; /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent - * viewport emulation. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the + * consistent viewport emulation. Learn more about viewport + * emulation. * *

NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the * operating system. It makes the execution of the tests non-deterministic. @@ -786,7 +808,8 @@ public NewPageOptions setColorScheme(ColorScheme colorScheme) { return this; } /** - * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. + * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. Learn more about emulating devices with device scale factor. */ public NewPageOptions setDeviceScaleFactor(double deviceScaleFactor) { this.deviceScaleFactor = deviceScaleFactor; @@ -816,7 +839,8 @@ public NewPageOptions setGeolocation(Geolocation geolocation) { return this; } /** - * Specifies if viewport supports touch events. Defaults to false. + * Specifies if viewport supports touch events. Defaults to false. Learn more about mobile emulation. */ public NewPageOptions setHasTouch(boolean hasTouch) { this.hasTouch = hasTouch; @@ -845,15 +869,17 @@ public NewPageOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) { return this; } /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not - * supported in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. isMobile is a part of device, + * so you don't actually need to set it manually. Defaults to {@code false} and is not supported in Firefox. Learn more + * about mobile emulation. */ public NewPageOptions setIsMobile(boolean isMobile) { this.isMobile = isMobile; return this; } /** - * Whether or not to enable JavaScript in the context. Defaults to {@code true}. + * Whether or not to enable JavaScript in the context. Defaults to {@code true}. Learn more about disabling JavaScript. */ public NewPageOptions setJavaScriptEnabled(boolean javaScriptEnabled) { this.javaScriptEnabled = javaScriptEnabled; @@ -861,14 +887,16 @@ public NewPageOptions setJavaScriptEnabled(boolean javaScriptEnabled) { } /** * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, - * {@code Accept-Language} request header value as well as number and date formatting rules. + * {@code Accept-Language} request header value as well as number and date formatting rules. Learn more about emulation in + * our emulation guide. */ public NewPageOptions setLocale(String locale) { this.locale = locale; return this; } /** - * Whether to emulate network being offline. Defaults to {@code false}. + * Whether to emulate network being offline. Defaults to {@code false}. Learn more about network emulation. */ public NewPageOptions setOffline(boolean offline) { this.offline = offline; @@ -1049,8 +1077,9 @@ public NewPageOptions setUserAgent(String userAgent) { return this; } /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent - * viewport emulation. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the + * consistent viewport emulation. Learn more about viewport + * emulation. * *

NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the * operating system. It makes the execution of the tests non-deterministic. @@ -1059,8 +1088,9 @@ public NewPageOptions setViewportSize(int width, int height) { return setViewportSize(new ViewportSize(width, height)); } /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent - * viewport emulation. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the + * consistent viewport emulation. Learn more about viewport + * emulation. * *

NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the * operating system. It makes the execution of the tests non-deterministic. diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java index 3da16016c..06da4d06e 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java @@ -414,7 +414,8 @@ class LaunchPersistentContextOptions { */ public Optional colorScheme; /** - * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. + * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. Learn more about emulating devices with device scale factor. */ public Double deviceScaleFactor; /** @@ -462,7 +463,8 @@ class LaunchPersistentContextOptions { */ public Boolean handleSIGTERM; /** - * Specifies if viewport supports touch events. Defaults to false. + * Specifies if viewport supports touch events. Defaults to false. Learn more about mobile emulation. */ public Boolean hasTouch; /** @@ -492,21 +494,25 @@ class LaunchPersistentContextOptions { */ public Boolean ignoreHTTPSErrors; /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not - * supported in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. isMobile is a part of device, + * so you don't actually need to set it manually. Defaults to {@code false} and is not supported in Firefox. Learn more + * about mobile emulation. */ public Boolean isMobile; /** - * Whether or not to enable JavaScript in the context. Defaults to {@code true}. + * Whether or not to enable JavaScript in the context. Defaults to {@code true}. Learn more about disabling JavaScript. */ public Boolean javaScriptEnabled; /** * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, - * {@code Accept-Language} request header value as well as number and date formatting rules. + * {@code Accept-Language} request header value as well as number and date formatting rules. Learn more about emulation in + * our emulation guide. */ public String locale; /** - * Whether to emulate network being offline. Defaults to {@code false}. + * Whether to emulate network being offline. Defaults to {@code false}. Learn more about network emulation. */ public Boolean offline; /** @@ -602,8 +608,9 @@ class LaunchPersistentContextOptions { */ public String userAgent; /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent - * viewport emulation. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the + * consistent viewport emulation. Learn more about viewport + * emulation. * *

NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the * operating system. It makes the execution of the tests non-deterministic. @@ -687,7 +694,8 @@ public LaunchPersistentContextOptions setColorScheme(ColorScheme colorScheme) { return this; } /** - * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. + * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. Learn more about emulating devices with device scale factor. */ public LaunchPersistentContextOptions setDeviceScaleFactor(double deviceScaleFactor) { this.deviceScaleFactor = deviceScaleFactor; @@ -771,7 +779,8 @@ public LaunchPersistentContextOptions setHandleSIGTERM(boolean handleSIGTERM) { return this; } /** - * Specifies if viewport supports touch events. Defaults to false. + * Specifies if viewport supports touch events. Defaults to false. Learn more about mobile emulation. */ public LaunchPersistentContextOptions setHasTouch(boolean hasTouch) { this.hasTouch = hasTouch; @@ -826,15 +835,17 @@ public LaunchPersistentContextOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSEr return this; } /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not - * supported in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. isMobile is a part of device, + * so you don't actually need to set it manually. Defaults to {@code false} and is not supported in Firefox. Learn more + * about mobile emulation. */ public LaunchPersistentContextOptions setIsMobile(boolean isMobile) { this.isMobile = isMobile; return this; } /** - * Whether or not to enable JavaScript in the context. Defaults to {@code true}. + * Whether or not to enable JavaScript in the context. Defaults to {@code true}. Learn more about disabling JavaScript. */ public LaunchPersistentContextOptions setJavaScriptEnabled(boolean javaScriptEnabled) { this.javaScriptEnabled = javaScriptEnabled; @@ -842,14 +853,16 @@ public LaunchPersistentContextOptions setJavaScriptEnabled(boolean javaScriptEna } /** * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, - * {@code Accept-Language} request header value as well as number and date formatting rules. + * {@code Accept-Language} request header value as well as number and date formatting rules. Learn more about emulation in + * our emulation guide. */ public LaunchPersistentContextOptions setLocale(String locale) { this.locale = locale; return this; } /** - * Whether to emulate network being offline. Defaults to {@code false}. + * Whether to emulate network being offline. Defaults to {@code false}. Learn more about network emulation. */ public LaunchPersistentContextOptions setOffline(boolean offline) { this.offline = offline; @@ -1027,8 +1040,9 @@ public LaunchPersistentContextOptions setUserAgent(String userAgent) { return this; } /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent - * viewport emulation. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the + * consistent viewport emulation. Learn more about viewport + * emulation. * *

NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the * operating system. It makes the execution of the tests non-deterministic. @@ -1037,8 +1051,9 @@ public LaunchPersistentContextOptions setViewportSize(int width, int height) { return setViewportSize(new ViewportSize(width, height)); } /** - * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent - * viewport emulation. + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the + * consistent viewport emulation. Learn more about viewport + * emulation. * *

NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the * operating system. It makes the execution of the tests non-deterministic. diff --git a/playwright/src/main/java/com/microsoft/playwright/Locator.java b/playwright/src/main/java/com/microsoft/playwright/Locator.java index 6a55b8ef8..48d052149 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Locator.java +++ b/playwright/src/main/java/com/microsoft/playwright/Locator.java @@ -2020,9 +2020,10 @@ public WaitForOptions setTimeout(double timeout) { /** * When locator points to a list of elements, returns array of locators, pointing to respective elements. * - *

Note that {@link Locator#all Locator.all()} does not wait for elements to match the locator, and instead immediately - * returns whatever is present in the page. To avoid flakiness when elements are loaded dynamically, wait for the loading - * to finish before calling {@link Locator#all Locator.all()}. + *

NOTE: {@link Locator#all Locator.all()} does not wait for elements to match the locator, and instead immediately returns + * whatever is present in the page. When the list of elements changes dynamically, {@link Locator#all Locator.all()} will + * produce unpredictable and flaky results. When the list of elements is stable, but loaded dynamically, wait for the full + * list to finish loading before calling {@link Locator#all Locator.all()}. * *

**Usage** *

{@code
diff --git a/playwright/src/main/java/com/microsoft/playwright/Route.java b/playwright/src/main/java/com/microsoft/playwright/Route.java
index 4e0e82859..6e60c2058 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Route.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Route.java
@@ -154,6 +154,10 @@ class FetchOptions {
      * If set changes the post data of request.
      */
     public Object postData;
+    /**
+     * Request timeout in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout.
+     */
+    public Double timeout;
     /**
      * If set changes the request URL. New URL must have same protocol as original one.
      */
@@ -195,6 +199,13 @@ public FetchOptions setPostData(byte[] postData) {
       this.postData = postData;
       return this;
     }
+    /**
+     * Request timeout in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout.
+     */
+    public FetchOptions setTimeout(double timeout) {
+      this.timeout = timeout;
+      return this;
+    }
     /**
      * If set changes the request URL. New URL must have same protocol as original one.
      */
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 921244c7d..2c08b81f1 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/RouteImpl.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/RouteImpl.java
@@ -92,6 +92,9 @@ public APIResponse fetch(FetchOptions fetchOptions) {
     } else {
       options.data = request.postDataBuffer();
     }
+    if (fetchOptions != null && fetchOptions.timeout != null) {
+      options.timeout = fetchOptions.timeout;
+    }
     APIRequestContextImpl apiRequest = request.frame().page().context().request();
     String url = (fetchOptions == null || fetchOptions.url == null) ? request().url() : fetchOptions.url;
     return apiRequest.fetch(url, options);
diff --git a/playwright/src/main/java/com/microsoft/playwright/impl/Utils.java b/playwright/src/main/java/com/microsoft/playwright/impl/Utils.java
index 05b60041b..0346e5dcc 100644
--- a/playwright/src/main/java/com/microsoft/playwright/impl/Utils.java
+++ b/playwright/src/main/java/com/microsoft/playwright/impl/Utils.java
@@ -252,7 +252,7 @@ static void writeToFile(byte[] buffer, Path path) {
   static void writeToFile(InputStream inputStream, Path path) {
     mkParentDirs(path);
     try (FileOutputStream out = new FileOutputStream(path.toFile())) {
-      byte[] buf = new byte[8192];
+      byte[] buf = new byte[1024 * 1024];
       int length;
       while ((length = inputStream.read(buf)) > 0) {
         out.write(buf, 0, length);
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestClick.java b/playwright/src/test/java/com/microsoft/playwright/TestClick.java
index c03d1eb21..369a75115 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestClick.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestClick.java
@@ -16,15 +16,12 @@
 
 package com.microsoft.playwright;
 
-import com.microsoft.playwright.options.AriaRole;
-import com.microsoft.playwright.options.WaitUntilState;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.condition.DisabledIf;
 import org.junit.jupiter.api.condition.EnabledIf;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.function.Predicate;
 
 import static com.microsoft.playwright.options.KeyboardModifier.SHIFT;
 import static com.microsoft.playwright.options.MouseButton.RIGHT;
@@ -425,15 +422,23 @@ void shouldClickTheButtonWithOffsetWithPageScale() {
     // 20;10 + 8px of border in each direction
     int expectedX = 28;
     int expectedY = 18;
+
     if (isWebKit()) {
-      // WebKit rounds up during css -> dip -> css conversion.
-      expectedX = 26;
-      expectedY = 17;
+      // WebKit for macOS 12 has different expectations starting r1829.
+      if (isMac && Utils.osVersion() < 12) {
+        // WebKit rounds up during css -> dip -> css conversion.
+        expectedX = 26;
+        expectedY = 17;
+      } else {
+        expectedX = 29;
+        expectedY = 19;
+      }
     } else if (isChromium() && !headful) {
       // Headless Chromium rounds down during css -> dip -> css conversion.
       expectedX = 27;
       expectedY = 18;
     }
+
     assertEquals(expectedX, Math.round((Integer) page.evaluate("pageX") + 0.01));
     assertEquals(expectedY, Math.round((Integer) page.evaluate("pageY") + 0.01));
     context.close();
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestPageInterception.java b/playwright/src/test/java/com/microsoft/playwright/TestPageInterception.java
index 61ab82c10..0df221f83 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestPageInterception.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestPageInterception.java
@@ -2,6 +2,8 @@
 
 import org.junit.jupiter.api.Test;
 
+import java.io.OutputStreamWriter;
+import java.io.Writer;
 import java.util.HashMap;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
@@ -71,6 +73,23 @@ void shouldFulfillInterceptedResponseUsingAlias() {
     assertTrue(response.headers().get("content-type").contains("text/html"));
   }
 
+  @Test
+  void shouldSupportTimeoutOptionInRouteFetch() {
+    server.setRoute("/slow", exchange -> {
+      exchange.getResponseHeaders().set("Content-type", "text/plain");
+      exchange.sendResponseHeaders(200, 4096);
+    });
+
+    page.route("**/*", route -> {
+      PlaywrightException error = assertThrows(PlaywrightException.class,
+        () -> route.fetch(new Route.FetchOptions().setTimeout(1000)));
+      assertTrue(error.getMessage().contains("Request timed out after 1000ms"), error.getMessage());
+    });
+    PlaywrightException error = assertThrows(PlaywrightException.class,
+      () -> page.navigate(server.PREFIX + "/slow", new Page.NavigateOptions().setTimeout(2000)));
+    assertTrue(error.getMessage().contains("Timeout 2000ms exceeded"), error.getMessage());
+  }
+
   @Test
   void shouldInterceptWithUrlOverride() {
     page.route("**/*.html", route -> {
diff --git a/playwright/src/test/java/com/microsoft/playwright/TestWebSocket.java b/playwright/src/test/java/com/microsoft/playwright/TestWebSocket.java
index 59ae60025..5a96afff0 100644
--- a/playwright/src/test/java/com/microsoft/playwright/TestWebSocket.java
+++ b/playwright/src/test/java/com/microsoft/playwright/TestWebSocket.java
@@ -185,7 +185,7 @@ void shouldRejectFutureEventOnSocketClose() {
     PlaywrightException e = assertThrows(PlaywrightException.class, () -> {
       ws.waitForFrameSent(() -> page.evaluate("window.ws.close()"));
     });
-    assertTrue(e.getMessage().contains("Socket closed"), e.getMessage());
+    assertTrue(e.getMessage().matches("Socket closed|Socket error"), e.getMessage());
   }
 
   @Test
diff --git a/playwright/src/test/java/com/microsoft/playwright/Utils.java b/playwright/src/test/java/com/microsoft/playwright/Utils.java
index 479fa0e55..72bafca1d 100644
--- a/playwright/src/test/java/com/microsoft/playwright/Utils.java
+++ b/playwright/src/test/java/com/microsoft/playwright/Utils.java
@@ -144,6 +144,10 @@ static OS getOS() {
     return OS.UNKNOWN;
   }
 
+  static int osVersion() {
+    return Integer.parseInt(System.getProperty("os.version").split("\\.")[0]);
+  }
+
   static List expectedSSLError(String browserName) {
     switch (browserName) {
       case "chromium":
diff --git a/scripts/CLI_VERSION b/scripts/CLI_VERSION
index aa715a948..bee4c00f6 100644
--- a/scripts/CLI_VERSION
+++ b/scripts/CLI_VERSION
@@ -1 +1 @@
-1.33.0-alpha-apr-12-2023
+1.33.0-beta-1682447195000