diff --git a/playwright/src/main/java/com/microsoft/playwright/Browser.java b/playwright/src/main/java/com/microsoft/playwright/Browser.java index a8af906c..af9cd7d4 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Browser.java +++ b/playwright/src/main/java/com/microsoft/playwright/Browser.java @@ -60,6 +60,17 @@ public interface Browser extends AutoCloseable { * Whether to automatically download all the attachments. Defaults to {@code false} where all the downloads are canceled. */ public Boolean acceptDownloads; + /** + * When using {@link Page#goto Page.goto()}, {@link Page#route Page.route()}, {@link Page#waitForURL Page.waitForURL()}, + * {@link Page#waitForRequest Page.waitForRequest()}, or {@link Page#waitForResponse Page.waitForResponse()} it takes the + * base URL in consideration by using the {@code URL()} + * constructor for building the corresponding URL. Examples: + *
NOTE: Enabling routing disables http cache.
*
- * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
+ * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a {@code baseURL} via the context
+ * options was provided and the passed URL is a path, it gets merged via the {@code new URL()} constructor.
* @param handler handler function to route the request.
*/
void route(String url, Consumer NOTE: Enabling routing disables http cache.
*
- * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
+ * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a {@code baseURL} via the context
+ * options was provided and the passed URL is a path, it gets merged via the {@code new URL()} constructor.
* @param handler handler function to route the request.
*/
void route(Pattern url, Consumer NOTE: Enabling routing disables http cache.
*
- * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing.
+ * @param url A glob pattern, regex pattern or predicate receiving [URL] to match while routing. When a {@code baseURL} via the context
+ * options was provided and the passed URL is a path, it gets merged via the {@code new URL()} constructor.
* @param handler handler function to route the request.
*/
void route(Predicate Currently **experimental** and may subject to further changes.
+ * Cancels a download. Will not fail if the download is already finished or canceled. Upon successful cancellations,
+ * {@code download.failure()} would resolve to {@code "canceled"}.
*/
- void _cancel();
+ void cancel();
/**
* Returns readable stream for current download or {@code null} if download failed.
*/
@@ -73,6 +71,9 @@ public interface Download {
/**
* Returns path to the downloaded file in case of successful download. The method will wait for the download to finish if
* necessary. The method throws when connected remotely.
+ *
+ * Note that the download's file name is a random GUID, use {@link Download#suggestedFilename Download.suggestedFilename()}
+ * to get suggested file name.
*/
Path path();
/**
diff --git a/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java b/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java
index e973c3dd..38d3981f 100644
--- a/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java
+++ b/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java
@@ -269,6 +269,11 @@ public interface ElementHandle extends JSHandle {
}
}
class FillOptions {
+ /**
+ * Whether to bypass the actionability checks. Defaults to
+ * {@code false}.
+ */
+ public Boolean force;
/**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
* opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
@@ -282,6 +287,10 @@ public interface ElementHandle extends JSHandle {
*/
public Double timeout;
+ public FillOptions setForce(boolean force) {
+ this.force = force;
+ return this;
+ }
public FillOptions setNoWaitAfter(boolean noWaitAfter) {
this.noWaitAfter = noWaitAfter;
return this;
@@ -344,6 +353,19 @@ public interface ElementHandle extends JSHandle {
return this;
}
}
+ class InputValueOptions {
+ /**
+ * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by
+ * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout
+ * Page.setDefaultTimeout()} methods.
+ */
+ public Double timeout;
+
+ public InputValueOptions setTimeout(double timeout) {
+ this.timeout = timeout;
+ return this;
+ }
+ }
class PressOptions {
/**
* Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0.
@@ -437,6 +459,11 @@ public interface ElementHandle extends JSHandle {
}
}
class SelectOptionOptions {
+ /**
+ * Whether to bypass the actionability checks. Defaults to
+ * {@code false}.
+ */
+ public Boolean force;
/**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can
* opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to
@@ -450,6 +477,10 @@ public interface ElementHandle extends JSHandle {
*/
public Double timeout;
+ public SelectOptionOptions setForce(boolean force) {
+ this.force = force;
+ return this;
+ }
public SelectOptionOptions setNoWaitAfter(boolean noWaitAfter) {
this.noWaitAfter = noWaitAfter;
return this;
@@ -460,6 +491,11 @@ public interface ElementHandle extends JSHandle {
}
}
class SelectTextOptions {
+ /**
+ * Whether to bypass the actionability checks. Defaults to
+ * {@code false}.
+ */
+ public Boolean force;
/**
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by
* using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout
@@ -467,6 +503,10 @@ public interface ElementHandle extends JSHandle {
*/
public Double timeout;
+ public SelectTextOptions setForce(boolean force) {
+ this.force = force;
+ return this;
+ }
public SelectTextOptions setTimeout(double timeout) {
this.timeout = timeout;
return this;
@@ -1079,6 +1119,16 @@ public interface ElementHandle extends JSHandle {
* Returns the {@code element.innerText}.
*/
String innerText();
+ /**
+ * Returns {@code input.value} for {@code } or {@code
+ *
+ */
+ public String baseURL;
/**
* Toggles bypassing page's Content-Security-Policy.
*/
@@ -461,6 +472,10 @@ public interface BrowserType {
this.args = args;
return this;
}
+ public LaunchPersistentContextOptions setBaseURL(String baseURL) {
+ this.baseURL = baseURL;
+ return this;
+ }
public LaunchPersistentContextOptions setBypassCSP(boolean bypassCSP) {
this.bypassCSP = bypassCSP;
return this;
diff --git a/playwright/src/main/java/com/microsoft/playwright/Download.java b/playwright/src/main/java/com/microsoft/playwright/Download.java
index e9e7ba03..589bf1b4 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Download.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Download.java
@@ -48,12 +48,10 @@ import java.util.*;
*/
public interface Download {
/**
- * **Chromium-only** Cancels a download. Will not fail if the download is already finished or canceled. Upon successful
- * cancellations, {@code download.failure()} would resolve to {@code "canceled"}.
- *
- *