Skip to content

Commit 4cc3fa3

Browse files
authored
chore: roll driver to 1.45.0 beta, implement new features (#1600)
1 parent 226d075 commit 4cc3fa3

34 files changed

+1489
-122
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom
1111

1212
| | Linux | macOS | Windows |
1313
| :--- | :---: | :---: | :---: |
14-
| Chromium <!-- GEN:chromium-version -->125.0.6422.26<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
14+
| Chromium <!-- GEN:chromium-version -->127.0.6533.5<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1515
| WebKit <!-- GEN:webkit-version -->17.4<!-- GEN:stop --> ||||
16-
| Firefox <!-- GEN:firefox-version -->125.0.1<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
16+
| Firefox <!-- GEN:firefox-version -->127.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1717

1818
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.
1919

playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@
4343
* object will have its own isolated cookie storage.
4444
*/
4545
public interface APIRequestContext {
46+
class DisposeOptions {
47+
/**
48+
* The reason to be reported to the operations interrupted by the context disposal.
49+
*/
50+
public String reason;
51+
52+
/**
53+
* The reason to be reported to the operations interrupted by the context disposal.
54+
*/
55+
public DisposeOptions setReason(String reason) {
56+
this.reason = reason;
57+
return this;
58+
}
59+
}
4660
class StorageStateOptions {
4761
/**
4862
* The file path to save the storage state to. If {@code path} is a relative path, then it is resolved relative to current
@@ -88,7 +102,18 @@ default APIResponse delete(String url) {
88102
*
89103
* @since v1.16
90104
*/
91-
void dispose();
105+
default void dispose() {
106+
dispose(null);
107+
}
108+
/**
109+
* All responses returned by {@link com.microsoft.playwright.APIRequestContext#get APIRequestContext.get()} and similar
110+
* methods are stored in the memory, so that you can later call {@link com.microsoft.playwright.APIResponse#body
111+
* APIResponse.body()}.This method discards all its resources, calling any method on disposed {@code APIRequestContext}
112+
* will throw an exception.
113+
*
114+
* @since v1.16
115+
*/
116+
void dispose(DisposeOptions options);
92117
/**
93118
* Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update
94119
* context cookies from the response. The method will automatically follow redirects.

playwright/src/main/java/com/microsoft/playwright/BrowserContext.java

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,12 @@ public WaitForPageOptions setTimeout(double timeout) {
501501
return this;
502502
}
503503
}
504+
/**
505+
* Playwright has ability to mock clock and passage of time.
506+
*
507+
* @since v1.45
508+
*/
509+
Clock clock();
504510
/**
505511
* Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies can be
506512
* obtained via {@link com.microsoft.playwright.BrowserContext#cookies BrowserContext.cookies()}.
@@ -863,21 +869,22 @@ default void exposeBinding(String name, BindingCallback callback) {
863869
*
864870
* @param permissions A permission or an array of permissions to grant. Permissions can be one of the following values:
865871
* <ul>
866-
* <li> {@code "geolocation"}</li>
867-
* <li> {@code "midi"}</li>
868-
* <li> {@code "midi-sysex"} (system-exclusive midi)</li>
869-
* <li> {@code "notifications"}</li>
870-
* <li> {@code "camera"}</li>
871-
* <li> {@code "microphone"}</li>
872-
* <li> {@code "background-sync"}</li>
873-
* <li> {@code "ambient-light-sensor"}</li>
874872
* <li> {@code "accelerometer"}</li>
875-
* <li> {@code "gyroscope"}</li>
876-
* <li> {@code "magnetometer"}</li>
877873
* <li> {@code "accessibility-events"}</li>
874+
* <li> {@code "ambient-light-sensor"}</li>
875+
* <li> {@code "background-sync"}</li>
876+
* <li> {@code "camera"}</li>
878877
* <li> {@code "clipboard-read"}</li>
879878
* <li> {@code "clipboard-write"}</li>
879+
* <li> {@code "geolocation"}</li>
880+
* <li> {@code "gyroscope"}</li>
881+
* <li> {@code "magnetometer"}</li>
882+
* <li> {@code "microphone"}</li>
883+
* <li> {@code "midi-sysex"} (system-exclusive midi)</li>
884+
* <li> {@code "midi"}</li>
885+
* <li> {@code "notifications"}</li>
880886
* <li> {@code "payment-handler"}</li>
887+
* <li> {@code "storage-access"}</li>
881888
* </ul>
882889
* @since v1.8
883890
*/
@@ -890,21 +897,22 @@ default void grantPermissions(List<String> permissions) {
890897
*
891898
* @param permissions A permission or an array of permissions to grant. Permissions can be one of the following values:
892899
* <ul>
893-
* <li> {@code "geolocation"}</li>
894-
* <li> {@code "midi"}</li>
895-
* <li> {@code "midi-sysex"} (system-exclusive midi)</li>
896-
* <li> {@code "notifications"}</li>
897-
* <li> {@code "camera"}</li>
898-
* <li> {@code "microphone"}</li>
899-
* <li> {@code "background-sync"}</li>
900-
* <li> {@code "ambient-light-sensor"}</li>
901900
* <li> {@code "accelerometer"}</li>
902-
* <li> {@code "gyroscope"}</li>
903-
* <li> {@code "magnetometer"}</li>
904901
* <li> {@code "accessibility-events"}</li>
902+
* <li> {@code "ambient-light-sensor"}</li>
903+
* <li> {@code "background-sync"}</li>
904+
* <li> {@code "camera"}</li>
905905
* <li> {@code "clipboard-read"}</li>
906906
* <li> {@code "clipboard-write"}</li>
907+
* <li> {@code "geolocation"}</li>
908+
* <li> {@code "gyroscope"}</li>
909+
* <li> {@code "magnetometer"}</li>
910+
* <li> {@code "microphone"}</li>
911+
* <li> {@code "midi-sysex"} (system-exclusive midi)</li>
912+
* <li> {@code "midi"}</li>
913+
* <li> {@code "notifications"}</li>
907914
* <li> {@code "payment-handler"}</li>
915+
* <li> {@code "storage-access"}</li>
908916
* </ul>
909917
* @since v1.8
910918
*/

0 commit comments

Comments
 (0)