@@ -138,6 +138,52 @@ public CheckOptions setTrial(boolean trial) {
138138 return this ;
139139 }
140140 }
141+ class ClearOptions {
142+ /**
143+ * Whether to bypass the <a href="https://playwright.dev/java/docs/actionability">actionability</a> checks. Defaults to
144+ * {@code false}.
145+ */
146+ public Boolean force ;
147+ /**
148+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
149+ * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
150+ * inaccessible pages. Defaults to {@code false}.
151+ */
152+ public Boolean noWaitAfter ;
153+ /**
154+ * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by
155+ * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout
156+ * Page.setDefaultTimeout()} methods.
157+ */
158+ public Double timeout ;
159+
160+ /**
161+ * Whether to bypass the <a href="https://playwright.dev/java/docs/actionability">actionability</a> checks. Defaults to
162+ * {@code false}.
163+ */
164+ public ClearOptions setForce (boolean force ) {
165+ this .force = force ;
166+ return this ;
167+ }
168+ /**
169+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
170+ * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
171+ * inaccessible pages. Defaults to {@code false}.
172+ */
173+ public ClearOptions setNoWaitAfter (boolean noWaitAfter ) {
174+ this .noWaitAfter = noWaitAfter ;
175+ return this ;
176+ }
177+ /**
178+ * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by
179+ * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout
180+ * Page.setDefaultTimeout()} methods.
181+ */
182+ public ClearOptions setTimeout (double timeout ) {
183+ this .timeout = timeout ;
184+ return this ;
185+ }
186+ }
141187 class ClickOptions {
142188 /**
143189 * Defaults to {@code left}.
@@ -438,6 +484,12 @@ class HoverOptions {
438484 * modifiers back. If not specified, currently pressed modifiers are used.
439485 */
440486 public List <KeyboardModifier > modifiers ;
487+ /**
488+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
489+ * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
490+ * inaccessible pages. Defaults to {@code false}.
491+ */
492+ public Boolean noWaitAfter ;
441493 /**
442494 * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
443495 * element.
@@ -472,6 +524,15 @@ public HoverOptions setModifiers(List<KeyboardModifier> modifiers) {
472524 this .modifiers = modifiers ;
473525 return this ;
474526 }
527+ /**
528+ * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
529+ * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
530+ * inaccessible pages. Defaults to {@code false}.
531+ */
532+ public HoverOptions setNoWaitAfter (boolean noWaitAfter ) {
533+ this .noWaitAfter = noWaitAfter ;
534+ return this ;
535+ }
475536 /**
476537 * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
477538 * element.
@@ -607,7 +668,7 @@ class ScreenshotOptions {
607668 public Integer quality ;
608669 /**
609670 * When set to {@code "css"}, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will
610- * keep screenshots small. Using {@code "device"} option will produce a single pixel per each device pixel, so screenhots of
671+ * keep screenshots small. Using {@code "device"} option will produce a single pixel per each device pixel, so screenshots of
611672 * high-dpi devices will be twice as large or even larger.
612673 *
613674 * <p> Defaults to {@code "device"}.
@@ -680,7 +741,7 @@ public ScreenshotOptions setQuality(int quality) {
680741 }
681742 /**
682743 * When set to {@code "css"}, screenshot will have a single pixel per each css pixel on the page. For high-dpi devices, this will
683- * keep screenshots small. Using {@code "device"} option will produce a single pixel per each device pixel, so screenhots of
744+ * keep screenshots small. Using {@code "device"} option will produce a single pixel per each device pixel, so screenshots of
684745 * high-dpi devices will be twice as large or even larger.
685746 *
686747 * <p> Defaults to {@code "device"}.
@@ -1269,6 +1330,28 @@ default void check() {
12691330 * zero timeout disables this.
12701331 */
12711332 void check (CheckOptions options );
1333+ /**
1334+ * This method waits for <a href="https://playwright.dev/java/docs/actionability">actionability</a> checks, focuses the
1335+ * element, clears it and triggers an {@code input} event after clearing.
1336+ *
1337+ * <p> If the target element is not an {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element, this method throws an error.
1338+ * However, if the element is inside the {@code <label>} element that has an associated <a
1339+ * href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be
1340+ * cleared instead.
1341+ */
1342+ default void clear () {
1343+ clear (null );
1344+ }
1345+ /**
1346+ * This method waits for <a href="https://playwright.dev/java/docs/actionability">actionability</a> checks, focuses the
1347+ * element, clears it and triggers an {@code input} event after clearing.
1348+ *
1349+ * <p> If the target element is not an {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element, this method throws an error.
1350+ * However, if the element is inside the {@code <label>} element that has an associated <a
1351+ * href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be
1352+ * cleared instead.
1353+ */
1354+ void clear (ClearOptions options );
12721355 /**
12731356 * This method clicks the element by performing the following steps:
12741357 * <ol>
@@ -1438,7 +1521,7 @@ default void dispatchEvent(String type) {
14381521 *
14391522 * @param selector A selector to query for. See <a href="https://playwright.dev/java/docs/selectors">working with selectors</a> for more
14401523 * details.
1441- * @param expression JavaScript expression to be evaluated in the browser context. If the expresion evaluates to a function, the function is
1524+ * @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
14421525 * automatically invoked.
14431526 */
14441527 default Object evalOnSelector (String selector , String expression ) {
@@ -1464,7 +1547,7 @@ default Object evalOnSelector(String selector, String expression) {
14641547 *
14651548 * @param selector A selector to query for. See <a href="https://playwright.dev/java/docs/selectors">working with selectors</a> for more
14661549 * details.
1467- * @param expression JavaScript expression to be evaluated in the browser context. If the expresion evaluates to a function, the function is
1550+ * @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
14681551 * automatically invoked.
14691552 * @param arg Optional argument to pass to {@code expression}.
14701553 */
@@ -1489,7 +1572,7 @@ default Object evalOnSelector(String selector, String expression) {
14891572 *
14901573 * @param selector A selector to query for. See <a href="https://playwright.dev/java/docs/selectors">working with selectors</a> for more
14911574 * details.
1492- * @param expression JavaScript expression to be evaluated in the browser context. If the expresion evaluates to a function, the function is
1575+ * @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
14931576 * automatically invoked.
14941577 */
14951578 default Object evalOnSelectorAll (String selector , String expression ) {
@@ -1515,7 +1598,7 @@ default Object evalOnSelectorAll(String selector, String expression) {
15151598 *
15161599 * @param selector A selector to query for. See <a href="https://playwright.dev/java/docs/selectors">working with selectors</a> for more
15171600 * details.
1518- * @param expression JavaScript expression to be evaluated in the browser context. If the expresion evaluates to a function, the function is
1601+ * @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
15191602 * automatically invoked.
15201603 * @param arg Optional argument to pass to {@code expression}.
15211604 */
0 commit comments