Skip to content

Commit e889b20

Browse files
authored
chore: roll driver to 1.41.0-alpha (#1443)
1 parent f28ca44 commit e889b20

23 files changed

+260
-56
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 -->120.0.6099.28<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
14+
| Chromium <!-- GEN:chromium-version -->121.0.6167.16<!-- 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 -->119.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
16+
| Firefox <!-- GEN:firefox-version -->120.0.1<!-- 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/BrowserContext.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,13 @@ default String storageState() {
12601260
* @since v1.12
12611261
*/
12621262
Tracing tracing();
1263+
/**
1264+
* Removes all routes created with {@link BrowserContext#route BrowserContext.route()} and {@link
1265+
* BrowserContext#routeFromHAR BrowserContext.routeFromHAR()}.
1266+
*
1267+
* @since v1.41
1268+
*/
1269+
void unrouteAll();
12631270
/**
12641271
* Removes a route created with {@link BrowserContext#route BrowserContext.route()}. When {@code handler} is not specified,
12651272
* removes all routes for the {@code url}.

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,10 @@ public ConnectOverCDPOptions setTimeout(double timeout) {
165165
}
166166
class LaunchOptions {
167167
/**
168-
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found <a
169-
* href="http://peter.sh/experiments/chromium-command-line-switches/">here</a>.
168+
* <strong>NOTE:</strong> Use custom browser args at your own risk, as some of them may break Playwright functionality.
169+
*
170+
* <p> Additional arguments to pass to the browser instance. The list of Chromium flags can be found <a
171+
* href="https://peter.sh/experiments/chromium-command-line-switches/">here</a>.
170172
*/
171173
public List<String> args;
172174
/**
@@ -253,8 +255,10 @@ class LaunchOptions {
253255
public Path tracesDir;
254256

255257
/**
256-
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found <a
257-
* href="http://peter.sh/experiments/chromium-command-line-switches/">here</a>.
258+
* <strong>NOTE:</strong> Use custom browser args at your own risk, as some of them may break Playwright functionality.
259+
*
260+
* <p> Additional arguments to pass to the browser instance. The list of Chromium flags can be found <a
261+
* href="https://peter.sh/experiments/chromium-command-line-switches/">here</a>.
258262
*/
259263
public LaunchOptions setArgs(List<String> args) {
260264
this.args = args;
@@ -416,8 +420,10 @@ class LaunchPersistentContextOptions {
416420
*/
417421
public Boolean acceptDownloads;
418422
/**
419-
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found <a
420-
* href="http://peter.sh/experiments/chromium-command-line-switches/">here</a>.
423+
* <strong>NOTE:</strong> Use custom browser args at your own risk, as some of them may break Playwright functionality.
424+
*
425+
* <p> Additional arguments to pass to the browser instance. The list of Chromium flags can be found <a
426+
* href="https://peter.sh/experiments/chromium-command-line-switches/">here</a>.
421427
*/
422428
public List<String> args;
423429
/**
@@ -675,8 +681,10 @@ public LaunchPersistentContextOptions setAcceptDownloads(boolean acceptDownloads
675681
return this;
676682
}
677683
/**
678-
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found <a
679-
* href="http://peter.sh/experiments/chromium-command-line-switches/">here</a>.
684+
* <strong>NOTE:</strong> Use custom browser args at your own risk, as some of them may break Playwright functionality.
685+
*
686+
* <p> Additional arguments to pass to the browser instance. The list of Chromium flags can be found <a
687+
* href="https://peter.sh/experiments/chromium-command-line-switches/">here</a>.
680688
*/
681689
public LaunchPersistentContextOptions setArgs(List<String> args) {
682690
this.args = args;

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,12 @@ class ScreenshotOptions {
634634
* <p> Defaults to {@code "device"}.
635635
*/
636636
public ScreenshotScale scale;
637+
/**
638+
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements
639+
* invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM
640+
* and applies to the inner frames.
641+
*/
642+
public String style;
637643
/**
638644
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
639645
* value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link
@@ -719,6 +725,15 @@ public ScreenshotOptions setScale(ScreenshotScale scale) {
719725
this.scale = scale;
720726
return this;
721727
}
728+
/**
729+
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements
730+
* invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM
731+
* and applies to the inner frames.
732+
*/
733+
public ScreenshotOptions setStyle(String style) {
734+
this.style = style;
735+
return this;
736+
}
722737
/**
723738
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
724739
* value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,8 +1470,14 @@ public IsVisibleOptions setTimeout(double timeout) {
14701470
}
14711471
class LocatorOptions {
14721472
/**
1473-
* Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
1474-
* For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1473+
* Narrows down the results of the method to those which contain elements matching this relative locator. For example,
1474+
* {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1475+
*
1476+
* <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
1477+
* document root. For example, you can find {@code content} that has {@code div} in {@code
1478+
* <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
1479+
* article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
1480+
* content}.
14751481
*
14761482
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
14771483
*/
@@ -1497,8 +1503,14 @@ class LocatorOptions {
14971503
public Object hasText;
14981504

14991505
/**
1500-
* Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
1501-
* For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1506+
* Narrows down the results of the method to those which contain elements matching this relative locator. For example,
1507+
* {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1508+
*
1509+
* <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
1510+
* document root. For example, you can find {@code content} that has {@code div} in {@code
1511+
* <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
1512+
* article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
1513+
* content}.
15021514
*
15031515
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
15041516
*/

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,14 @@ public GetByTitleOptions setExact(boolean exact) {
285285
}
286286
class LocatorOptions {
287287
/**
288-
* Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
289-
* For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
288+
* Narrows down the results of the method to those which contain elements matching this relative locator. For example,
289+
* {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
290+
*
291+
* <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
292+
* document root. For example, you can find {@code content} that has {@code div} in {@code
293+
* <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
294+
* article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
295+
* content}.
290296
*
291297
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
292298
*/
@@ -312,8 +318,14 @@ class LocatorOptions {
312318
public Object hasText;
313319

314320
/**
315-
* Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
316-
* For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
321+
* Narrows down the results of the method to those which contain elements matching this relative locator. For example,
322+
* {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
323+
*
324+
* <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
325+
* document root. For example, you can find {@code content} that has {@code div} in {@code
326+
* <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
327+
* article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
328+
* content}.
317329
*
318330
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
319331
*/

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

Lines changed: 47 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -656,8 +656,14 @@ public FillOptions setTimeout(double timeout) {
656656
}
657657
class FilterOptions {
658658
/**
659-
* Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
660-
* For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
659+
* Narrows down the results of the method to those which contain elements matching this relative locator. For example,
660+
* {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
661+
*
662+
* <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
663+
* document root. For example, you can find {@code content} that has {@code div} in {@code
664+
* <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
665+
* article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
666+
* content}.
661667
*
662668
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
663669
*/
@@ -683,8 +689,14 @@ class FilterOptions {
683689
public Object hasText;
684690

685691
/**
686-
* Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
687-
* For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
692+
* Narrows down the results of the method to those which contain elements matching this relative locator. For example,
693+
* {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
694+
*
695+
* <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
696+
* document root. For example, you can find {@code content} that has {@code div} in {@code
697+
* <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
698+
* article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
699+
* content}.
688700
*
689701
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
690702
*/
@@ -1262,8 +1274,14 @@ public IsVisibleOptions setTimeout(double timeout) {
12621274
}
12631275
class LocatorOptions {
12641276
/**
1265-
* Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
1266-
* For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1277+
* Narrows down the results of the method to those which contain elements matching this relative locator. For example,
1278+
* {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1279+
*
1280+
* <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
1281+
* document root. For example, you can find {@code content} that has {@code div} in {@code
1282+
* <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
1283+
* article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
1284+
* content}.
12671285
*
12681286
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
12691287
*/
@@ -1289,8 +1307,14 @@ class LocatorOptions {
12891307
public Object hasText;
12901308

12911309
/**
1292-
* Matches elements containing an element that matches an inner locator. Inner locator is queried against the outer one.
1293-
* For example, {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1310+
* Narrows down the results of the method to those which contain elements matching this relative locator. For example,
1311+
* {@code article} that has {@code text=Playwright} matches {@code <article><div>Playwright</div></article>}.
1312+
*
1313+
* <p> Inner locator **must be relative** to the outer locator and is queried starting with the outer locator match, not the
1314+
* document root. For example, you can find {@code content} that has {@code div} in {@code
1315+
* <article><content><div>Playwright</div></content></article>}. However, looking for {@code content} that has {@code
1316+
* article div} will fail, because the inner locator must be relative and should not use any elements outside the {@code
1317+
* content}.
12941318
*
12951319
* <p> Note that outer and inner locators must belong to the same frame. Inner locator must not contain {@code FrameLocator}s.
12961320
*/
@@ -1483,6 +1507,12 @@ class ScreenshotOptions {
14831507
* <p> Defaults to {@code "device"}.
14841508
*/
14851509
public ScreenshotScale scale;
1510+
/**
1511+
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements
1512+
* invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM
1513+
* and applies to the inner frames.
1514+
*/
1515+
public String style;
14861516
/**
14871517
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
14881518
* value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link
@@ -1568,6 +1598,15 @@ public ScreenshotOptions setScale(ScreenshotScale scale) {
15681598
this.scale = scale;
15691599
return this;
15701600
}
1601+
/**
1602+
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements
1603+
* invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM
1604+
* and applies to the inner frames.
1605+
*/
1606+
public ScreenshotOptions setStyle(String style) {
1607+
this.style = style;
1608+
return this;
1609+
}
15711610
/**
15721611
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
15731612
* value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link

0 commit comments

Comments
 (0)