Skip to content

Commit 45591df

Browse files
authored
feat: roll driver to Apr 12, implement new APIs (#1264)
1 parent 804c577 commit 45591df

File tree

19 files changed

+536
-68
lines changed

19 files changed

+536
-68
lines changed

README.md

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

1212
| | Linux | macOS | Windows |
1313
| :--- | :---: | :---: | :---: |
14-
| Chromium <!-- GEN:chromium-version -->112.0.5615.29<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
14+
| Chromium <!-- GEN:chromium-version -->113.0.5672.24<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1515
| WebKit <!-- GEN:webkit-version -->16.4<!-- GEN:stop --> ||||
1616
| Firefox <!-- GEN:firefox-version -->111.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1717

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ class NewContextOptions {
4646
*/
4747
public Map<String, String> extraHTTPHeaders;
4848
/**
49-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
49+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
50+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
5051
*/
5152
public HttpCredentials httpCredentials;
5253
/**
@@ -106,13 +107,15 @@ public NewContextOptions setExtraHTTPHeaders(Map<String, String> extraHTTPHeader
106107
return this;
107108
}
108109
/**
109-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
110+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
111+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
110112
*/
111113
public NewContextOptions setHttpCredentials(String username, String password) {
112114
return setHttpCredentials(new HttpCredentials(username, password));
113115
}
114116
/**
115-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
117+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
118+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
116119
*/
117120
public NewContextOptions setHttpCredentials(HttpCredentials httpCredentials) {
118121
this.httpCredentials = httpCredentials;

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ class NewContextOptions {
107107
*/
108108
public Boolean hasTouch;
109109
/**
110-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
110+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
111+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
111112
*/
112113
public HttpCredentials httpCredentials;
113114
/**
@@ -315,13 +316,15 @@ public NewContextOptions setHasTouch(boolean hasTouch) {
315316
return this;
316317
}
317318
/**
318-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
319+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
320+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
319321
*/
320322
public NewContextOptions setHttpCredentials(String username, String password) {
321323
return setHttpCredentials(new HttpCredentials(username, password));
322324
}
323325
/**
324-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
326+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
327+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
325328
*/
326329
public NewContextOptions setHttpCredentials(HttpCredentials httpCredentials) {
327330
this.httpCredentials = httpCredentials;
@@ -611,7 +614,8 @@ class NewPageOptions {
611614
*/
612615
public Boolean hasTouch;
613616
/**
614-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
617+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
618+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
615619
*/
616620
public HttpCredentials httpCredentials;
617621
/**
@@ -819,13 +823,15 @@ public NewPageOptions setHasTouch(boolean hasTouch) {
819823
return this;
820824
}
821825
/**
822-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
826+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
827+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
823828
*/
824829
public NewPageOptions setHttpCredentials(String username, String password) {
825830
return setHttpCredentials(new HttpCredentials(username, password));
826831
}
827832
/**
828-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
833+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
834+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
829835
*/
830836
public NewPageOptions setHttpCredentials(HttpCredentials httpCredentials) {
831837
this.httpCredentials = httpCredentials;

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ class LaunchPersistentContextOptions {
473473
*/
474474
public Boolean headless;
475475
/**
476-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
476+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
477+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
477478
*/
478479
public HttpCredentials httpCredentials;
479480
/**
@@ -787,13 +788,15 @@ public LaunchPersistentContextOptions setHeadless(boolean headless) {
787788
return this;
788789
}
789790
/**
790-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
791+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
792+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
791793
*/
792794
public LaunchPersistentContextOptions setHttpCredentials(String username, String password) {
793795
return setHttpCredentials(new HttpCredentials(username, password));
794796
}
795797
/**
796-
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>.
798+
* Credentials for <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication">HTTP authentication</a>. If
799+
* no origin is specified, the username and password are sent to any servers upon unauthorized responses.
797800
*/
798801
public LaunchPersistentContextOptions setHttpCredentials(HttpCredentials httpCredentials) {
799802
this.httpCredentials = httpCredentials;

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

Lines changed: 60 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,8 +1046,8 @@ class NavigateOptions {
10461046
* <ul>
10471047
* <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
10481048
* <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
1049-
* <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
1050-
* ms.</li>
1049+
* <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
1050+
* least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead.</li>
10511051
* <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
10521052
* </ul>
10531053
*/
@@ -1076,8 +1076,8 @@ public NavigateOptions setTimeout(double timeout) {
10761076
* <ul>
10771077
* <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
10781078
* <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
1079-
* <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
1080-
* ms.</li>
1079+
* <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
1080+
* least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead.</li>
10811081
* <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
10821082
* </ul>
10831083
*/
@@ -1476,6 +1476,19 @@ class LocatorOptions {
14761476
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
14771477
*/
14781478
public Locator has;
1479+
/**
1480+
* Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the
1481+
* outer one. For example, {@code article} that does not have {@code div} matches {@code
1482+
* <article><span>Playwright</span></article>}.
1483+
*
1484+
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
1485+
*/
1486+
public Locator hasNot;
1487+
/**
1488+
* Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When
1489+
* passed a [string], matching is case-insensitive and searches for a substring.
1490+
*/
1491+
public Object hasNotText;
14791492
/**
14801493
* Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a
14811494
* [string], matching is case-insensitive and searches for a substring. For example, {@code "Playwright"} matches {@code
@@ -1493,6 +1506,33 @@ public LocatorOptions setHas(Locator has) {
14931506
this.has = has;
14941507
return this;
14951508
}
1509+
/**
1510+
* Matches elements that do not contain an element that matches an inner locator. Inner locator is queried against the
1511+
* outer one. For example, {@code article} that does not have {@code div} matches {@code
1512+
* <article><span>Playwright</span></article>}.
1513+
*
1514+
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
1515+
*/
1516+
public LocatorOptions setHasNot(Locator hasNot) {
1517+
this.hasNot = hasNot;
1518+
return this;
1519+
}
1520+
/**
1521+
* Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When
1522+
* passed a [string], matching is case-insensitive and searches for a substring.
1523+
*/
1524+
public LocatorOptions setHasNotText(String hasNotText) {
1525+
this.hasNotText = hasNotText;
1526+
return this;
1527+
}
1528+
/**
1529+
* Matches elements that do not contain specified text somewhere inside, possibly in a child or a descendant element. When
1530+
* passed a [string], matching is case-insensitive and searches for a substring.
1531+
*/
1532+
public LocatorOptions setHasNotText(Pattern hasNotText) {
1533+
this.hasNotText = hasNotText;
1534+
return this;
1535+
}
14961536
/**
14971537
* Matches elements containing specified text somewhere inside, possibly in a child or a descendant element. When passed a
14981538
* [string], matching is case-insensitive and searches for a substring. For example, {@code "Playwright"} matches {@code
@@ -1751,8 +1791,8 @@ class SetContentOptions {
17511791
* <ul>
17521792
* <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
17531793
* <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
1754-
* <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
1755-
* ms.</li>
1794+
* <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
1795+
* least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead.</li>
17561796
* <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
17571797
* </ul>
17581798
*/
@@ -1773,8 +1813,8 @@ public SetContentOptions setTimeout(double timeout) {
17731813
* <ul>
17741814
* <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
17751815
* <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
1776-
* <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
1777-
* ms.</li>
1816+
* <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
1817+
* least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead.</li>
17781818
* <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
17791819
* </ul>
17801820
*/
@@ -2188,8 +2228,8 @@ class WaitForNavigationOptions {
21882228
* <ul>
21892229
* <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
21902230
* <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
2191-
* <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
2192-
* ms.</li>
2231+
* <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
2232+
* least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead.</li>
21932233
* <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
21942234
* </ul>
21952235
*/
@@ -2237,8 +2277,8 @@ public WaitForNavigationOptions setUrl(Predicate<String> url) {
22372277
* <ul>
22382278
* <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
22392279
* <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
2240-
* <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
2241-
* ms.</li>
2280+
* <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
2281+
* least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead.</li>
22422282
* <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
22432283
* </ul>
22442284
*/
@@ -2318,8 +2358,8 @@ class WaitForURLOptions {
23182358
* <ul>
23192359
* <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
23202360
* <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
2321-
* <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
2322-
* ms.</li>
2361+
* <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
2362+
* least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead.</li>
23232363
* <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
23242364
* </ul>
23252365
*/
@@ -2340,8 +2380,8 @@ public WaitForURLOptions setTimeout(double timeout) {
23402380
* <ul>
23412381
* <li> {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.</li>
23422382
* <li> {@code "load"} - consider operation to be finished when the {@code load} event is fired.</li>
2343-
* <li> {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500}
2344-
* ms.</li>
2383+
* <li> {@code "networkidle"} - **DISCOURAGED** consider operation to be finished when there are no network connections for at
2384+
* least {@code 500} ms. Don't use this method for testing, rely on web assertions to assess readiness instead.</li>
23452385
* <li> {@code "commit"} - consider operation to be finished when network response is received and the document started loading.</li>
23462386
* </ul>
23472387
*/
@@ -4849,7 +4889,8 @@ default JSHandle waitForFunction(String expression) {
48494889
* <ul>
48504890
* <li> {@code "load"} - wait for the {@code load} event to be fired.</li>
48514891
* <li> {@code "domcontentloaded"} - wait for the {@code DOMContentLoaded} event to be fired.</li>
4852-
* <li> {@code "networkidle"} - wait until there are no network connections for at least {@code 500} ms.</li>
4892+
* <li> {@code "networkidle"} - **DISCOURAGED** wait until there are no network connections for at least {@code 500} ms. Don't
4893+
* use this method for testing, rely on web assertions to assess readiness instead.</li>
48534894
* </ul>
48544895
* @since v1.8
48554896
*/
@@ -4890,7 +4931,8 @@ default void waitForLoadState() {
48904931
* <ul>
48914932
* <li> {@code "load"} - wait for the {@code load} event to be fired.</li>
48924933
* <li> {@code "domcontentloaded"} - wait for the {@code DOMContentLoaded} event to be fired.</li>
4893-
* <li> {@code "networkidle"} - wait until there are no network connections for at least {@code 500} ms.</li>
4934+
* <li> {@code "networkidle"} - **DISCOURAGED** wait until there are no network connections for at least {@code 500} ms. Don't
4935+
* use this method for testing, rely on web assertions to assess readiness instead.</li>
48944936
* </ul>
48954937
* @since v1.8
48964938
*/

0 commit comments

Comments
 (0)