From cf08bf6cc67def0bcbe41a8f39483040549b4c85 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 16 Jan 2025 14:24:44 -0800 Subject: [PATCH 1/4] feat: roll driver to 1.50 alpha Reference: https://github.com/microsoft/playwright-java/issues/1696 --- .../com/microsoft/playwright/Browser.java | 16 +- .../microsoft/playwright/BrowserContext.java | 18 +- .../com/microsoft/playwright/BrowserType.java | 66 +++-- .../java/com/microsoft/playwright/Clock.java | 39 +++ .../com/microsoft/playwright/Locator.java | 21 +- .../java/com/microsoft/playwright/Page.java | 6 +- .../com/microsoft/playwright/Tracing.java | 8 +- .../assertions/LocatorAssertions.java | 230 +++++++++++++++--- .../impl/LocatorAssertionsImpl.java | 56 ++++- .../playwright/impl/RequestImpl.java | 1 + .../playwright/impl/ResponseImpl.java | 1 + .../playwright/TestLocatorAssertions.java | 9 +- .../playwright/TestLocatorAssertions2.java | 82 ++++++- .../com/microsoft/playwright/TestPdf.java | 3 - .../com/microsoft/playwright/TestTracing.java | 21 ++ scripts/DRIVER_VERSION | 2 +- 16 files changed, 476 insertions(+), 103 deletions(-) diff --git a/playwright/src/main/java/com/microsoft/playwright/Browser.java b/playwright/src/main/java/com/microsoft/playwright/Browser.java index 2860249fd..3b32211ed 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 StartTracingOptions setScreenshots(boolean screenshots) { *

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 @@ default void close() { *

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 b0e7c9c9b..d0ef27190 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 @@ default void exposeBinding(String name, BindingCallback callback) { * 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: *