Skip to content

Commit daf225a

Browse files
committed
chore: roll 1.49-beta
1 parent 4bda800 commit daf225a

28 files changed

+566
-231
lines changed

README.md

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

1111
| | Linux | macOS | Windows |
1212
| :--- | :---: | :---: | :---: |
13-
| Chromium <!-- GEN:chromium-version -->130.0.6723.31<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
14-
| WebKit <!-- GEN:webkit-version -->18.0<!-- GEN:stop --> ||||
15-
| Firefox <!-- GEN:firefox-version -->131.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
13+
| Chromium <!-- GEN:chromium-version -->131.0.6778.33<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
14+
| WebKit <!-- GEN:webkit-version -->18.2<!-- GEN:stop --> ||||
15+
| Firefox <!-- GEN:firefox-version -->132.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1616

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

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

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
* import com.microsoft.playwright.*;
3030
*
3131
* public class Example {
32-
* public static void main(String[] args) {
33-
* try (Playwright playwright = Playwright.create()) {
34-
* BrowserType firefox = playwright.firefox()
35-
* Browser browser = firefox.launch();
36-
* Page page = browser.newPage();
37-
* page.navigate('https://example.com');
38-
* browser.close();
39-
* }
40-
* }
32+
* public static void main(String[] args) {
33+
* try (Playwright playwright = Playwright.create()) {
34+
* BrowserType firefox = playwright.firefox();
35+
* Browser browser = firefox.launch();
36+
* Page page = browser.newPage();
37+
* page.navigate("https://example.com");
38+
* browser.close();
39+
* }
40+
* }
4141
* }
4242
* }</pre>
4343
*/
@@ -111,9 +111,11 @@ class NewContextOptions {
111111
*/
112112
public List<ClientCertificate> clientCertificates;
113113
/**
114-
* Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
115-
* "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
116-
* {@code null} resets emulation to system defaults. Defaults to {@code "light"}.
114+
* Emulates <a
115+
* href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme">prefers-colors-scheme</a> media
116+
* feature, supported values are {@code "light"} and {@code "dark"}. See {@link com.microsoft.playwright.Page#emulateMedia
117+
* Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. Defaults to {@code
118+
* "light"}.
117119
*/
118120
public Optional<ColorScheme> colorScheme;
119121
/**
@@ -323,9 +325,11 @@ public NewContextOptions setClientCertificates(List<ClientCertificate> clientCer
323325
return this;
324326
}
325327
/**
326-
* Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
327-
* "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
328-
* {@code null} resets emulation to system defaults. Defaults to {@code "light"}.
328+
* Emulates <a
329+
* href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme">prefers-colors-scheme</a> media
330+
* feature, supported values are {@code "light"} and {@code "dark"}. See {@link com.microsoft.playwright.Page#emulateMedia
331+
* Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. Defaults to {@code
332+
* "light"}.
329333
*/
330334
public NewContextOptions setColorScheme(ColorScheme colorScheme) {
331335
this.colorScheme = Optional.ofNullable(colorScheme);
@@ -660,9 +664,11 @@ class NewPageOptions {
660664
*/
661665
public List<ClientCertificate> clientCertificates;
662666
/**
663-
* Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
664-
* "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
665-
* {@code null} resets emulation to system defaults. Defaults to {@code "light"}.
667+
* Emulates <a
668+
* href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme">prefers-colors-scheme</a> media
669+
* feature, supported values are {@code "light"} and {@code "dark"}. See {@link com.microsoft.playwright.Page#emulateMedia
670+
* Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. Defaults to {@code
671+
* "light"}.
666672
*/
667673
public Optional<ColorScheme> colorScheme;
668674
/**
@@ -872,9 +878,11 @@ public NewPageOptions setClientCertificates(List<ClientCertificate> clientCertif
872878
return this;
873879
}
874880
/**
875-
* Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
876-
* "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
877-
* {@code null} resets emulation to system defaults. Defaults to {@code "light"}.
881+
* Emulates <a
882+
* href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme">prefers-colors-scheme</a> media
883+
* feature, supported values are {@code "light"} and {@code "dark"}. See {@link com.microsoft.playwright.Page#emulateMedia
884+
* Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. Defaults to {@code
885+
* "light"}.
878886
*/
879887
public NewPageOptions setColorScheme(ColorScheme colorScheme) {
880888
this.colorScheme = Optional.ofNullable(colorScheme);
@@ -1289,7 +1297,7 @@ default void close() {
12891297
* BrowserContext context = browser.newContext();
12901298
* // Create a new page in a pristine context.
12911299
* Page page = context.newPage();
1292-
* page.navigate('https://example.com');
1300+
* page.navigate("https://example.com");
12931301
*
12941302
* // Graceful close up everything
12951303
* context.close();
@@ -1316,7 +1324,7 @@ default BrowserContext newContext() {
13161324
* BrowserContext context = browser.newContext();
13171325
* // Create a new page in a pristine context.
13181326
* Page page = context.newPage();
1319-
* page.navigate('https://example.com');
1327+
* page.navigate("https://example.com");
13201328
*
13211329
* // Graceful close up everything
13221330
* context.close();
@@ -1364,7 +1372,7 @@ default Page newPage() {
13641372
* <pre>{@code
13651373
* browser.startTracing(page, new Browser.StartTracingOptions()
13661374
* .setPath(Paths.get("trace.json")));
1367-
* page.goto('https://www.google.com');
1375+
* page.navigate("https://www.google.com");
13681376
* browser.stopTracing();
13691377
* }</pre>
13701378
*
@@ -1388,7 +1396,7 @@ default void startTracing(Page page) {
13881396
* <pre>{@code
13891397
* browser.startTracing(page, new Browser.StartTracingOptions()
13901398
* .setPath(Paths.get("trace.json")));
1391-
* page.goto('https://www.google.com');
1399+
* page.navigate("https://www.google.com");
13921400
* browser.stopTracing();
13931401
* }</pre>
13941402
*
@@ -1411,7 +1419,7 @@ default void startTracing() {
14111419
* <pre>{@code
14121420
* browser.startTracing(page, new Browser.StartTracingOptions()
14131421
* .setPath(Paths.get("trace.json")));
1414-
* page.goto('https://www.google.com');
1422+
* page.navigate("https://www.google.com");
14151423
* browser.stopTracing();
14161424
* }</pre>
14171425
*

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ default List<Cookie> cookies() {
701701
* public class Example {
702702
* public static void main(String[] args) {
703703
* try (Playwright playwright = Playwright.create()) {
704-
* BrowserType webkit = playwright.webkit()
704+
* BrowserType webkit = playwright.webkit();
705705
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));
706706
* BrowserContext context = browser.newContext();
707707
* context.exposeBinding("pageURL", (source, args) -> source.page().url());
@@ -748,7 +748,7 @@ default void exposeBinding(String name, BindingCallback callback) {
748748
* public class Example {
749749
* public static void main(String[] args) {
750750
* try (Playwright playwright = Playwright.create()) {
751-
* BrowserType webkit = playwright.webkit()
751+
* BrowserType webkit = playwright.webkit();
752752
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));
753753
* BrowserContext context = browser.newContext();
754754
* context.exposeBinding("pageURL", (source, args) -> source.page().url());
@@ -797,8 +797,9 @@ default void exposeBinding(String name, BindingCallback callback) {
797797
* public class Example {
798798
* public static void main(String[] args) {
799799
* try (Playwright playwright = Playwright.create()) {
800-
* BrowserType webkit = playwright.webkit()
800+
* BrowserType webkit = playwright.webkit();
801801
* Browser browser = webkit.launch(new BrowserType.LaunchOptions().setHeadless(false));
802+
* BrowserContext context = browser.newContext();
802803
* context.exposeFunction("sha256", args -> {
803804
* String text = (String) args[0];
804805
* MessageDigest crypto;

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,11 @@ class LaunchPersistentContextOptions {
470470
*/
471471
public List<ClientCertificate> clientCertificates;
472472
/**
473-
* Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
474-
* "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
475-
* {@code null} resets emulation to system defaults. Defaults to {@code "light"}.
473+
* Emulates <a
474+
* href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme">prefers-colors-scheme</a> media
475+
* feature, supported values are {@code "light"} and {@code "dark"}. See {@link com.microsoft.playwright.Page#emulateMedia
476+
* Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. Defaults to {@code
477+
* "light"}.
476478
*/
477479
public Optional<ColorScheme> colorScheme;
478480
/**
@@ -774,9 +776,11 @@ public LaunchPersistentContextOptions setClientCertificates(List<ClientCertifica
774776
return this;
775777
}
776778
/**
777-
* Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code
778-
* "no-preference"}. See {@link com.microsoft.playwright.Page#emulateMedia Page.emulateMedia()} for more details. Passing
779-
* {@code null} resets emulation to system defaults. Defaults to {@code "light"}.
779+
* Emulates <a
780+
* href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme">prefers-colors-scheme</a> media
781+
* feature, supported values are {@code "light"} and {@code "dark"}. See {@link com.microsoft.playwright.Page#emulateMedia
782+
* Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. Defaults to {@code
783+
* "light"}.
780784
*/
781785
public LaunchPersistentContextOptions setColorScheme(ColorScheme colorScheme) {
782786
this.colorScheme = Optional.ofNullable(colorScheme);

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ default void install() {
227227
/**
228228
* Makes {@code Date.now} and {@code new Date()} return fixed fake time at all times, keeps all the timers running.
229229
*
230+
* <p> Use this method for simple scenarios where you only need to test with a predefined time. For more advanced scenarios,
231+
* use {@link com.microsoft.playwright.Clock#install Clock.install()} instead. Read docs on <a
232+
* href="https://playwright.dev/java/docs/clock">clock emulation</a> to learn more.
233+
*
230234
* <p> <strong>Usage</strong>
231235
* <pre>{@code
232236
* page.clock().setFixedTime(new Date());
@@ -241,6 +245,10 @@ default void install() {
241245
/**
242246
* Makes {@code Date.now} and {@code new Date()} return fixed fake time at all times, keeps all the timers running.
243247
*
248+
* <p> Use this method for simple scenarios where you only need to test with a predefined time. For more advanced scenarios,
249+
* use {@link com.microsoft.playwright.Clock#install Clock.install()} instead. Read docs on <a
250+
* href="https://playwright.dev/java/docs/clock">clock emulation</a> to learn more.
251+
*
244252
* <p> <strong>Usage</strong>
245253
* <pre>{@code
246254
* page.clock().setFixedTime(new Date());
@@ -255,6 +263,10 @@ default void install() {
255263
/**
256264
* Makes {@code Date.now} and {@code new Date()} return fixed fake time at all times, keeps all the timers running.
257265
*
266+
* <p> Use this method for simple scenarios where you only need to test with a predefined time. For more advanced scenarios,
267+
* use {@link com.microsoft.playwright.Clock#install Clock.install()} instead. Read docs on <a
268+
* href="https://playwright.dev/java/docs/clock">clock emulation</a> to learn more.
269+
*
258270
* <p> <strong>Usage</strong>
259271
* <pre>{@code
260272
* page.clock().setFixedTime(new Date());
@@ -267,7 +279,8 @@ default void install() {
267279
*/
268280
void setFixedTime(Date time);
269281
/**
270-
* Sets current system time but does not trigger any timers.
282+
* Sets system time, but does not trigger any timers. Use this to test how the web page reacts to a time shift, for example
283+
* switching from summer to winter time, or changing time zones.
271284
*
272285
* <p> <strong>Usage</strong>
273286
* <pre>{@code
@@ -281,7 +294,8 @@ default void install() {
281294
*/
282295
void setSystemTime(long time);
283296
/**
284-
* Sets current system time but does not trigger any timers.
297+
* Sets system time, but does not trigger any timers. Use this to test how the web page reacts to a time shift, for example
298+
* switching from summer to winter time, or changing time zones.
285299
*
286300
* <p> <strong>Usage</strong>
287301
* <pre>{@code
@@ -295,7 +309,8 @@ default void install() {
295309
*/
296310
void setSystemTime(String time);
297311
/**
298-
* Sets current system time but does not trigger any timers.
312+
* Sets system time, but does not trigger any timers. Use this to test how the web page reacts to a time shift, for example
313+
* switching from summer to winter time, or changing time zones.
299314
*
300315
* <p> <strong>Usage</strong>
301316
* <pre>{@code

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
* });
4040
*
4141
* // Deconstruct console.log arguments
42-
* msg.args().get(0).jsonValue() // hello
43-
* msg.args().get(1).jsonValue() // 42
42+
* msg.args().get(0).jsonValue(); // hello
43+
* msg.args().get(1).jsonValue(); // 42
4444
* }</pre>
4545
*/
4646
public interface ConsoleMessage {

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

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,19 +3499,19 @@ default Locator getByRole(AriaRole role) {
34993499
* <p> You can locate by text substring, exact string, or a regular expression:
35003500
* <pre>{@code
35013501
* // Matches <span>
3502-
* page.getByText("world")
3502+
* page.getByText("world");
35033503
*
35043504
* // Matches first <div>
3505-
* page.getByText("Hello world")
3505+
* page.getByText("Hello world");
35063506
*
35073507
* // Matches second <div>
3508-
* page.getByText("Hello", new Page.GetByTextOptions().setExact(true))
3508+
* page.getByText("Hello", new Page.GetByTextOptions().setExact(true));
35093509
*
35103510
* // Matches both <div>s
3511-
* page.getByText(Pattern.compile("Hello"))
3511+
* page.getByText(Pattern.compile("Hello"));
35123512
*
35133513
* // Matches second <div>
3514-
* page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE))
3514+
* page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE));
35153515
* }</pre>
35163516
*
35173517
* <p> <strong>Details</strong>
@@ -3541,19 +3541,19 @@ default Locator getByText(String text) {
35413541
* <p> You can locate by text substring, exact string, or a regular expression:
35423542
* <pre>{@code
35433543
* // Matches <span>
3544-
* page.getByText("world")
3544+
* page.getByText("world");
35453545
*
35463546
* // Matches first <div>
3547-
* page.getByText("Hello world")
3547+
* page.getByText("Hello world");
35483548
*
35493549
* // Matches second <div>
3550-
* page.getByText("Hello", new Page.GetByTextOptions().setExact(true))
3550+
* page.getByText("Hello", new Page.GetByTextOptions().setExact(true));
35513551
*
35523552
* // Matches both <div>s
3553-
* page.getByText(Pattern.compile("Hello"))
3553+
* page.getByText(Pattern.compile("Hello"));
35543554
*
35553555
* // Matches second <div>
3556-
* page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE))
3556+
* page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE));
35573557
* }</pre>
35583558
*
35593559
* <p> <strong>Details</strong>
@@ -3581,19 +3581,19 @@ default Locator getByText(String text) {
35813581
* <p> You can locate by text substring, exact string, or a regular expression:
35823582
* <pre>{@code
35833583
* // Matches <span>
3584-
* page.getByText("world")
3584+
* page.getByText("world");
35853585
*
35863586
* // Matches first <div>
3587-
* page.getByText("Hello world")
3587+
* page.getByText("Hello world");
35883588
*
35893589
* // Matches second <div>
3590-
* page.getByText("Hello", new Page.GetByTextOptions().setExact(true))
3590+
* page.getByText("Hello", new Page.GetByTextOptions().setExact(true));
35913591
*
35923592
* // Matches both <div>s
3593-
* page.getByText(Pattern.compile("Hello"))
3593+
* page.getByText(Pattern.compile("Hello"));
35943594
*
35953595
* // Matches second <div>
3596-
* page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE))
3596+
* page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE));
35973597
* }</pre>
35983598
*
35993599
* <p> <strong>Details</strong>
@@ -3623,19 +3623,19 @@ default Locator getByText(Pattern text) {
36233623
* <p> You can locate by text substring, exact string, or a regular expression:
36243624
* <pre>{@code
36253625
* // Matches <span>
3626-
* page.getByText("world")
3626+
* page.getByText("world");
36273627
*
36283628
* // Matches first <div>
3629-
* page.getByText("Hello world")
3629+
* page.getByText("Hello world");
36303630
*
36313631
* // Matches second <div>
3632-
* page.getByText("Hello", new Page.GetByTextOptions().setExact(true))
3632+
* page.getByText("Hello", new Page.GetByTextOptions().setExact(true));
36333633
*
36343634
* // Matches both <div>s
3635-
* page.getByText(Pattern.compile("Hello"))
3635+
* page.getByText(Pattern.compile("Hello"));
36363636
*
36373637
* // Matches second <div>
3638-
* page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE))
3638+
* page.getByText(Pattern.compile("^hello$", Pattern.CASE_INSENSITIVE));
36393639
* }</pre>
36403640
*
36413641
* <p> <strong>Details</strong>

0 commit comments

Comments
 (0)