Skip to content

Commit 63bb008

Browse files
authored
chore: roll driver to 1.57.0-beta-1764692940000 (#1870)
1 parent 9b3a788 commit 63bb008

File tree

26 files changed

+516
-36
lines changed

26 files changed

+516
-36
lines changed

README.md

Lines changed: 2 additions & 2 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 -->141.0.7390.37<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
13+
| Chromium <!-- GEN:chromium-version -->143.0.7499.4<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1414
| WebKit <!-- GEN:webkit-version -->26.0<!-- GEN:stop --> ||||
15-
| Firefox <!-- GEN:firefox-version -->142.0.1<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
15+
| Firefox <!-- GEN:firefox-version -->144.0.2<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1616

1717
## Documentation
1818

examples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<name>Playwright Client Examples</name>
1111
<properties>
1212
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
13-
<playwright.version>1.56.0</playwright.version>
13+
<playwright.version>1.57.0</playwright.version>
1414
</properties>
1515
<dependencies>
1616
<dependency>

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,12 @@ public interface ConsoleMessage {
7878
* @since v1.8
7979
*/
8080
String type();
81+
/**
82+
* The web worker or service worker that produced this console message, if any. Note that console messages from web workers
83+
* also have non-null {@link com.microsoft.playwright.ConsoleMessage#page ConsoleMessage.page()}.
84+
*
85+
* @since v1.57
86+
*/
87+
Worker worker();
8188
}
8289

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ public interface Download {
4848
/**
4949
* Returns a readable stream for a successful download, or throws for a failed/canceled download.
5050
*
51+
* <p> <strong>NOTE:</strong> If you don't need a readable stream, it's usually simpler to read the file from disk after the download completed. See
52+
* {@link com.microsoft.playwright.Download#path Download.path()}.
53+
*
5154
* @since v1.8
5255
*/
5356
InputStream createReadStream();

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ class ClickOptions {
170170
* element.
171171
*/
172172
public Position position;
173+
/**
174+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
175+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
176+
* location.
177+
*/
178+
public Integer steps;
173179
/**
174180
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
175181
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
@@ -244,6 +250,15 @@ public ClickOptions setPosition(Position position) {
244250
this.position = position;
245251
return this;
246252
}
253+
/**
254+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
255+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
256+
* location.
257+
*/
258+
public ClickOptions setSteps(int steps) {
259+
this.steps = steps;
260+
return this;
261+
}
247262
/**
248263
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
249264
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
@@ -293,6 +308,12 @@ class DblclickOptions {
293308
* element.
294309
*/
295310
public Position position;
311+
/**
312+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
313+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
314+
* location.
315+
*/
316+
public Integer steps;
296317
/**
297318
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
298319
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
@@ -360,6 +381,15 @@ public DblclickOptions setPosition(Position position) {
360381
this.position = position;
361382
return this;
362383
}
384+
/**
385+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
386+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
387+
* location.
388+
*/
389+
public DblclickOptions setSteps(int steps) {
390+
this.steps = steps;
391+
return this;
392+
}
363393
/**
364394
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
365395
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,11 @@ class DragAndDropOptions {
563563
* specified, some visible point of the element is used.
564564
*/
565565
public Position sourcePosition;
566+
/**
567+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between the {@code mousedown}
568+
* and {@code mouseup} of the drag. When set to 1, emits a single {@code mousemove} event at the destination location.
569+
*/
570+
public Integer steps;
566571
/**
567572
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
568573
* element, the call throws an exception.
@@ -617,6 +622,14 @@ public DragAndDropOptions setSourcePosition(Position sourcePosition) {
617622
this.sourcePosition = sourcePosition;
618623
return this;
619624
}
625+
/**
626+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between the {@code mousedown}
627+
* and {@code mouseup} of the drag. When set to 1, emits a single {@code mousemove} event at the destination location.
628+
*/
629+
public DragAndDropOptions setSteps(int steps) {
630+
this.steps = steps;
631+
return this;
632+
}
620633
/**
621634
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
622635
* element, the call throws an exception.

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,12 @@ class ClickOptions {
245245
* element.
246246
*/
247247
public Position position;
248+
/**
249+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
250+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
251+
* location.
252+
*/
253+
public Integer steps;
248254
/**
249255
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
250256
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
@@ -320,6 +326,15 @@ public ClickOptions setPosition(Position position) {
320326
this.position = position;
321327
return this;
322328
}
329+
/**
330+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
331+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
332+
* location.
333+
*/
334+
public ClickOptions setSteps(int steps) {
335+
this.steps = steps;
336+
return this;
337+
}
323338
/**
324339
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
325340
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
@@ -370,6 +385,12 @@ class DblclickOptions {
370385
* element.
371386
*/
372387
public Position position;
388+
/**
389+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
390+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
391+
* location.
392+
*/
393+
public Integer steps;
373394
/**
374395
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
375396
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
@@ -438,6 +459,15 @@ public DblclickOptions setPosition(Position position) {
438459
this.position = position;
439460
return this;
440461
}
462+
/**
463+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
464+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
465+
* location.
466+
*/
467+
public DblclickOptions setSteps(int steps) {
468+
this.steps = steps;
469+
return this;
470+
}
441471
/**
442472
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
443473
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
@@ -494,6 +524,11 @@ class DragToOptions {
494524
* specified, some visible point of the element is used.
495525
*/
496526
public Position sourcePosition;
527+
/**
528+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between the {@code mousedown}
529+
* and {@code mouseup} of the drag. When set to 1, emits a single {@code mousemove} event at the destination location.
530+
*/
531+
public Integer steps;
497532
/**
498533
* Drops on the target element at this point relative to the top-left corner of the element's padding box. If not
499534
* specified, some visible point of the element is used.
@@ -543,6 +578,14 @@ public DragToOptions setSourcePosition(Position sourcePosition) {
543578
this.sourcePosition = sourcePosition;
544579
return this;
545580
}
581+
/**
582+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between the {@code mousedown}
583+
* and {@code mouseup} of the drag. When set to 1, emits a single {@code mousemove} event at the destination location.
584+
*/
585+
public DragToOptions setSteps(int steps) {
586+
this.steps = steps;
587+
return this;
588+
}
546589
/**
547590
* Drops on the target element at this point relative to the top-left corner of the element's padding box. If not
548591
* specified, some visible point of the element is used.
@@ -2616,6 +2659,23 @@ default void dblclick() {
26162659
* @since v1.53
26172660
*/
26182661
Locator describe(String description);
2662+
/**
2663+
* Returns locator description previously set with {@link com.microsoft.playwright.Locator#describe Locator.describe()}.
2664+
* Returns {@code null} if no custom description has been set. Prefer {@code Locator.toString()} for a human-readable
2665+
* representation, as it uses the description when available.
2666+
*
2667+
* <p> <strong>Usage</strong>
2668+
* <pre>{@code
2669+
* Locator button = page.getByRole(AriaRole.BUTTON).describe("Subscribe button");
2670+
* System.out.println(button.description()); // "Subscribe button"
2671+
*
2672+
* Locator input = page.getByRole(AriaRole.TEXTBOX);
2673+
* System.out.println(input.description()); // null
2674+
* }</pre>
2675+
*
2676+
* @since v1.57
2677+
*/
2678+
String description();
26192679
/**
26202680
* Programmatically dispatch an event on the matching element.
26212681
*

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,16 @@ public DownOptions setClickCount(int clickCount) {
127127
}
128128
class MoveOptions {
129129
/**
130-
* Defaults to 1. Sends intermediate {@code mousemove} events.
130+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
131+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
132+
* location.
131133
*/
132134
public Integer steps;
133135

134136
/**
135-
* Defaults to 1. Sends intermediate {@code mousemove} events.
137+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between Playwright's current
138+
* cursor position and the provided destination. When set to 1, emits a single {@code mousemove} event at the destination
139+
* location.
136140
*/
137141
public MoveOptions setSteps(int steps) {
138142
this.steps = steps;

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -860,6 +860,11 @@ class DragAndDropOptions {
860860
* specified, some visible point of the element is used.
861861
*/
862862
public Position sourcePosition;
863+
/**
864+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between the {@code mousedown}
865+
* and {@code mouseup} of the drag. When set to 1, emits a single {@code mousemove} event at the destination location.
866+
*/
867+
public Integer steps;
863868
/**
864869
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
865870
* element, the call throws an exception.
@@ -914,6 +919,14 @@ public DragAndDropOptions setSourcePosition(Position sourcePosition) {
914919
this.sourcePosition = sourcePosition;
915920
return this;
916921
}
922+
/**
923+
* Defaults to 1. Sends {@code n} interpolated {@code mousemove} events to represent travel between the {@code mousedown}
924+
* and {@code mouseup} of the drag. When set to 1, emits a single {@code mousemove} event at the destination location.
925+
*/
926+
public DragAndDropOptions setSteps(int steps) {
927+
this.steps = steps;
928+
return this;
929+
}
917930
/**
918931
* When true, the call requires selector to resolve to a single element. If given selector resolves to more than one
919932
* element, the call throws an exception.

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.microsoft.playwright;
1818

1919
import java.util.function.Consumer;
20+
import java.util.function.Predicate;
2021

2122
/**
2223
* The Worker class represents a <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API">WebWorker</a>.
@@ -44,6 +45,16 @@ public interface Worker {
4445
*/
4546
void offClose(Consumer<Worker> handler);
4647

48+
/**
49+
* Emitted when JavaScript within the worker calls one of console API methods, e.g. {@code console.log} or {@code
50+
* console.dir}.
51+
*/
52+
void onConsole(Consumer<ConsoleMessage> handler);
53+
/**
54+
* Removes handler that was previously added with {@link #onConsole onConsole(handler)}.
55+
*/
56+
void offConsole(Consumer<ConsoleMessage> handler);
57+
4758
class WaitForCloseOptions {
4859
/**
4960
* Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The
@@ -62,6 +73,35 @@ public WaitForCloseOptions setTimeout(double timeout) {
6273
return this;
6374
}
6475
}
76+
class WaitForConsoleMessageOptions {
77+
/**
78+
* Receives the {@code ConsoleMessage} object and resolves to true when the waiting should resolve.
79+
*/
80+
public Predicate<ConsoleMessage> predicate;
81+
/**
82+
* Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The
83+
* default value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
84+
* BrowserContext.setDefaultTimeout()}.
85+
*/
86+
public Double timeout;
87+
88+
/**
89+
* Receives the {@code ConsoleMessage} object and resolves to true when the waiting should resolve.
90+
*/
91+
public WaitForConsoleMessageOptions setPredicate(Predicate<ConsoleMessage> predicate) {
92+
this.predicate = predicate;
93+
return this;
94+
}
95+
/**
96+
* Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The
97+
* default value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
98+
* BrowserContext.setDefaultTimeout()}.
99+
*/
100+
public WaitForConsoleMessageOptions setTimeout(double timeout) {
101+
this.timeout = timeout;
102+
return this;
103+
}
104+
}
65105
/**
66106
* Returns the return value of {@code expression}.
67107
*
@@ -158,5 +198,21 @@ default Worker waitForClose(Runnable callback) {
158198
* @since v1.10
159199
*/
160200
Worker waitForClose(WaitForCloseOptions options, Runnable callback);
201+
/**
202+
* Performs action and waits for a console message.
203+
*
204+
* @param callback Callback that performs the action triggering the event.
205+
* @since v1.57
206+
*/
207+
default ConsoleMessage waitForConsoleMessage(Runnable callback) {
208+
return waitForConsoleMessage(null, callback);
209+
}
210+
/**
211+
* Performs action and waits for a console message.
212+
*
213+
* @param callback Callback that performs the action triggering the event.
214+
* @since v1.57
215+
*/
216+
ConsoleMessage waitForConsoleMessage(WaitForConsoleMessageOptions options, Runnable callback);
161217
}
162218

0 commit comments

Comments
 (0)