diff --git a/README.md b/README.md index af58b7c9..7141dbd7 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 131.0.6778.33 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 132.0.6834.57 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 18.2 | ✅ | ✅ | ✅ | -| Firefox 132.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 134.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/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 2860249f..3b32211e 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Browser.java +++ b/playwright/src/main/java/com/microsoft/playwright/Browser.java @@ -1225,10 +1225,10 @@ public interface Browser extends AutoCloseable { *
In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the * browser server. * - *
NOTE: This is similar to force quitting the browser. Therefore, you should call {@link - * com.microsoft.playwright.BrowserContext#close BrowserContext.close()} on any {@code BrowserContext}'s you explicitly - * created earlier with {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} **before** calling {@link - * com.microsoft.playwright.Browser#close Browser.close()}. + *
NOTE: This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close events, call + * {@link com.microsoft.playwright.BrowserContext#close BrowserContext.close()} on any {@code BrowserContext} instances you + * explicitly created earlier using {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} **before** + * calling {@link com.microsoft.playwright.Browser#close Browser.close()}. * *
The {@code Browser} object itself is considered to be disposed and cannot be used anymore. * @@ -1244,10 +1244,10 @@ public interface Browser extends AutoCloseable { *
In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the * browser server. * - *
NOTE: This is similar to force quitting the browser. Therefore, you should call {@link - * com.microsoft.playwright.BrowserContext#close BrowserContext.close()} on any {@code BrowserContext}'s you explicitly - * created earlier with {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} **before** calling {@link - * com.microsoft.playwright.Browser#close Browser.close()}. + *
NOTE: This is similar to force-quitting the browser. To close pages gracefully and ensure you receive page close events, call + * {@link com.microsoft.playwright.BrowserContext#close BrowserContext.close()} on any {@code BrowserContext} instances you + * explicitly created earlier using {@link com.microsoft.playwright.Browser#newContext Browser.newContext()} **before** + * calling {@link com.microsoft.playwright.Browser#close Browser.close()}. * *
The {@code Browser} object itself is considered to be disposed and cannot be used anymore. * diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java index b0e7c9c9..d0ef2719 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java @@ -834,10 +834,14 @@ public interface BrowserContext extends AutoCloseable { * Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if * specified. * - * @param permissions A permission or an array of permissions to grant. Permissions can be one of the following values: + * @param permissions A list of permissions to grant. + * + *
NOTE: Supported permissions differ between browsers, and even between different versions of the same browser. Any permission + * may stop working after an update. + * + *
Here are some permissions that may be supported by some browsers: *
NOTE: Supported permissions differ between browsers, and even between different versions of the same browser. Any permission + * may stop working after an update. + * + *
Here are some permissions that may be supported by some browsers: *
Use "chromium" to opt in to new headless + * mode. + * + *
Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to + * use branded Google Chrome and + * Microsoft Edge. */ public Object channel; /** @@ -265,18 +270,28 @@ public interface BrowserType { } @Deprecated /** - * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", - * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. + * Browser distribution channel. + * + *
Use "chromium" to opt in to new headless + * mode. + * + *
Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to + * use branded Google Chrome and + * Microsoft Edge. */ public LaunchOptions setChannel(BrowserChannel channel) { this.channel = channel; return this; } /** - * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", - * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. + * Browser distribution channel. + * + *
Use "chromium" to opt in to new headless + * mode. + * + *
Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to + * use branded Google Chrome and + * Microsoft Edge. */ public LaunchOptions setChannel(String channel) { this.channel = channel; @@ -446,9 +461,14 @@ public interface BrowserType { */ public Boolean bypassCSP; /** - * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", - * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. + * Browser distribution channel. + * + *
Use "chromium" to opt in to new headless + * mode. + * + *
Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to + * use branded Google Chrome and + * Microsoft Edge. */ public Object channel; /** @@ -734,18 +754,28 @@ public interface BrowserType { } @Deprecated /** - * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", - * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. + * Browser distribution channel. + * + *
Use "chromium" to opt in to new headless + * mode. + * + *
Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to + * use branded Google Chrome and + * Microsoft Edge. */ public LaunchPersistentContextOptions setChannel(BrowserChannel channel) { this.channel = channel; return this; } /** - * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", - * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. + * Browser distribution channel. + * + *
Use "chromium" to opt in to new headless + * mode. + * + *
Use "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", "msedge-beta", "msedge-dev", or "msedge-canary" to + * use branded Google Chrome and + * Microsoft Edge. */ public LaunchPersistentContextOptions setChannel(String channel) { this.channel = channel; diff --git a/playwright/src/main/java/com/microsoft/playwright/Clock.java b/playwright/src/main/java/com/microsoft/playwright/Clock.java index 52c64d34..bab0a7f6 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Clock.java +++ b/playwright/src/main/java/com/microsoft/playwright/Clock.java @@ -174,6 +174,19 @@ public interface Clock { * page.clock().pauseAt("2020-02-02"); * } * + *
For best results, install the clock before navigating the page and set it to a time slightly before the intended test + * time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the + * page has fully loaded, you can safely use {@link com.microsoft.playwright.Clock#pauseAt Clock.pauseAt()} to pause the + * clock. + *
{@code
+ * // Initialize clock with some time before the test time and let the page load
+ * // naturally. `Date.now` will progress as the timers fire.
+ * SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss");
+ * page.clock().install(new Clock.InstallOptions().setTime(format.parse("2024-12-10T08:00:00")));
+ * page.navigate("http://localhost:3333");
+ * page.clock().pauseAt(format.parse("2024-12-10T10:00:00"));
+ * }
+ *
* @param time Time to pause at.
* @since v1.45
*/
@@ -194,6 +207,19 @@ public interface Clock {
* page.clock().pauseAt("2020-02-02");
* }
*
+ * For best results, install the clock before navigating the page and set it to a time slightly before the intended test + * time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the + * page has fully loaded, you can safely use {@link com.microsoft.playwright.Clock#pauseAt Clock.pauseAt()} to pause the + * clock. + *
{@code
+ * // Initialize clock with some time before the test time and let the page load
+ * // naturally. `Date.now` will progress as the timers fire.
+ * SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss");
+ * page.clock().install(new Clock.InstallOptions().setTime(format.parse("2024-12-10T08:00:00")));
+ * page.navigate("http://localhost:3333");
+ * page.clock().pauseAt(format.parse("2024-12-10T10:00:00"));
+ * }
+ *
* @param time Time to pause at.
* @since v1.45
*/
@@ -214,6 +240,19 @@ public interface Clock {
* page.clock().pauseAt("2020-02-02");
* }
*
+ * For best results, install the clock before navigating the page and set it to a time slightly before the intended test + * time. This ensures that all timers run normally during page loading, preventing the page from getting stuck. Once the + * page has fully loaded, you can safely use {@link com.microsoft.playwright.Clock#pauseAt Clock.pauseAt()} to pause the + * clock. + *
{@code
+ * // Initialize clock with some time before the test time and let the page load
+ * // naturally. `Date.now` will progress as the timers fire.
+ * SimpleDateFormat format = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss");
+ * page.clock().install(new Clock.InstallOptions().setTime(format.parse("2024-12-10T08:00:00")));
+ * page.navigate("http://localhost:3333");
+ * page.clock().pauseAt(format.parse("2024-12-10T10:00:00"));
+ * }
+ *
* @param time Time to pause at.
* @since v1.45
*/
diff --git a/playwright/src/main/java/com/microsoft/playwright/Locator.java b/playwright/src/main/java/com/microsoft/playwright/Locator.java
index ad16fbf1..7173b043 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Locator.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Locator.java
@@ -2630,7 +2630,6 @@ public interface Locator {
*
* You can also specify {@code JSHandle} as the property value if you want live objects to be passed into the event: *
{@code
- * // Note you can only create DataTransfer in Chromium and Firefox
* JSHandle dataTransfer = page.evaluateHandle("() => new DataTransfer()");
* Map arg = new HashMap<>();
* arg.put("dataTransfer", dataTransfer);
@@ -2679,7 +2678,6 @@ public interface Locator {
*
* You can also specify {@code JSHandle} as the property value if you want live objects to be passed into the event:
*
{@code
- * // Note you can only create DataTransfer in Chromium and Firefox
* JSHandle dataTransfer = page.evaluateHandle("() => new DataTransfer()");
* Map arg = new HashMap<>();
* arg.put("dataTransfer", dataTransfer);
@@ -2727,7 +2725,6 @@ public interface Locator {
*
* You can also specify {@code JSHandle} as the property value if you want live objects to be passed into the event:
*
{@code
- * // Note you can only create DataTransfer in Chromium and Firefox
* JSHandle dataTransfer = page.evaluateHandle("() => new DataTransfer()");
* Map arg = new HashMap<>();
* arg.put("dataTransfer", dataTransfer);
@@ -3968,7 +3965,9 @@ public interface Locator {
*/
boolean isDisabled(IsDisabledOptions options);
/**
- * Returns whether the element is editable.
+ * Returns whether the element is editable. If the
+ * target element is not an {@code }, {@code