Skip to content

Commit 5394b5d

Browse files
authored
chore: roll driver 1.38.0-alpha-sep-10-2023 (#1380)
1 parent 8834877 commit 5394b5d

File tree

11 files changed

+68
-50
lines changed

11 files changed

+68
-50
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 -->117.0.5938.35<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
14+
| Chromium <!-- GEN:chromium-version -->117.0.5938.48<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
1515
| WebKit <!-- GEN:webkit-version -->17.0<!-- GEN:stop --> ||||
16-
| Firefox <!-- GEN:firefox-version -->115.0<!-- GEN:stop --> | :white_check_mark: | :white_check_mark: | :white_check_mark: |
16+
| Firefox <!-- GEN:firefox-version -->117.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/next/intro/#system-requirements) for details.
1919

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,14 @@ public interface BrowserContext extends AutoCloseable {
128128
void offPage(Consumer<Page> handler);
129129

130130
/**
131-
* Emitted when unhandled exceptions occur on any pages created through this context. To only listen for {@code pageError}
132-
* events from a particular page, use {@link Page#onPageError Page.onPageError()}.
131+
* Emitted when exception is unhandled in any of the pages in this context. To listen for errors from a particular page,
132+
* use {@link Page#onPageError Page.onPageError()} instead.
133133
*/
134-
void onPageError(Consumer<PageError> handler);
134+
void onWebError(Consumer<WebError> handler);
135135
/**
136-
* Removes handler that was previously added with {@link #onPageError onPageError(handler)}.
136+
* Removes handler that was previously added with {@link #onWebError onWebError(handler)}.
137137
*/
138-
void offPageError(Consumer<PageError> handler);
138+
void offWebError(Consumer<WebError> handler);
139139

140140
/**
141141
* Emitted when a request is issued from any pages created through this context. The [request] object is read-only. To only

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,7 @@ default Object evalOnSelectorAll(String selector, String expression) {
15821582
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be filled
15831583
* instead.
15841584
*
1585-
* <p> To send fine-grained keyboard events, use {@link Keyboard#type Keyboard.type()}.
1585+
* <p> To send fine-grained keyboard events, use {@link Locator#pressSequentially Locator.pressSequentially()}.
15861586
*
15871587
* @param value Value to set for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
15881588
* @since v1.8
@@ -1600,7 +1600,7 @@ default void fill(String value) {
16001600
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be filled
16011601
* instead.
16021602
*
1603-
* <p> To send fine-grained keyboard events, use {@link Keyboard#type Keyboard.type()}.
1603+
* <p> To send fine-grained keyboard events, use {@link Locator#pressSequentially Locator.pressSequentially()}.
16041604
*
16051605
* @param value Value to set for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
16061606
* @since v1.8
@@ -2450,8 +2450,9 @@ default void tap() {
24502450
*/
24512451
String textContent();
24522452
/**
2453-
* @deprecated Use locator-based {@link Locator#pressSequentially Locator.pressSequentially()} instead. Read more about <a
2454-
* href="https://playwright.dev/java/docs/locators">locators</a>.
2453+
* @deprecated In most cases, you should use {@link Locator#fill Locator.fill()} instead. You only need to press keys one by one if
2454+
* there is special keyboard handling on the page - in this case use {@link Locator#pressSequentially
2455+
* Locator.pressSequentially()}.
24552456
*
24562457
* @param text A text to type into a focused element.
24572458
* @since v1.8
@@ -2460,8 +2461,9 @@ default void type(String text) {
24602461
type(text, null);
24612462
}
24622463
/**
2463-
* @deprecated Use locator-based {@link Locator#pressSequentially Locator.pressSequentially()} instead. Read more about <a
2464-
* href="https://playwright.dev/java/docs/locators">locators</a>.
2464+
* @deprecated In most cases, you should use {@link Locator#fill Locator.fill()} instead. You only need to press keys one by one if
2465+
* there is special keyboard handling on the page - in this case use {@link Locator#pressSequentially
2466+
* Locator.pressSequentially()}.
24652467
*
24662468
* @param text A text to type into a focused element.
24672469
* @since v1.8

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,7 +2987,7 @@ default JSHandle evaluateHandle(String expression) {
29872987
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be filled
29882988
* instead.
29892989
*
2990-
* <p> To send fine-grained keyboard events, use {@link Frame#type Frame.type()}.
2990+
* <p> To send fine-grained keyboard events, use {@link Locator#pressSequentially Locator.pressSequentially()}.
29912991
*
29922992
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
29932993
* @param value Value to fill for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
@@ -3006,7 +3006,7 @@ default void fill(String selector, String value) {
30063006
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be filled
30073007
* instead.
30083008
*
3009-
* <p> To send fine-grained keyboard events, use {@link Frame#type Frame.type()}.
3009+
* <p> To send fine-grained keyboard events, use {@link Locator#pressSequentially Locator.pressSequentially()}.
30103010
*
30113011
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
30123012
* @param value Value to fill for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
@@ -4677,8 +4677,9 @@ default String textContent(String selector) {
46774677
*/
46784678
String title();
46794679
/**
4680-
* @deprecated Use locator-based {@link Locator#pressSequentially Locator.pressSequentially()} instead. Read more about <a
4681-
* href="https://playwright.dev/java/docs/locators">locators</a>.
4680+
* @deprecated In most cases, you should use {@link Locator#fill Locator.fill()} instead. You only need to press keys one by one if
4681+
* there is special keyboard handling on the page - in this case use {@link Locator#pressSequentially
4682+
* Locator.pressSequentially()}.
46824683
*
46834684
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
46844685
* @param text A text to type into a focused element.
@@ -4688,8 +4689,9 @@ default void type(String selector, String text) {
46884689
type(selector, text, null);
46894690
}
46904691
/**
4691-
* @deprecated Use locator-based {@link Locator#pressSequentially Locator.pressSequentially()} instead. Read more about <a
4692-
* href="https://playwright.dev/java/docs/locators">locators</a>.
4692+
* @deprecated In most cases, you should use {@link Locator#fill Locator.fill()} instead. You only need to press keys one by one if
4693+
* there is special keyboard handling on the page - in this case use {@link Locator#pressSequentially
4694+
* Locator.pressSequentially()}.
46934695
*
46944696
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
46954697
* @param text A text to type into a focused element.

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ public TypeOptions setDelay(double delay) {
132132
*/
133133
void insertText(String text);
134134
/**
135-
* {@code key} can specify the intended <a
135+
* <strong>NOTE:</strong> In most cases, you should use {@link Locator#press Locator.press()} instead.
136+
*
137+
* <p> {@code key} can specify the intended <a
136138
* href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key">keyboardEvent.key</a> value or a single
137139
* character to generate the text for. A superset of the {@code key} values can be found <a
138140
* href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values">here</a>. Examples of the keys are:
@@ -175,7 +177,9 @@ default void press(String key) {
175177
press(key, null);
176178
}
177179
/**
178-
* {@code key} can specify the intended <a
180+
* <strong>NOTE:</strong> In most cases, you should use {@link Locator#press Locator.press()} instead.
181+
*
182+
* <p> {@code key} can specify the intended <a
179183
* href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key">keyboardEvent.key</a> value or a single
180184
* character to generate the text for. A superset of the {@code key} values can be found <a
181185
* href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values">here</a>. Examples of the keys are:
@@ -216,7 +220,11 @@ default void press(String key) {
216220
*/
217221
void press(String key, PressOptions options);
218222
/**
219-
* Sends a {@code keydown}, {@code keypress}/{@code input}, and {@code keyup} event for each character in the text.
223+
* <strong>NOTE:</strong> In most cases, you should use {@link Locator#fill Locator.fill()} instead. You only need to press keys one by one if
224+
* there is special keyboard handling on the page - in this case use {@link Locator#pressSequentially
225+
* Locator.pressSequentially()}.
226+
*
227+
* <p> Sends a {@code keydown}, {@code keypress}/{@code input}, and {@code keyup} event for each character in the text.
220228
*
221229
* <p> To press a special key, like {@code Control} or {@code ArrowDown}, use {@link Keyboard#press Keyboard.press()}.
222230
*
@@ -239,7 +247,11 @@ default void type(String text) {
239247
type(text, null);
240248
}
241249
/**
242-
* Sends a {@code keydown}, {@code keypress}/{@code input}, and {@code keyup} event for each character in the text.
250+
* <strong>NOTE:</strong> In most cases, you should use {@link Locator#fill Locator.fill()} instead. You only need to press keys one by one if
251+
* there is special keyboard handling on the page - in this case use {@link Locator#pressSequentially
252+
* Locator.pressSequentially()}.
253+
*
254+
* <p> Sends a {@code keydown}, {@code keypress}/{@code input}, and {@code keyup} event for each character in the text.
243255
*
244256
* <p> To press a special key, like {@code Control} or {@code ArrowDown}, use {@link Keyboard#press Keyboard.press()}.
245257
*

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4535,7 +4535,7 @@ default void exposeBinding(String name, BindingCallback callback) {
45354535
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be filled
45364536
* instead.
45374537
*
4538-
* <p> To send fine-grained keyboard events, use {@link Page#type Page.type()}.
4538+
* <p> To send fine-grained keyboard events, use {@link Locator#pressSequentially Locator.pressSequentially()}.
45394539
*
45404540
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
45414541
* @param value Value to fill for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
@@ -4554,7 +4554,7 @@ default void fill(String selector, String value) {
45544554
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be filled
45554555
* instead.
45564556
*
4557-
* <p> To send fine-grained keyboard events, use {@link Page#type Page.type()}.
4557+
* <p> To send fine-grained keyboard events, use {@link Locator#pressSequentially Locator.pressSequentially()}.
45584558
*
45594559
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
45604560
* @param value Value to fill for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
@@ -6942,8 +6942,9 @@ default String textContent(String selector) {
69426942
*/
69436943
Touchscreen touchscreen();
69446944
/**
6945-
* @deprecated Use locator-based {@link Locator#pressSequentially Locator.pressSequentially()} instead. Read more about <a
6946-
* href="https://playwright.dev/java/docs/locators">locators</a>.
6945+
* @deprecated In most cases, you should use {@link Locator#fill Locator.fill()} instead. You only need to press keys one by one if
6946+
* there is special keyboard handling on the page - in this case use {@link Locator#pressSequentially
6947+
* Locator.pressSequentially()}.
69476948
*
69486949
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
69496950
* @param text A text to type into a focused element.
@@ -6953,8 +6954,9 @@ default void type(String selector, String text) {
69536954
type(selector, text, null);
69546955
}
69556956
/**
6956-
* @deprecated Use locator-based {@link Locator#pressSequentially Locator.pressSequentially()} instead. Read more about <a
6957-
* href="https://playwright.dev/java/docs/locators">locators</a>.
6957+
* @deprecated In most cases, you should use {@link Locator#fill Locator.fill()} instead. You only need to press keys one by one if
6958+
* there is special keyboard handling on the page - in this case use {@link Locator#pressSequentially
6959+
* Locator.pressSequentially()}.
69586960
*
69596961
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
69606962
* @param text A text to type into a focused element.

playwright/src/main/java/com/microsoft/playwright/PageError.java renamed to playwright/src/main/java/com/microsoft/playwright/WebError.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@
1818

1919

2020
/**
21-
* {@code PageError} class represents objects created by context when there are unhandled execeptions thrown on the pages
22-
* and dispatched via the {@link BrowserContext#onPageError BrowserContext.onPageError()} event.
21+
* {@code WebError} class represents an unhandled exeception thrown in the page. It is dispatched via the {@link
22+
* BrowserContext#onWebError BrowserContext.onWebError()} event.
2323
* <pre>{@code
2424
* // Log all uncaught errors to the terminal
25-
* context.onPageError(pagerror -> {
26-
* System.out.println("Uncaught exception: " + pagerror.error());
25+
* context.onWebError(webError -> {
26+
* System.out.println("Uncaught exception: " + webError.error());
2727
* });
2828
*
2929
* // Navigate to a page with an exception.
3030
* page.navigate("data:text/html,<script>throw new Error('Test')</script>");
3131
* }</pre>
3232
*/
33-
public interface PageError {
33+
public interface WebError {
3434
/**
3535
* The page that produced this unhandled exception, if any.
3636
*

playwright/src/main/java/com/microsoft/playwright/impl/BrowserContextImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ enum EventType {
8282
CONSOLE,
8383
DIALOG,
8484
PAGE,
85-
PAGEERROR,
85+
WEBERROR,
8686
REQUEST,
8787
REQUESTFAILED,
8888
REQUESTFINISHED,
@@ -156,13 +156,13 @@ public void offPage(Consumer<Page> handler) {
156156
}
157157

158158
@Override
159-
public void onPageError(Consumer<PageError> handler) {
160-
listeners.add(EventType.PAGEERROR, handler);
159+
public void onWebError(Consumer<WebError> handler) {
160+
listeners.add(EventType.WEBERROR, handler);
161161
}
162162

163163
@Override
164-
public void offPageError(Consumer<PageError> handler) {
165-
listeners.remove(EventType.PAGEERROR, handler);
164+
public void offWebError(Consumer<WebError> handler) {
165+
listeners.remove(EventType.WEBERROR, handler);
166166
}
167167

168168
@Override
@@ -737,7 +737,7 @@ protected void handleEvent(String event, JsonObject params) {
737737
} catch (PlaywrightException e) {
738738
page = null;
739739
}
740-
listeners.notify(BrowserContextImpl.EventType.PAGEERROR, new PageErrorImpl(page, errorStr));
740+
listeners.notify(BrowserContextImpl.EventType.WEBERROR, new WebErrorImpl(page, errorStr));
741741
if (page != null) {
742742
page.listeners.notify(PageImpl.EventType.PAGEERROR, errorStr);
743743
}

playwright/src/main/java/com/microsoft/playwright/impl/PageErrorImpl.java renamed to playwright/src/main/java/com/microsoft/playwright/impl/WebErrorImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package com.microsoft.playwright.impl;
22

3-
import com.microsoft.playwright.PageError;
3+
import com.microsoft.playwright.WebError;
44

5-
public class PageErrorImpl implements PageError {
5+
public class WebErrorImpl implements WebError {
66
private final PageImpl page;
77
private final String error;
88

9-
PageErrorImpl(PageImpl page, String error) {
9+
WebErrorImpl(PageImpl page, String error) {
1010
this.page = page;
1111
this.error = error;
1212
}

playwright/src/test/java/com/microsoft/playwright/TestBrowserContextEvents.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,14 +160,14 @@ void dialogEventShouldWorkWithInlineScriptTag() {
160160

161161
@Test
162162
void pageErrorEventShouldWork() {
163-
PageError[] pageerror = { null };
164-
context.onPageError(e -> {
165-
pageerror[0] = e;
163+
WebError[] webError = { null };
164+
context.onWebError(e -> {
165+
webError[0] = e;
166166
});
167167
page.setContent("<script>throw new Error('boom')</script>");
168-
waitForCondition(() -> pageerror[0] != null);
169-
assertEquals(page, pageerror[0].page());
170-
assertTrue(pageerror[0].error().contains("boom"), pageerror[0].error());
168+
waitForCondition(() -> webError[0] != null);
169+
assertEquals(page, webError[0].page());
170+
assertTrue(webError[0].error().contains("boom"), webError[0].error());
171171
}
172172

173173
}

0 commit comments

Comments
 (0)