mirror of
https://github.com/microsoft/playwright-java.git
synced 2025-12-28 10:20:45 +00:00
feat: generate @since tags for methods (#1145)
This commit is contained in:
parent
45f81c0659
commit
d9fea34baa
@ -176,12 +176,16 @@ public interface APIRequest {
|
||||
}
|
||||
/**
|
||||
* Creates new instances of {@code APIRequestContext}.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
default APIRequestContext newContext() {
|
||||
return newContext(null);
|
||||
}
|
||||
/**
|
||||
* Creates new instances of {@code APIRequestContext}.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
APIRequestContext newContext(NewContextOptions options);
|
||||
}
|
||||
|
||||
@ -63,6 +63,7 @@ public interface APIRequestContext {
|
||||
* The method will automatically follow redirects.
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @since v1.16
|
||||
*/
|
||||
default APIResponse delete(String url) {
|
||||
return delete(url, null);
|
||||
@ -74,12 +75,15 @@ public interface APIRequestContext {
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @param params Optional request parameters.
|
||||
* @since v1.16
|
||||
*/
|
||||
APIResponse delete(String url, RequestOptions params);
|
||||
/**
|
||||
* All responses returned by {@link APIRequestContext#get APIRequestContext.get()} and similar methods are stored in the
|
||||
* memory, so that you can later call {@link APIResponse#body APIResponse.body()}. This method discards all stored
|
||||
* responses, and makes {@link APIResponse#body APIResponse.body()} throw "Response disposed" error.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
void dispose();
|
||||
/**
|
||||
@ -113,6 +117,7 @@ public interface APIRequestContext {
|
||||
* }</pre>
|
||||
*
|
||||
* @param urlOrRequest Target URL or Request to get all parameters from.
|
||||
* @since v1.16
|
||||
*/
|
||||
default APIResponse fetch(String urlOrRequest) {
|
||||
return fetch(urlOrRequest, null);
|
||||
@ -149,6 +154,7 @@ public interface APIRequestContext {
|
||||
*
|
||||
* @param urlOrRequest Target URL or Request to get all parameters from.
|
||||
* @param params Optional request parameters.
|
||||
* @since v1.16
|
||||
*/
|
||||
APIResponse fetch(String urlOrRequest, RequestOptions params);
|
||||
/**
|
||||
@ -182,6 +188,7 @@ public interface APIRequestContext {
|
||||
* }</pre>
|
||||
*
|
||||
* @param urlOrRequest Target URL or Request to get all parameters from.
|
||||
* @since v1.16
|
||||
*/
|
||||
default APIResponse fetch(Request urlOrRequest) {
|
||||
return fetch(urlOrRequest, null);
|
||||
@ -218,6 +225,7 @@ public interface APIRequestContext {
|
||||
*
|
||||
* @param urlOrRequest Target URL or Request to get all parameters from.
|
||||
* @param params Optional request parameters.
|
||||
* @since v1.16
|
||||
*/
|
||||
APIResponse fetch(Request urlOrRequest, RequestOptions params);
|
||||
/**
|
||||
@ -235,6 +243,7 @@ public interface APIRequestContext {
|
||||
* }</pre>
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @since v1.16
|
||||
*/
|
||||
default APIResponse get(String url) {
|
||||
return get(url, null);
|
||||
@ -255,6 +264,7 @@ public interface APIRequestContext {
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @param params Optional request parameters.
|
||||
* @since v1.16
|
||||
*/
|
||||
APIResponse get(String url, RequestOptions params);
|
||||
/**
|
||||
@ -263,6 +273,7 @@ public interface APIRequestContext {
|
||||
* method will automatically follow redirects.
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @since v1.16
|
||||
*/
|
||||
default APIResponse head(String url) {
|
||||
return head(url, null);
|
||||
@ -274,6 +285,7 @@ public interface APIRequestContext {
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @param params Optional request parameters.
|
||||
* @since v1.16
|
||||
*/
|
||||
APIResponse head(String url, RequestOptions params);
|
||||
/**
|
||||
@ -282,6 +294,7 @@ public interface APIRequestContext {
|
||||
* The method will automatically follow redirects.
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @since v1.16
|
||||
*/
|
||||
default APIResponse patch(String url) {
|
||||
return patch(url, null);
|
||||
@ -293,6 +306,7 @@ public interface APIRequestContext {
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @param params Optional request parameters.
|
||||
* @since v1.16
|
||||
*/
|
||||
APIResponse patch(String url, RequestOptions params);
|
||||
/**
|
||||
@ -337,6 +351,7 @@ public interface APIRequestContext {
|
||||
* }</pre>
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @since v1.16
|
||||
*/
|
||||
default APIResponse post(String url) {
|
||||
return post(url, null);
|
||||
@ -384,6 +399,7 @@ public interface APIRequestContext {
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @param params Optional request parameters.
|
||||
* @since v1.16
|
||||
*/
|
||||
APIResponse post(String url, RequestOptions params);
|
||||
/**
|
||||
@ -392,6 +408,7 @@ public interface APIRequestContext {
|
||||
* method will automatically follow redirects.
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @since v1.16
|
||||
*/
|
||||
default APIResponse put(String url) {
|
||||
return put(url, null);
|
||||
@ -403,11 +420,14 @@ public interface APIRequestContext {
|
||||
*
|
||||
* @param url Target URL.
|
||||
* @param params Optional request parameters.
|
||||
* @since v1.16
|
||||
*/
|
||||
APIResponse put(String url, RequestOptions params);
|
||||
/**
|
||||
* Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to
|
||||
* the constructor.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
default String storageState() {
|
||||
return storageState(null);
|
||||
@ -415,6 +435,8 @@ public interface APIRequestContext {
|
||||
/**
|
||||
* Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to
|
||||
* the constructor.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
String storageState(StorageStateOptions options);
|
||||
}
|
||||
|
||||
@ -26,39 +26,57 @@ import java.util.*;
|
||||
public interface APIResponse {
|
||||
/**
|
||||
* Returns the buffer with response body.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
byte[] body();
|
||||
/**
|
||||
* Disposes the body of this response. If not called then the body will stay in memory until the context closes.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
void dispose();
|
||||
/**
|
||||
* An object with all the response HTTP headers associated with this response.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
Map<String, String> headers();
|
||||
/**
|
||||
* An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers with
|
||||
* multiple entries, such as {@code Set-Cookie}, appear in the array multiple times.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
List<HttpHeader> headersArray();
|
||||
/**
|
||||
* Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
boolean ok();
|
||||
/**
|
||||
* Contains the status code of the response (e.g., 200 for a success).
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
int status();
|
||||
/**
|
||||
* Contains the status text of the response (e.g. usually an "OK" for a success).
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
String statusText();
|
||||
/**
|
||||
* Returns the text representation of response body.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
String text();
|
||||
/**
|
||||
* Contains the URL of the response.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
String url();
|
||||
}
|
||||
|
||||
@ -1084,6 +1084,8 @@ public interface Browser extends AutoCloseable {
|
||||
}
|
||||
/**
|
||||
* Get the browser type (chromium, firefox or webkit) that the browser belongs to.
|
||||
*
|
||||
* @since v1.23
|
||||
*/
|
||||
BrowserType browserType();
|
||||
/**
|
||||
@ -1098,6 +1100,8 @@ public interface Browser extends AutoCloseable {
|
||||
* Browser.newContext()} **before** calling {@link Browser#close Browser.close()}.
|
||||
*
|
||||
* <p> The {@code Browser} object itself is considered to be disposed and cannot be used anymore.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void close();
|
||||
/**
|
||||
@ -1110,10 +1114,14 @@ public interface Browser extends AutoCloseable {
|
||||
* BrowserContext context = browser.newContext();
|
||||
* System.out.println(browser.contexts().size()); // prints "1"
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
List<BrowserContext> contexts();
|
||||
/**
|
||||
* Indicates that the browser is connected.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isConnected();
|
||||
/**
|
||||
@ -1137,6 +1145,8 @@ public interface Browser extends AutoCloseable {
|
||||
* context.close();
|
||||
* browser.close();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default BrowserContext newContext() {
|
||||
return newContext(null);
|
||||
@ -1162,6 +1172,8 @@ public interface Browser extends AutoCloseable {
|
||||
* context.close();
|
||||
* browser.close();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
BrowserContext newContext(NewContextOptions options);
|
||||
/**
|
||||
@ -1170,6 +1182,8 @@ public interface Browser extends AutoCloseable {
|
||||
* <p> This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and
|
||||
* testing frameworks should explicitly create {@link Browser#newContext Browser.newContext()} followed by the {@link
|
||||
* BrowserContext#newPage BrowserContext.newPage()} to control their exact life times.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default Page newPage() {
|
||||
return newPage(null);
|
||||
@ -1180,6 +1194,8 @@ public interface Browser extends AutoCloseable {
|
||||
* <p> This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and
|
||||
* testing frameworks should explicitly create {@link Browser#newContext Browser.newContext()} followed by the {@link
|
||||
* BrowserContext#newPage BrowserContext.newPage()} to control their exact life times.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Page newPage(NewPageOptions options);
|
||||
/**
|
||||
@ -1200,6 +1216,7 @@ public interface Browser extends AutoCloseable {
|
||||
* }</pre>
|
||||
*
|
||||
* @param page Optional, if specified, tracing includes screenshots of the given page.
|
||||
* @since v1.11
|
||||
*/
|
||||
default void startTracing(Page page) {
|
||||
startTracing(page, null);
|
||||
@ -1220,6 +1237,8 @@ public interface Browser extends AutoCloseable {
|
||||
* page.goto('https://www.google.com');
|
||||
* browser.stopTracing();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.11
|
||||
*/
|
||||
default void startTracing() {
|
||||
startTracing(null);
|
||||
@ -1242,6 +1261,7 @@ public interface Browser extends AutoCloseable {
|
||||
* }</pre>
|
||||
*
|
||||
* @param page Optional, if specified, tracing includes screenshots of the given page.
|
||||
* @since v1.11
|
||||
*/
|
||||
void startTracing(Page page, StartTracingOptions options);
|
||||
/**
|
||||
@ -1251,10 +1271,14 @@ public interface Browser extends AutoCloseable {
|
||||
* href="https://playwright.dev/java/docs/api/class-tracing">here</a>.
|
||||
*
|
||||
* <p> Returns the buffer with trace data.
|
||||
*
|
||||
* @since v1.11
|
||||
*/
|
||||
byte[] stopTracing();
|
||||
/**
|
||||
* Returns the browser version.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String version();
|
||||
}
|
||||
|
||||
@ -283,6 +283,8 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* <pre>{@code
|
||||
* browserContext.addCookies(Arrays.asList(cookieObject1, cookieObject2));
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void addCookies(List<Cookie> cookies);
|
||||
/**
|
||||
@ -308,6 +310,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* BrowserContext.addInitScript()} and {@link Page#addInitScript Page.addInitScript()} is not defined.
|
||||
*
|
||||
* @param script Script to be evaluated in all pages in the browser context.
|
||||
* @since v1.8
|
||||
*/
|
||||
void addInitScript(String script);
|
||||
/**
|
||||
@ -333,14 +336,19 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* BrowserContext.addInitScript()} and {@link Page#addInitScript Page.addInitScript()} is not defined.
|
||||
*
|
||||
* @param script Script to be evaluated in all pages in the browser context.
|
||||
* @since v1.8
|
||||
*/
|
||||
void addInitScript(Path script);
|
||||
/**
|
||||
* Returns the browser instance of the context. If it was launched as a persistent context null gets returned.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Browser browser();
|
||||
/**
|
||||
* Clears context cookies.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void clearCookies();
|
||||
/**
|
||||
@ -353,17 +361,23 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* // do stuff ..
|
||||
* context.clearPermissions();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void clearPermissions();
|
||||
/**
|
||||
* Closes the browser context. All the pages that belong to the browser context will be closed.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> The default browser context cannot be closed.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void close();
|
||||
/**
|
||||
* If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs
|
||||
* are returned.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<Cookie> cookies() {
|
||||
return cookies((String) null);
|
||||
@ -373,6 +387,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* are returned.
|
||||
*
|
||||
* @param urls Optional list of URLs.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<Cookie> cookies(String urls);
|
||||
/**
|
||||
@ -380,6 +395,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* are returned.
|
||||
*
|
||||
* @param urls Optional list of URLs.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<Cookie> cookies(List<String> urls);
|
||||
/**
|
||||
@ -439,6 +455,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
*
|
||||
* @param name Name of the function on the window object.
|
||||
* @param callback Callback function that will be called in the Playwright's context.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void exposeBinding(String name, BindingCallback callback) {
|
||||
exposeBinding(name, callback, null);
|
||||
@ -500,6 +517,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
*
|
||||
* @param name Name of the function on the window object.
|
||||
* @param callback Callback function that will be called in the Playwright's context.
|
||||
* @since v1.8
|
||||
*/
|
||||
void exposeBinding(String name, BindingCallback callback, ExposeBindingOptions options);
|
||||
/**
|
||||
@ -557,6 +575,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
*
|
||||
* @param name Name of the function on the window object.
|
||||
* @param callback Callback function that will be called in the Playwright's context.
|
||||
* @since v1.8
|
||||
*/
|
||||
void exposeFunction(String name, FunctionCallback callback);
|
||||
/**
|
||||
@ -581,6 +600,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* <li> {@code "clipboard-write"}</li>
|
||||
* <li> {@code "payment-handler"}</li>
|
||||
* </ul>
|
||||
* @since v1.8
|
||||
*/
|
||||
default void grantPermissions(List<String> permissions) {
|
||||
grantPermissions(permissions, null);
|
||||
@ -607,18 +627,25 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* <li> {@code "clipboard-write"}</li>
|
||||
* <li> {@code "payment-handler"}</li>
|
||||
* </ul>
|
||||
* @since v1.8
|
||||
*/
|
||||
void grantPermissions(List<String> permissions, GrantPermissionsOptions options);
|
||||
/**
|
||||
* Creates a new page in the browser context.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Page newPage();
|
||||
/**
|
||||
* Returns all open pages in the context.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
List<Page> pages();
|
||||
/**
|
||||
* API testing helper associated with this context. Requests made with this API will use context cookies.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
APIRequestContext request();
|
||||
/**
|
||||
@ -671,6 +698,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* context options was provided and the passed URL is a path, it gets merged via the <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code new URL()}</a> constructor.
|
||||
* @param handler handler function to route the request.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void route(String url, Consumer<Route> handler) {
|
||||
route(url, handler, null);
|
||||
@ -725,6 +753,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* context options was provided and the passed URL is a path, it gets merged via the <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code new URL()}</a> constructor.
|
||||
* @param handler handler function to route the request.
|
||||
* @since v1.8
|
||||
*/
|
||||
void route(String url, Consumer<Route> handler, RouteOptions options);
|
||||
/**
|
||||
@ -777,6 +806,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* context options was provided and the passed URL is a path, it gets merged via the <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code new URL()}</a> constructor.
|
||||
* @param handler handler function to route the request.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void route(Pattern url, Consumer<Route> handler) {
|
||||
route(url, handler, null);
|
||||
@ -831,6 +861,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* context options was provided and the passed URL is a path, it gets merged via the <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code new URL()}</a> constructor.
|
||||
* @param handler handler function to route the request.
|
||||
* @since v1.8
|
||||
*/
|
||||
void route(Pattern url, Consumer<Route> handler, RouteOptions options);
|
||||
/**
|
||||
@ -883,6 +914,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* context options was provided and the passed URL is a path, it gets merged via the <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code new URL()}</a> constructor.
|
||||
* @param handler handler function to route the request.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void route(Predicate<String> url, Consumer<Route> handler) {
|
||||
route(url, handler, null);
|
||||
@ -937,6 +969,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* context options was provided and the passed URL is a path, it gets merged via the <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code new URL()}</a> constructor.
|
||||
* @param handler handler function to route the request.
|
||||
* @since v1.8
|
||||
*/
|
||||
void route(Predicate<String> url, Consumer<Route> handler, RouteOptions options);
|
||||
/**
|
||||
@ -949,6 +982,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
*
|
||||
* @param har Path to a <a href="http://www.softwareishard.com/blog/har-12-spec">HAR</a> file with prerecorded network data. If {@code
|
||||
* path} is a relative path, then it is resolved relative to the current working directory.
|
||||
* @since v1.23
|
||||
*/
|
||||
default void routeFromHAR(Path har) {
|
||||
routeFromHAR(har, null);
|
||||
@ -963,6 +997,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
*
|
||||
* @param har Path to a <a href="http://www.softwareishard.com/blog/har-12-spec">HAR</a> file with prerecorded network data. If {@code
|
||||
* path} is a relative path, then it is resolved relative to the current working directory.
|
||||
* @since v1.23
|
||||
*/
|
||||
void routeFromHAR(Path har, RouteFromHAROptions options);
|
||||
/**
|
||||
@ -981,6 +1016,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* BrowserContext.setDefaultNavigationTimeout()}.
|
||||
*
|
||||
* @param timeout Maximum navigation time in milliseconds
|
||||
* @since v1.8
|
||||
*/
|
||||
void setDefaultNavigationTimeout(double timeout);
|
||||
/**
|
||||
@ -992,6 +1028,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* BrowserContext.setDefaultTimeout()}.
|
||||
*
|
||||
* @param timeout Maximum time in milliseconds
|
||||
* @since v1.8
|
||||
*/
|
||||
void setDefaultTimeout(double timeout);
|
||||
/**
|
||||
@ -1003,6 +1040,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* in the outgoing requests.
|
||||
*
|
||||
* @param headers An object containing additional HTTP headers to be sent with every request. All header values must be strings.
|
||||
* @since v1.8
|
||||
*/
|
||||
void setExtraHTTPHeaders(Map<String, String> headers);
|
||||
/**
|
||||
@ -1015,24 +1053,36 @@ public interface BrowserContext extends AutoCloseable {
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> Consider using {@link BrowserContext#grantPermissions BrowserContext.grantPermissions()} to grant permissions for the
|
||||
* browser context pages to read its geolocation.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void setGeolocation(Geolocation geolocation);
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param offline Whether to emulate network being offline for the browser context.
|
||||
* @since v1.8
|
||||
*/
|
||||
void setOffline(boolean offline);
|
||||
/**
|
||||
* Returns storage state for this browser context, contains current cookies and local storage snapshot.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default String storageState() {
|
||||
return storageState(null);
|
||||
}
|
||||
/**
|
||||
* Returns storage state for this browser context, contains current cookies and local storage snapshot.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String storageState(StorageStateOptions options);
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @since v1.12
|
||||
*/
|
||||
Tracing tracing();
|
||||
/**
|
||||
* Removes a route created with {@link BrowserContext#route BrowserContext.route()}. When {@code handler} is not specified,
|
||||
@ -1040,6 +1090,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
*
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with {@link BrowserContext#route
|
||||
* BrowserContext.route()}.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void unroute(String url) {
|
||||
unroute(url, null);
|
||||
@ -1051,6 +1102,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with {@link BrowserContext#route
|
||||
* BrowserContext.route()}.
|
||||
* @param handler Optional handler function used to register a routing with {@link BrowserContext#route BrowserContext.route()}.
|
||||
* @since v1.8
|
||||
*/
|
||||
void unroute(String url, Consumer<Route> handler);
|
||||
/**
|
||||
@ -1059,6 +1111,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
*
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with {@link BrowserContext#route
|
||||
* BrowserContext.route()}.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void unroute(Pattern url) {
|
||||
unroute(url, null);
|
||||
@ -1070,6 +1123,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with {@link BrowserContext#route
|
||||
* BrowserContext.route()}.
|
||||
* @param handler Optional handler function used to register a routing with {@link BrowserContext#route BrowserContext.route()}.
|
||||
* @since v1.8
|
||||
*/
|
||||
void unroute(Pattern url, Consumer<Route> handler);
|
||||
/**
|
||||
@ -1078,6 +1132,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
*
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with {@link BrowserContext#route
|
||||
* BrowserContext.route()}.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void unroute(Predicate<String> url) {
|
||||
unroute(url, null);
|
||||
@ -1089,6 +1144,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] used to register a routing with {@link BrowserContext#route
|
||||
* BrowserContext.route()}.
|
||||
* @param handler Optional handler function used to register a routing with {@link BrowserContext#route BrowserContext.route()}.
|
||||
* @since v1.8
|
||||
*/
|
||||
void unroute(Predicate<String> url, Consumer<Route> handler);
|
||||
/**
|
||||
@ -1097,6 +1153,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* Will throw an error if the context closes before new {@code Page} is created.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.9
|
||||
*/
|
||||
default Page waitForPage(Runnable callback) {
|
||||
return waitForPage(null, callback);
|
||||
@ -1107,6 +1164,7 @@ public interface BrowserContext extends AutoCloseable {
|
||||
* Will throw an error if the context closes before new {@code Page} is created.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.9
|
||||
*/
|
||||
Page waitForPage(WaitForPageOptions options, Runnable callback);
|
||||
}
|
||||
|
||||
@ -1042,6 +1042,7 @@ public interface BrowserType {
|
||||
* compatible with 1.2.x).
|
||||
*
|
||||
* @param wsEndpoint A browser websocket endpoint to connect to.
|
||||
* @since v1.8
|
||||
*/
|
||||
default Browser connect(String wsEndpoint) {
|
||||
return connect(wsEndpoint, null);
|
||||
@ -1052,6 +1053,7 @@ public interface BrowserType {
|
||||
* compatible with 1.2.x).
|
||||
*
|
||||
* @param wsEndpoint A browser websocket endpoint to connect to.
|
||||
* @since v1.8
|
||||
*/
|
||||
Browser connect(String wsEndpoint, ConnectOptions options);
|
||||
/**
|
||||
@ -1070,6 +1072,7 @@ public interface BrowserType {
|
||||
*
|
||||
* @param endpointURL A CDP websocket endpoint or http url to connect to. For example {@code http://localhost:9222/} or {@code
|
||||
* ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4}.
|
||||
* @since v1.9
|
||||
*/
|
||||
default Browser connectOverCDP(String endpointURL) {
|
||||
return connectOverCDP(endpointURL, null);
|
||||
@ -1090,10 +1093,13 @@ public interface BrowserType {
|
||||
*
|
||||
* @param endpointURL A CDP websocket endpoint or http url to connect to. For example {@code http://localhost:9222/} or {@code
|
||||
* ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4}.
|
||||
* @since v1.9
|
||||
*/
|
||||
Browser connectOverCDP(String endpointURL, ConnectOverCDPOptions options);
|
||||
/**
|
||||
* A path where Playwright expects to find a bundled browser executable.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String executablePath();
|
||||
/**
|
||||
@ -1126,6 +1132,8 @@ public interface BrowserType {
|
||||
* other differences between Chromium and Chrome. <a
|
||||
* href="https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md">This article</a>
|
||||
* describes some differences for Linux users.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default Browser launch() {
|
||||
return launch(null);
|
||||
@ -1160,6 +1168,8 @@ public interface BrowserType {
|
||||
* other differences between Chromium and Chrome. <a
|
||||
* href="https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md">This article</a>
|
||||
* describes some differences for Linux users.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Browser launch(LaunchOptions options);
|
||||
/**
|
||||
@ -1173,6 +1183,7 @@ public interface BrowserType {
|
||||
* href="https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile">Firefox</a>. Note that
|
||||
* Chromium's user data directory is the **parent** directory of the "Profile Path" seen at {@code chrome://version}. Pass
|
||||
* an empty string to use a temporary directory instead.
|
||||
* @since v1.8
|
||||
*/
|
||||
default BrowserContext launchPersistentContext(Path userDataDir) {
|
||||
return launchPersistentContext(userDataDir, null);
|
||||
@ -1188,10 +1199,13 @@ public interface BrowserType {
|
||||
* href="https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options#User_Profile">Firefox</a>. Note that
|
||||
* Chromium's user data directory is the **parent** directory of the "Profile Path" seen at {@code chrome://version}. Pass
|
||||
* an empty string to use a temporary directory instead.
|
||||
* @since v1.8
|
||||
*/
|
||||
BrowserContext launchPersistentContext(Path userDataDir, LaunchPersistentContextOptions options);
|
||||
/**
|
||||
* Returns browser name. For example: {@code "chromium"}, {@code "webkit"} or {@code "firefox"}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String name();
|
||||
}
|
||||
|
||||
@ -46,14 +46,20 @@ public interface ConsoleMessage {
|
||||
/**
|
||||
* List of arguments passed to a {@code console} function call. See also {@link Page#onConsoleMessage
|
||||
* Page.onConsoleMessage()}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
List<JSHandle> args();
|
||||
/**
|
||||
* URL of the resource followed by 0-based line and column numbers in the resource formatted as {@code URL:line:column}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String location();
|
||||
/**
|
||||
* The text of the console message.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String text();
|
||||
/**
|
||||
@ -61,6 +67,8 @@ public interface ConsoleMessage {
|
||||
* "dir"}, {@code "dirxml"}, {@code "table"}, {@code "trace"}, {@code "clear"}, {@code "startGroup"}, {@code
|
||||
* "startGroupCollapsed"}, {@code "endGroup"}, {@code "assert"}, {@code "profile"}, {@code "profileEnd"}, {@code "count"},
|
||||
* {@code "timeEnd"}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String type();
|
||||
}
|
||||
|
||||
@ -50,6 +50,8 @@ package com.microsoft.playwright;
|
||||
public interface Dialog {
|
||||
/**
|
||||
* Returns when the dialog has been accepted.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void accept() {
|
||||
accept(null);
|
||||
@ -58,22 +60,31 @@ public interface Dialog {
|
||||
* Returns when the dialog has been accepted.
|
||||
*
|
||||
* @param promptText A text to enter in prompt. Does not cause any effects if the dialog's {@code type} is not prompt. Optional.
|
||||
* @since v1.8
|
||||
*/
|
||||
void accept(String promptText);
|
||||
/**
|
||||
* If dialog is prompt, returns default prompt value. Otherwise, returns empty string.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String defaultValue();
|
||||
/**
|
||||
* Returns when the dialog has been dismissed.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void dismiss();
|
||||
/**
|
||||
* A message displayed in the dialog.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String message();
|
||||
/**
|
||||
* Returns dialog's type, can be one of {@code alert}, {@code beforeunload}, {@code confirm} or {@code prompt}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String type();
|
||||
}
|
||||
|
||||
@ -38,22 +38,32 @@ public interface Download {
|
||||
/**
|
||||
* 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"}.
|
||||
*
|
||||
* @since v1.13
|
||||
*/
|
||||
void cancel();
|
||||
/**
|
||||
* Returns readable stream for current download or {@code null} if download failed.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
InputStream createReadStream();
|
||||
/**
|
||||
* Deletes the downloaded file. Will wait for the download to finish if necessary.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void delete();
|
||||
/**
|
||||
* Returns download error if any. Will wait for the download to finish if necessary.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String failure();
|
||||
/**
|
||||
* Get the page that the download belongs to.
|
||||
*
|
||||
* @since v1.12
|
||||
*/
|
||||
Page page();
|
||||
/**
|
||||
@ -62,6 +72,8 @@ public interface Download {
|
||||
*
|
||||
* <p> Note that the download's file name is a random GUID, use {@link Download#suggestedFilename Download.suggestedFilename()}
|
||||
* to get suggested file name.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Path path();
|
||||
/**
|
||||
@ -69,6 +81,7 @@ public interface Download {
|
||||
* wait for the download to finish if necessary.
|
||||
*
|
||||
* @param path Path where the download should be copied.
|
||||
* @since v1.8
|
||||
*/
|
||||
void saveAs(Path path);
|
||||
/**
|
||||
@ -77,10 +90,14 @@ public interface Download {
|
||||
* response header or the {@code download} attribute. See the spec on <a
|
||||
* href="https://html.spec.whatwg.org/#downloading-resources">whatwg</a>. Different browsers can use different logic for
|
||||
* computing it.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String suggestedFilename();
|
||||
/**
|
||||
* Returns downloaded url.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String url();
|
||||
}
|
||||
|
||||
@ -1244,6 +1244,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* BoundingBox box = elementHandle.boundingBox();
|
||||
* page.mouse().click(box.x + box.width / 2, box.y + box.height / 2);
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
BoundingBox boundingBox();
|
||||
/**
|
||||
@ -1263,6 +1265,8 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void check() {
|
||||
check(null);
|
||||
@ -1284,6 +1288,8 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void check(CheckOptions options);
|
||||
/**
|
||||
@ -1300,6 +1306,8 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void click() {
|
||||
click(null);
|
||||
@ -1318,10 +1326,14 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void click(ClickOptions options);
|
||||
/**
|
||||
* Returns the content frame for element handles referencing iframe nodes, or {@code null} otherwise
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Frame contentFrame();
|
||||
/**
|
||||
@ -1341,6 +1353,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> {@code elementHandle.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void dblclick() {
|
||||
dblclick(null);
|
||||
@ -1362,6 +1376,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> {@code elementHandle.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void dblclick(DblclickOptions options);
|
||||
/**
|
||||
@ -1399,6 +1415,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* }</pre>
|
||||
*
|
||||
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void dispatchEvent(String type) {
|
||||
dispatchEvent(type, null);
|
||||
@ -1439,6 +1456,7 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
|
||||
* @param eventInit Optional event-specific initialization properties.
|
||||
* @since v1.8
|
||||
*/
|
||||
void dispatchEvent(String type, Object eventInit);
|
||||
/**
|
||||
@ -1461,6 +1479,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param selector A selector to query for.
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.9
|
||||
*/
|
||||
default Object evalOnSelector(String selector, String expression) {
|
||||
return evalOnSelector(selector, expression, null);
|
||||
@ -1486,6 +1505,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.9
|
||||
*/
|
||||
Object evalOnSelector(String selector, String expression, Object arg);
|
||||
/**
|
||||
@ -1508,6 +1528,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param selector A selector to query for.
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.9
|
||||
*/
|
||||
default Object evalOnSelectorAll(String selector, String expression) {
|
||||
return evalOnSelectorAll(selector, expression, null);
|
||||
@ -1533,6 +1554,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.9
|
||||
*/
|
||||
Object evalOnSelectorAll(String selector, String expression, Object arg);
|
||||
/**
|
||||
@ -1548,6 +1570,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> To send fine-grained keyboard events, use {@link ElementHandle#type ElementHandle.type()}.
|
||||
*
|
||||
* @param value Value to set for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void fill(String value) {
|
||||
fill(value, null);
|
||||
@ -1565,16 +1588,20 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> To send fine-grained keyboard events, use {@link ElementHandle#type ElementHandle.type()}.
|
||||
*
|
||||
* @param value Value to set for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
|
||||
* @since v1.8
|
||||
*/
|
||||
void fill(String value, FillOptions options);
|
||||
/**
|
||||
* Calls <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus">focus</a> on the element.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void focus();
|
||||
/**
|
||||
* Returns element attribute value.
|
||||
*
|
||||
* @param name Attribute name to get the value for.
|
||||
* @since v1.8
|
||||
*/
|
||||
String getAttribute(String name);
|
||||
/**
|
||||
@ -1591,6 +1618,8 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void hover() {
|
||||
hover(null);
|
||||
@ -1609,14 +1638,20 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void hover(HoverOptions options);
|
||||
/**
|
||||
* Returns the {@code element.innerHTML}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String innerHTML();
|
||||
/**
|
||||
* Returns the {@code element.innerText}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String innerText();
|
||||
/**
|
||||
@ -1625,6 +1660,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> Throws for non-input elements. However, if the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, returns the value of the
|
||||
* control.
|
||||
*
|
||||
* @since v1.13
|
||||
*/
|
||||
default String inputValue() {
|
||||
return inputValue(null);
|
||||
@ -1635,36 +1672,52 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> Throws for non-input elements. However, if the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, returns the value of the
|
||||
* control.
|
||||
*
|
||||
* @since v1.13
|
||||
*/
|
||||
String inputValue(InputValueOptions options);
|
||||
/**
|
||||
* Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isChecked();
|
||||
/**
|
||||
* Returns whether the element is disabled, the opposite of <a
|
||||
* href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isDisabled();
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#editable">editable</a>.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isEditable();
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isEnabled();
|
||||
/**
|
||||
* Returns whether the element is hidden, the opposite of <a
|
||||
* href="https://playwright.dev/java/docs/actionability#visible">visible</a>.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isHidden();
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#visible">visible</a>.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isVisible();
|
||||
/**
|
||||
* Returns the frame containing the given element.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Frame ownerFrame();
|
||||
/**
|
||||
@ -1692,6 +1745,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* the modifier, modifier is pressed and being held while the subsequent key is being pressed.
|
||||
*
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void press(String key) {
|
||||
press(key, null);
|
||||
@ -1721,6 +1775,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* the modifier, modifier is pressed and being held while the subsequent key is being pressed.
|
||||
*
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.8
|
||||
*/
|
||||
void press(String key, PressOptions options);
|
||||
/**
|
||||
@ -1728,6 +1783,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* the selector, returns {@code null}.
|
||||
*
|
||||
* @param selector A selector to query for.
|
||||
* @since v1.9
|
||||
*/
|
||||
ElementHandle querySelector(String selector);
|
||||
/**
|
||||
@ -1735,6 +1791,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* match the selector, returns empty array.
|
||||
*
|
||||
* @param selector A selector to query for.
|
||||
* @since v1.9
|
||||
*/
|
||||
List<ElementHandle> querySelectorAll(String selector);
|
||||
/**
|
||||
@ -1746,6 +1803,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* scrolls element into view before taking a screenshot. If the element is detached from DOM, the method throws an error.
|
||||
*
|
||||
* <p> Returns the buffer with the captured screenshot.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default byte[] screenshot() {
|
||||
return screenshot(null);
|
||||
@ -1759,6 +1818,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* scrolls element into view before taking a screenshot. If the element is detached from DOM, the method throws an error.
|
||||
*
|
||||
* <p> Returns the buffer with the captured screenshot.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
byte[] screenshot(ScreenshotOptions options);
|
||||
/**
|
||||
@ -1769,6 +1830,8 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> Throws when {@code elementHandle} does not point to an element <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected">connected</a> to a Document or a ShadowRoot.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void scrollIntoViewIfNeeded() {
|
||||
scrollIntoViewIfNeeded(null);
|
||||
@ -1781,6 +1844,8 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> Throws when {@code elementHandle} does not point to an element <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/Node/isConnected">connected</a> to a Document or a ShadowRoot.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void scrollIntoViewIfNeeded(ScrollIntoViewIfNeededOptions options);
|
||||
/**
|
||||
@ -1809,6 +1874,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(String values) {
|
||||
return selectOption(values, null);
|
||||
@ -1839,6 +1905,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(String values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -1867,6 +1934,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(ElementHandle values) {
|
||||
return selectOption(values, null);
|
||||
@ -1897,6 +1965,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(ElementHandle values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -1925,6 +1994,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(String[] values) {
|
||||
return selectOption(values, null);
|
||||
@ -1955,6 +2025,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(String[] values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -1983,6 +2054,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(SelectOption values) {
|
||||
return selectOption(values, null);
|
||||
@ -2013,6 +2085,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(SelectOption values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -2041,6 +2114,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(ElementHandle[] values) {
|
||||
return selectOption(values, null);
|
||||
@ -2071,6 +2145,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(ElementHandle[] values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -2099,6 +2174,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(SelectOption[] values) {
|
||||
return selectOption(values, null);
|
||||
@ -2129,6 +2205,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(SelectOption[] values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -2138,6 +2215,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> If the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, focuses and selects text
|
||||
* in the control instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void selectText() {
|
||||
selectText(null);
|
||||
@ -2149,6 +2228,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> If the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, focuses and selects text
|
||||
* in the control instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void selectText(SelectTextOptions options);
|
||||
/**
|
||||
@ -2168,6 +2249,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param checked Whether to check or uncheck the checkbox.
|
||||
* @since v1.15
|
||||
*/
|
||||
default void setChecked(boolean checked) {
|
||||
setChecked(checked, null);
|
||||
@ -2189,6 +2271,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param checked Whether to check or uncheck the checkbox.
|
||||
* @since v1.15
|
||||
*/
|
||||
void setChecked(boolean checked, SetCheckedOptions options);
|
||||
/**
|
||||
@ -2200,6 +2283,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setInputFiles(Path files) {
|
||||
setInputFiles(files, null);
|
||||
@ -2213,6 +2298,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void setInputFiles(Path files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -2224,6 +2311,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setInputFiles(Path[] files) {
|
||||
setInputFiles(files, null);
|
||||
@ -2237,6 +2326,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void setInputFiles(Path[] files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -2248,6 +2339,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setInputFiles(FilePayload files) {
|
||||
setInputFiles(files, null);
|
||||
@ -2261,6 +2354,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void setInputFiles(FilePayload files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -2272,6 +2367,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setInputFiles(FilePayload[] files) {
|
||||
setInputFiles(files, null);
|
||||
@ -2285,6 +2382,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void setInputFiles(FilePayload[] files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -2303,6 +2402,8 @@ public interface ElementHandle extends JSHandle {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> {@code elementHandle.tap()} requires that the {@code hasTouch} option of the browser context be set to true.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void tap() {
|
||||
tap(null);
|
||||
@ -2323,10 +2424,14 @@ public interface ElementHandle extends JSHandle {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> {@code elementHandle.tap()} requires that the {@code hasTouch} option of the browser context be set to true.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void tap(TapOptions options);
|
||||
/**
|
||||
* Returns the {@code node.textContent}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String textContent();
|
||||
/**
|
||||
@ -2350,6 +2455,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* }</pre>
|
||||
*
|
||||
* @param text A text to type into a focused element.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void type(String text) {
|
||||
type(text, null);
|
||||
@ -2375,6 +2481,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* }</pre>
|
||||
*
|
||||
* @param text A text to type into a focused element.
|
||||
* @since v1.8
|
||||
*/
|
||||
void type(String text, TypeOptions options);
|
||||
/**
|
||||
@ -2394,6 +2501,8 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void uncheck() {
|
||||
uncheck(null);
|
||||
@ -2415,6 +2524,8 @@ public interface ElementHandle extends JSHandle {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void uncheck(UncheckOptions options);
|
||||
/**
|
||||
@ -2443,6 +2554,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> If the element does not satisfy the condition for the {@code timeout} milliseconds, this method will throw.
|
||||
*
|
||||
* @param state A state to wait for, see below for more details.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void waitForElementState(ElementState state) {
|
||||
waitForElementState(state, null);
|
||||
@ -2473,6 +2585,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> If the element does not satisfy the condition for the {@code timeout} milliseconds, this method will throw.
|
||||
*
|
||||
* @param state A state to wait for, see below for more details.
|
||||
* @since v1.8
|
||||
*/
|
||||
void waitForElementState(ElementState state, WaitForElementStateOptions options);
|
||||
/**
|
||||
@ -2496,6 +2609,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> <strong>NOTE:</strong> This method does not work across navigations, use {@link Page#waitForSelector Page.waitForSelector()} instead.
|
||||
*
|
||||
* @param selector A selector to query for.
|
||||
* @since v1.8
|
||||
*/
|
||||
default ElementHandle waitForSelector(String selector) {
|
||||
return waitForSelector(selector, null);
|
||||
@ -2521,6 +2635,7 @@ public interface ElementHandle extends JSHandle {
|
||||
* <p> <strong>NOTE:</strong> This method does not work across navigations, use {@link Page#waitForSelector Page.waitForSelector()} instead.
|
||||
*
|
||||
* @param selector A selector to query for.
|
||||
* @since v1.8
|
||||
*/
|
||||
ElementHandle waitForSelector(String selector, WaitForSelectorOptions options);
|
||||
}
|
||||
|
||||
@ -62,19 +62,27 @@ public interface FileChooser {
|
||||
}
|
||||
/**
|
||||
* Returns input element associated with this file chooser.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
ElementHandle element();
|
||||
/**
|
||||
* Returns whether this file chooser accepts multiple files.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isMultiple();
|
||||
/**
|
||||
* Returns page this file chooser belongs to.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Page page();
|
||||
/**
|
||||
* Sets the value of the file input this chooser is associated with. If some of the {@code filePaths} are relative paths,
|
||||
* then they are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setFiles(Path files) {
|
||||
setFiles(files, null);
|
||||
@ -82,11 +90,15 @@ public interface FileChooser {
|
||||
/**
|
||||
* Sets the value of the file input this chooser is associated with. If some of the {@code filePaths} are relative paths,
|
||||
* then they are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void setFiles(Path files, SetFilesOptions options);
|
||||
/**
|
||||
* Sets the value of the file input this chooser is associated with. If some of the {@code filePaths} are relative paths,
|
||||
* then they are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setFiles(Path[] files) {
|
||||
setFiles(files, null);
|
||||
@ -94,11 +106,15 @@ public interface FileChooser {
|
||||
/**
|
||||
* Sets the value of the file input this chooser is associated with. If some of the {@code filePaths} are relative paths,
|
||||
* then they are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void setFiles(Path[] files, SetFilesOptions options);
|
||||
/**
|
||||
* Sets the value of the file input this chooser is associated with. If some of the {@code filePaths} are relative paths,
|
||||
* then they are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setFiles(FilePayload files) {
|
||||
setFiles(files, null);
|
||||
@ -106,11 +122,15 @@ public interface FileChooser {
|
||||
/**
|
||||
* Sets the value of the file input this chooser is associated with. If some of the {@code filePaths} are relative paths,
|
||||
* then they are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void setFiles(FilePayload files, SetFilesOptions options);
|
||||
/**
|
||||
* Sets the value of the file input this chooser is associated with. If some of the {@code filePaths} are relative paths,
|
||||
* then they are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setFiles(FilePayload[] files) {
|
||||
setFiles(files, null);
|
||||
@ -118,6 +138,8 @@ public interface FileChooser {
|
||||
/**
|
||||
* Sets the value of the file input this chooser is associated with. If some of the {@code filePaths} are relative paths,
|
||||
* then they are resolved relative to the current working directory. For empty array, clears the selected files.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void setFiles(FilePayload[] files, SetFilesOptions options);
|
||||
}
|
||||
|
||||
@ -2352,6 +2352,8 @@ public interface Frame {
|
||||
* Returns the added tag when the script's onload fires or when the script content was injected into frame.
|
||||
*
|
||||
* <p> Adds a {@code <script>} tag into the page with the desired url or content.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default ElementHandle addScriptTag() {
|
||||
return addScriptTag(null);
|
||||
@ -2360,6 +2362,8 @@ public interface Frame {
|
||||
* Returns the added tag when the script's onload fires or when the script content was injected into frame.
|
||||
*
|
||||
* <p> Adds a {@code <script>} tag into the page with the desired url or content.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
ElementHandle addScriptTag(AddScriptTagOptions options);
|
||||
/**
|
||||
@ -2367,6 +2371,8 @@ public interface Frame {
|
||||
*
|
||||
* <p> Adds a {@code <link rel="stylesheet">} tag into the page with the desired url or a {@code <style type="text/css">} tag
|
||||
* with the content.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default ElementHandle addStyleTag() {
|
||||
return addStyleTag(null);
|
||||
@ -2376,6 +2382,8 @@ public interface Frame {
|
||||
*
|
||||
* <p> Adds a {@code <link rel="stylesheet">} tag into the page with the desired url or a {@code <style type="text/css">} tag
|
||||
* with the content.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
ElementHandle addStyleTag(AddStyleTagOptions options);
|
||||
/**
|
||||
@ -2396,6 +2404,7 @@ public interface Frame {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void check(String selector) {
|
||||
check(selector, null);
|
||||
@ -2418,8 +2427,14 @@ public interface Frame {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void check(String selector, CheckOptions options);
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
List<Frame> childFrames();
|
||||
/**
|
||||
* This method clicks an element matching {@code selector} by performing the following steps:
|
||||
@ -2436,6 +2451,7 @@ public interface Frame {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void click(String selector) {
|
||||
click(selector, null);
|
||||
@ -2455,10 +2471,13 @@ public interface Frame {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void click(String selector, ClickOptions options);
|
||||
/**
|
||||
* Gets the full HTML contents of the frame, including the doctype.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String content();
|
||||
/**
|
||||
@ -2479,6 +2498,7 @@ public interface Frame {
|
||||
* <p> <strong>NOTE:</strong> {@code frame.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void dblclick(String selector) {
|
||||
dblclick(selector, null);
|
||||
@ -2501,6 +2521,7 @@ public interface Frame {
|
||||
* <p> <strong>NOTE:</strong> {@code frame.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void dblclick(String selector, DblclickOptions options);
|
||||
/**
|
||||
@ -2540,6 +2561,7 @@ public interface Frame {
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
|
||||
* @param eventInit Optional event-specific initialization properties.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void dispatchEvent(String selector, String type, Object eventInit) {
|
||||
dispatchEvent(selector, type, eventInit, null);
|
||||
@ -2580,6 +2602,7 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void dispatchEvent(String selector, String type) {
|
||||
dispatchEvent(selector, type, null);
|
||||
@ -2621,6 +2644,7 @@ public interface Frame {
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
|
||||
* @param eventInit Optional event-specific initialization properties.
|
||||
* @since v1.8
|
||||
*/
|
||||
void dispatchEvent(String selector, String type, Object eventInit, DispatchEventOptions options);
|
||||
/**
|
||||
@ -2630,6 +2654,7 @@ public interface Frame {
|
||||
* used.
|
||||
* @param target A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first will
|
||||
* be used.
|
||||
* @since v1.13
|
||||
*/
|
||||
default void dragAndDrop(String source, String target) {
|
||||
dragAndDrop(source, target, null);
|
||||
@ -2641,6 +2666,7 @@ public interface Frame {
|
||||
* used.
|
||||
* @param target A selector to search for an element to drop onto. If there are multiple elements satisfying the selector, the first will
|
||||
* be used.
|
||||
* @since v1.13
|
||||
*/
|
||||
void dragAndDrop(String source, String target, DragAndDropOptions options);
|
||||
/**
|
||||
@ -2664,6 +2690,7 @@ public interface Frame {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.9
|
||||
*/
|
||||
default Object evalOnSelector(String selector, String expression, Object arg) {
|
||||
return evalOnSelector(selector, expression, arg, null);
|
||||
@ -2688,6 +2715,7 @@ public interface Frame {
|
||||
* @param selector A selector to query for.
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.9
|
||||
*/
|
||||
default Object evalOnSelector(String selector, String expression) {
|
||||
return evalOnSelector(selector, expression, null);
|
||||
@ -2713,6 +2741,7 @@ public interface Frame {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.9
|
||||
*/
|
||||
Object evalOnSelector(String selector, String expression, Object arg, EvalOnSelectorOptions options);
|
||||
/**
|
||||
@ -2733,6 +2762,7 @@ public interface Frame {
|
||||
* @param selector A selector to query for.
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.9
|
||||
*/
|
||||
default Object evalOnSelectorAll(String selector, String expression) {
|
||||
return evalOnSelectorAll(selector, expression, null);
|
||||
@ -2756,6 +2786,7 @@ public interface Frame {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.9
|
||||
*/
|
||||
Object evalOnSelectorAll(String selector, String expression, Object arg);
|
||||
/**
|
||||
@ -2791,6 +2822,7 @@ public interface Frame {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.8
|
||||
*/
|
||||
default Object evaluate(String expression) {
|
||||
return evaluate(expression, null);
|
||||
@ -2829,6 +2861,7 @@ public interface Frame {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.8
|
||||
*/
|
||||
Object evaluate(String expression, Object arg);
|
||||
/**
|
||||
@ -2862,6 +2895,7 @@ public interface Frame {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.8
|
||||
*/
|
||||
default JSHandle evaluateHandle(String expression) {
|
||||
return evaluateHandle(expression, null);
|
||||
@ -2898,6 +2932,7 @@ public interface Frame {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.8
|
||||
*/
|
||||
JSHandle evaluateHandle(String expression, Object arg);
|
||||
/**
|
||||
@ -2914,6 +2949,7 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param value Value to fill for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void fill(String selector, String value) {
|
||||
fill(selector, value, null);
|
||||
@ -2932,6 +2968,7 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param value Value to fill for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
|
||||
* @since v1.8
|
||||
*/
|
||||
void fill(String selector, String value, FillOptions options);
|
||||
/**
|
||||
@ -2939,6 +2976,7 @@ public interface Frame {
|
||||
* the method waits until a matching element appears in the DOM.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void focus(String selector) {
|
||||
focus(selector, null);
|
||||
@ -2948,6 +2986,7 @@ public interface Frame {
|
||||
* the method waits until a matching element appears in the DOM.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void focus(String selector, FocusOptions options);
|
||||
/**
|
||||
@ -2964,6 +3003,8 @@ public interface Frame {
|
||||
* Frame contentFrame = frameElement.contentFrame();
|
||||
* System.out.println(frame == contentFrame); // -> true
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
ElementHandle frameElement();
|
||||
/**
|
||||
@ -2980,6 +3021,7 @@ public interface Frame {
|
||||
* }</pre>
|
||||
*
|
||||
* @param selector A selector to use when resolving DOM element.
|
||||
* @since v1.17
|
||||
*/
|
||||
FrameLocator frameLocator(String selector);
|
||||
/**
|
||||
@ -2987,6 +3029,7 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param name Attribute name to get the value for.
|
||||
* @since v1.8
|
||||
*/
|
||||
default String getAttribute(String selector, String name) {
|
||||
return getAttribute(selector, name, null);
|
||||
@ -2996,12 +3039,14 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param name Attribute name to get the value for.
|
||||
* @since v1.8
|
||||
*/
|
||||
String getAttribute(String selector, String name, GetAttributeOptions options);
|
||||
/**
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByAltText(String text) {
|
||||
return getByAltText(text, null);
|
||||
@ -3010,12 +3055,14 @@ public interface Frame {
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByAltText(String text, GetByAltTextOptions options);
|
||||
/**
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByAltText(Pattern text) {
|
||||
return getByAltText(text, null);
|
||||
@ -3024,6 +3071,7 @@ public interface Frame {
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByAltText(Pattern text, GetByAltTextOptions options);
|
||||
/**
|
||||
@ -3031,6 +3079,7 @@ public interface Frame {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByLabel(String text) {
|
||||
return getByLabel(text, null);
|
||||
@ -3040,6 +3089,7 @@ public interface Frame {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByLabel(String text, GetByLabelOptions options);
|
||||
/**
|
||||
@ -3047,6 +3097,7 @@ public interface Frame {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByLabel(Pattern text) {
|
||||
return getByLabel(text, null);
|
||||
@ -3056,6 +3107,7 @@ public interface Frame {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByLabel(Pattern text, GetByLabelOptions options);
|
||||
/**
|
||||
@ -3063,6 +3115,7 @@ public interface Frame {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByPlaceholder(String text) {
|
||||
return getByPlaceholder(text, null);
|
||||
@ -3072,6 +3125,7 @@ public interface Frame {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByPlaceholder(String text, GetByPlaceholderOptions options);
|
||||
/**
|
||||
@ -3079,6 +3133,7 @@ public interface Frame {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByPlaceholder(Pattern text) {
|
||||
return getByPlaceholder(text, null);
|
||||
@ -3088,6 +3143,7 @@ public interface Frame {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByPlaceholder(Pattern text, GetByPlaceholderOptions options);
|
||||
/**
|
||||
@ -3103,6 +3159,7 @@ public interface Frame {
|
||||
* aria-*} attributes to default values.
|
||||
*
|
||||
* @param role Required aria role.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByRole(AriaRole role) {
|
||||
return getByRole(role, null);
|
||||
@ -3120,6 +3177,7 @@ public interface Frame {
|
||||
* aria-*} attributes to default values.
|
||||
*
|
||||
* @param role Required aria role.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByRole(AriaRole role, GetByRoleOptions options);
|
||||
/**
|
||||
@ -3127,6 +3185,7 @@ public interface Frame {
|
||||
* Selectors#setTestIdAttribute Selectors.setTestIdAttribute()} to configure a different test id attribute if necessary.
|
||||
*
|
||||
* @param testId Id to locate the element by.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTestId(String testId);
|
||||
/**
|
||||
@ -3134,6 +3193,7 @@ public interface Frame {
|
||||
* Selectors#setTestIdAttribute Selectors.setTestIdAttribute()} to configure a different test id attribute if necessary.
|
||||
*
|
||||
* @param testId Id to locate the element by.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTestId(Pattern testId);
|
||||
/**
|
||||
@ -3167,6 +3227,7 @@ public interface Frame {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByText(String text) {
|
||||
return getByText(text, null);
|
||||
@ -3202,6 +3263,7 @@ public interface Frame {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByText(String text, GetByTextOptions options);
|
||||
/**
|
||||
@ -3235,6 +3297,7 @@ public interface Frame {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByText(Pattern text) {
|
||||
return getByText(text, null);
|
||||
@ -3270,12 +3333,14 @@ public interface Frame {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByText(Pattern text, GetByTextOptions options);
|
||||
/**
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByTitle(String text) {
|
||||
return getByTitle(text, null);
|
||||
@ -3284,12 +3349,14 @@ public interface Frame {
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTitle(String text, GetByTitleOptions options);
|
||||
/**
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByTitle(Pattern text) {
|
||||
return getByTitle(text, null);
|
||||
@ -3298,6 +3365,7 @@ public interface Frame {
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTitle(Pattern text, GetByTitleOptions options);
|
||||
/**
|
||||
@ -3324,6 +3392,7 @@ public interface Frame {
|
||||
* href="https://bugs.chromium.org/p/chromium/issues/detail?id=761295">upstream issue</a>.
|
||||
*
|
||||
* @param url URL to navigate frame to. The url should include scheme, e.g. {@code https://}.
|
||||
* @since v1.8
|
||||
*/
|
||||
default Response navigate(String url) {
|
||||
return navigate(url, null);
|
||||
@ -3352,6 +3421,7 @@ public interface Frame {
|
||||
* href="https://bugs.chromium.org/p/chromium/issues/detail?id=761295">upstream issue</a>.
|
||||
*
|
||||
* @param url URL to navigate frame to. The url should include scheme, e.g. {@code https://}.
|
||||
* @since v1.8
|
||||
*/
|
||||
Response navigate(String url, NavigateOptions options);
|
||||
/**
|
||||
@ -3369,6 +3439,7 @@ public interface Frame {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void hover(String selector) {
|
||||
hover(selector, null);
|
||||
@ -3388,12 +3459,14 @@ public interface Frame {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void hover(String selector, HoverOptions options);
|
||||
/**
|
||||
* Returns {@code element.innerHTML}.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default String innerHTML(String selector) {
|
||||
return innerHTML(selector, null);
|
||||
@ -3402,12 +3475,14 @@ public interface Frame {
|
||||
* Returns {@code element.innerHTML}.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
String innerHTML(String selector, InnerHTMLOptions options);
|
||||
/**
|
||||
* Returns {@code element.innerText}.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default String innerText(String selector) {
|
||||
return innerText(selector, null);
|
||||
@ -3416,6 +3491,7 @@ public interface Frame {
|
||||
* Returns {@code element.innerText}.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
String innerText(String selector, InnerTextOptions options);
|
||||
/**
|
||||
@ -3426,6 +3502,7 @@ public interface Frame {
|
||||
* control.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.13
|
||||
*/
|
||||
default String inputValue(String selector) {
|
||||
return inputValue(selector, null);
|
||||
@ -3438,12 +3515,14 @@ public interface Frame {
|
||||
* control.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.13
|
||||
*/
|
||||
String inputValue(String selector, InputValueOptions options);
|
||||
/**
|
||||
* Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default boolean isChecked(String selector) {
|
||||
return isChecked(selector, null);
|
||||
@ -3452,10 +3531,13 @@ public interface Frame {
|
||||
* Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isChecked(String selector, IsCheckedOptions options);
|
||||
/**
|
||||
* Returns {@code true} if the frame has been detached, or {@code false} otherwise.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isDetached();
|
||||
/**
|
||||
@ -3463,6 +3545,7 @@ public interface Frame {
|
||||
* href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default boolean isDisabled(String selector) {
|
||||
return isDisabled(selector, null);
|
||||
@ -3472,12 +3555,14 @@ public interface Frame {
|
||||
* href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isDisabled(String selector, IsDisabledOptions options);
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#editable">editable</a>.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default boolean isEditable(String selector) {
|
||||
return isEditable(selector, null);
|
||||
@ -3486,12 +3571,14 @@ public interface Frame {
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#editable">editable</a>.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isEditable(String selector, IsEditableOptions options);
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default boolean isEnabled(String selector) {
|
||||
return isEnabled(selector, null);
|
||||
@ -3500,6 +3587,7 @@ public interface Frame {
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isEnabled(String selector, IsEnabledOptions options);
|
||||
/**
|
||||
@ -3508,6 +3596,7 @@ public interface Frame {
|
||||
* elements is considered hidden.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default boolean isHidden(String selector) {
|
||||
return isHidden(selector, null);
|
||||
@ -3518,6 +3607,7 @@ public interface Frame {
|
||||
* elements is considered hidden.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isHidden(String selector, IsHiddenOptions options);
|
||||
/**
|
||||
@ -3525,6 +3615,7 @@ public interface Frame {
|
||||
* selector} that does not match any elements is considered not visible.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default boolean isVisible(String selector) {
|
||||
return isVisible(selector, null);
|
||||
@ -3534,6 +3625,7 @@ public interface Frame {
|
||||
* selector} that does not match any elements is considered not visible.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isVisible(String selector, IsVisibleOptions options);
|
||||
/**
|
||||
@ -3546,6 +3638,7 @@ public interface Frame {
|
||||
* <p> <a href="https://playwright.dev/java/docs/locators">Learn more about locators</a>.
|
||||
*
|
||||
* @param selector A selector to use when resolving DOM element.
|
||||
* @since v1.14
|
||||
*/
|
||||
default Locator locator(String selector) {
|
||||
return locator(selector, null);
|
||||
@ -3560,6 +3653,7 @@ public interface Frame {
|
||||
* <p> <a href="https://playwright.dev/java/docs/locators">Learn more about locators</a>.
|
||||
*
|
||||
* @param selector A selector to use when resolving DOM element.
|
||||
* @since v1.14
|
||||
*/
|
||||
Locator locator(String selector, LocatorOptions options);
|
||||
/**
|
||||
@ -3568,14 +3662,20 @@ public interface Frame {
|
||||
* <p> If the name is empty, returns the id attribute instead.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> This value is calculated once when the frame is created, and will not update if the attribute is changed later.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String name();
|
||||
/**
|
||||
* Returns the page containing this frame.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Page page();
|
||||
/**
|
||||
* Parent frame, if any. Detached frames and main frames return {@code null}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Frame parentFrame();
|
||||
/**
|
||||
@ -3602,6 +3702,7 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void press(String selector, String key) {
|
||||
press(selector, key, null);
|
||||
@ -3630,6 +3731,7 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.8
|
||||
*/
|
||||
void press(String selector, String key, PressOptions options);
|
||||
/**
|
||||
@ -3641,6 +3743,7 @@ public interface Frame {
|
||||
* {@code null}.
|
||||
*
|
||||
* @param selector A selector to query for.
|
||||
* @since v1.9
|
||||
*/
|
||||
default ElementHandle querySelector(String selector) {
|
||||
return querySelector(selector, null);
|
||||
@ -3654,6 +3757,7 @@ public interface Frame {
|
||||
* {@code null}.
|
||||
*
|
||||
* @param selector A selector to query for.
|
||||
* @since v1.9
|
||||
*/
|
||||
ElementHandle querySelector(String selector, QuerySelectorOptions options);
|
||||
/**
|
||||
@ -3665,6 +3769,7 @@ public interface Frame {
|
||||
* returns empty array.
|
||||
*
|
||||
* @param selector A selector to query for.
|
||||
* @since v1.9
|
||||
*/
|
||||
List<ElementHandle> querySelectorAll(String selector);
|
||||
/**
|
||||
@ -3695,6 +3800,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(String selector, String values) {
|
||||
return selectOption(selector, values, null);
|
||||
@ -3727,6 +3833,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(String selector, String values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3757,6 +3864,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(String selector, ElementHandle values) {
|
||||
return selectOption(selector, values, null);
|
||||
@ -3789,6 +3897,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(String selector, ElementHandle values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3819,6 +3928,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(String selector, String[] values) {
|
||||
return selectOption(selector, values, null);
|
||||
@ -3851,6 +3961,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(String selector, String[] values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3881,6 +3992,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(String selector, SelectOption values) {
|
||||
return selectOption(selector, values, null);
|
||||
@ -3913,6 +4025,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(String selector, SelectOption values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3943,6 +4056,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(String selector, ElementHandle[] values) {
|
||||
return selectOption(selector, values, null);
|
||||
@ -3975,6 +4089,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(String selector, ElementHandle[] values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -4005,6 +4120,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
default List<String> selectOption(String selector, SelectOption[] values) {
|
||||
return selectOption(selector, values, null);
|
||||
@ -4037,6 +4153,7 @@ public interface Frame {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.8
|
||||
*/
|
||||
List<String> selectOption(String selector, SelectOption[] values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -4058,6 +4175,7 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param checked Whether to check or uncheck the checkbox.
|
||||
* @since v1.15
|
||||
*/
|
||||
default void setChecked(String selector, boolean checked) {
|
||||
setChecked(selector, checked, null);
|
||||
@ -4081,12 +4199,14 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param checked Whether to check or uncheck the checkbox.
|
||||
* @since v1.15
|
||||
*/
|
||||
void setChecked(String selector, boolean checked, SetCheckedOptions options);
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param html HTML markup to assign to the page.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setContent(String html) {
|
||||
setContent(html, null);
|
||||
@ -4095,6 +4215,7 @@ public interface Frame {
|
||||
*
|
||||
*
|
||||
* @param html HTML markup to assign to the page.
|
||||
* @since v1.8
|
||||
*/
|
||||
void setContent(String html, SetContentOptions options);
|
||||
/**
|
||||
@ -4108,6 +4229,7 @@ public interface Frame {
|
||||
* instead.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setInputFiles(String selector, Path files) {
|
||||
setInputFiles(selector, files, null);
|
||||
@ -4123,6 +4245,7 @@ public interface Frame {
|
||||
* instead.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void setInputFiles(String selector, Path files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -4136,6 +4259,7 @@ public interface Frame {
|
||||
* instead.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setInputFiles(String selector, Path[] files) {
|
||||
setInputFiles(selector, files, null);
|
||||
@ -4151,6 +4275,7 @@ public interface Frame {
|
||||
* instead.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void setInputFiles(String selector, Path[] files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -4164,6 +4289,7 @@ public interface Frame {
|
||||
* instead.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setInputFiles(String selector, FilePayload files) {
|
||||
setInputFiles(selector, files, null);
|
||||
@ -4179,6 +4305,7 @@ public interface Frame {
|
||||
* instead.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void setInputFiles(String selector, FilePayload files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -4192,6 +4319,7 @@ public interface Frame {
|
||||
* instead.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void setInputFiles(String selector, FilePayload[] files) {
|
||||
setInputFiles(selector, files, null);
|
||||
@ -4207,6 +4335,7 @@ public interface Frame {
|
||||
* instead.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void setInputFiles(String selector, FilePayload[] files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -4226,6 +4355,7 @@ public interface Frame {
|
||||
* <p> <strong>NOTE:</strong> {@code frame.tap()} requires that the {@code hasTouch} option of the browser context be set to true.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void tap(String selector) {
|
||||
tap(selector, null);
|
||||
@ -4247,12 +4377,14 @@ public interface Frame {
|
||||
* <p> <strong>NOTE:</strong> {@code frame.tap()} requires that the {@code hasTouch} option of the browser context be set to true.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void tap(String selector, TapOptions options);
|
||||
/**
|
||||
* Returns {@code element.textContent}.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default String textContent(String selector) {
|
||||
return textContent(selector, null);
|
||||
@ -4261,10 +4393,13 @@ public interface Frame {
|
||||
* Returns {@code element.textContent}.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
String textContent(String selector, TextContentOptions options);
|
||||
/**
|
||||
* Returns the page title.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String title();
|
||||
/**
|
||||
@ -4284,6 +4419,7 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param text A text to type into a focused element.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void type(String selector, String text) {
|
||||
type(selector, text, null);
|
||||
@ -4305,6 +4441,7 @@ public interface Frame {
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @param text A text to type into a focused element.
|
||||
* @since v1.8
|
||||
*/
|
||||
void type(String selector, String text, TypeOptions options);
|
||||
/**
|
||||
@ -4325,6 +4462,7 @@ public interface Frame {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void uncheck(String selector) {
|
||||
uncheck(selector, null);
|
||||
@ -4347,10 +4485,13 @@ public interface Frame {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param selector A selector to search for an element. If there are multiple elements satisfying the selector, the first will be used.
|
||||
* @since v1.8
|
||||
*/
|
||||
void uncheck(String selector, UncheckOptions options);
|
||||
/**
|
||||
* Returns frame's url.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String url();
|
||||
/**
|
||||
@ -4385,6 +4526,7 @@ public interface Frame {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.8
|
||||
*/
|
||||
default JSHandle waitForFunction(String expression, Object arg) {
|
||||
return waitForFunction(expression, arg, null);
|
||||
@ -4420,6 +4562,7 @@ public interface Frame {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.8
|
||||
*/
|
||||
default JSHandle waitForFunction(String expression) {
|
||||
return waitForFunction(expression, null);
|
||||
@ -4456,6 +4599,7 @@ public interface Frame {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.8
|
||||
*/
|
||||
JSHandle waitForFunction(String expression, Object arg, WaitForFunctionOptions options);
|
||||
/**
|
||||
@ -4477,6 +4621,7 @@ public interface Frame {
|
||||
* <li> {@code "domcontentloaded"} - wait for the {@code DOMContentLoaded} event to be fired.</li>
|
||||
* <li> {@code "networkidle"} - wait until there are no network connections for at least {@code 500} ms.</li>
|
||||
* </ul>
|
||||
* @since v1.8
|
||||
*/
|
||||
default void waitForLoadState(LoadState state) {
|
||||
waitForLoadState(state, null);
|
||||
@ -4492,6 +4637,8 @@ public interface Frame {
|
||||
* frame.click("button"); // Click triggers navigation.
|
||||
* frame.waitForLoadState(); // Waits for "load" state by default.
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void waitForLoadState() {
|
||||
waitForLoadState(null);
|
||||
@ -4515,6 +4662,7 @@ public interface Frame {
|
||||
* <li> {@code "domcontentloaded"} - wait for the {@code DOMContentLoaded} event to be fired.</li>
|
||||
* <li> {@code "networkidle"} - wait until there are no network connections for at least {@code 500} ms.</li>
|
||||
* </ul>
|
||||
* @since v1.8
|
||||
*/
|
||||
void waitForLoadState(LoadState state, WaitForLoadStateOptions options);
|
||||
/**
|
||||
@ -4538,6 +4686,7 @@ public interface Frame {
|
||||
* considered a navigation.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.8
|
||||
*/
|
||||
default Response waitForNavigation(Runnable callback) {
|
||||
return waitForNavigation(null, callback);
|
||||
@ -4563,6 +4712,7 @@ public interface Frame {
|
||||
* considered a navigation.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.8
|
||||
*/
|
||||
Response waitForNavigation(WaitForNavigationOptions options, Runnable callback);
|
||||
/**
|
||||
@ -4601,6 +4751,7 @@ public interface Frame {
|
||||
* }</pre>
|
||||
*
|
||||
* @param selector A selector to query for.
|
||||
* @since v1.8
|
||||
*/
|
||||
default ElementHandle waitForSelector(String selector) {
|
||||
return waitForSelector(selector, null);
|
||||
@ -4641,6 +4792,7 @@ public interface Frame {
|
||||
* }</pre>
|
||||
*
|
||||
* @param selector A selector to query for.
|
||||
* @since v1.8
|
||||
*/
|
||||
ElementHandle waitForSelector(String selector, WaitForSelectorOptions options);
|
||||
/**
|
||||
@ -4650,6 +4802,7 @@ public interface Frame {
|
||||
* going to be flaky. Use signals such as network events, selectors becoming visible and others instead.
|
||||
*
|
||||
* @param timeout A timeout to wait for
|
||||
* @since v1.8
|
||||
*/
|
||||
void waitForTimeout(double timeout);
|
||||
/**
|
||||
@ -4664,6 +4817,7 @@ public interface Frame {
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
|
||||
* parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to
|
||||
* the string.
|
||||
* @since v1.11
|
||||
*/
|
||||
default void waitForURL(String url) {
|
||||
waitForURL(url, null);
|
||||
@ -4680,6 +4834,7 @@ public interface Frame {
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
|
||||
* parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to
|
||||
* the string.
|
||||
* @since v1.11
|
||||
*/
|
||||
void waitForURL(String url, WaitForURLOptions options);
|
||||
/**
|
||||
@ -4694,6 +4849,7 @@ public interface Frame {
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
|
||||
* parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to
|
||||
* the string.
|
||||
* @since v1.11
|
||||
*/
|
||||
default void waitForURL(Pattern url) {
|
||||
waitForURL(url, null);
|
||||
@ -4710,6 +4866,7 @@ public interface Frame {
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
|
||||
* parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to
|
||||
* the string.
|
||||
* @since v1.11
|
||||
*/
|
||||
void waitForURL(Pattern url, WaitForURLOptions options);
|
||||
/**
|
||||
@ -4724,6 +4881,7 @@ public interface Frame {
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
|
||||
* parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to
|
||||
* the string.
|
||||
* @since v1.11
|
||||
*/
|
||||
default void waitForURL(Predicate<String> url) {
|
||||
waitForURL(url, null);
|
||||
@ -4740,6 +4898,7 @@ public interface Frame {
|
||||
* @param url A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. Note that if the
|
||||
* parameter is a string without wildcard characters, the method will wait for navigation to URL that is exactly equal to
|
||||
* the string.
|
||||
* @since v1.11
|
||||
*/
|
||||
void waitForURL(Predicate<String> url, WaitForURLOptions options);
|
||||
}
|
||||
|
||||
@ -329,6 +329,8 @@ public interface FrameLocator {
|
||||
}
|
||||
/**
|
||||
* Returns locator to the first matching frame.
|
||||
*
|
||||
* @since v1.17
|
||||
*/
|
||||
FrameLocator first();
|
||||
/**
|
||||
@ -336,12 +338,14 @@ public interface FrameLocator {
|
||||
* that iframe.
|
||||
*
|
||||
* @param selector A selector to use when resolving DOM element.
|
||||
* @since v1.17
|
||||
*/
|
||||
FrameLocator frameLocator(String selector);
|
||||
/**
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByAltText(String text) {
|
||||
return getByAltText(text, null);
|
||||
@ -350,12 +354,14 @@ public interface FrameLocator {
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByAltText(String text, GetByAltTextOptions options);
|
||||
/**
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByAltText(Pattern text) {
|
||||
return getByAltText(text, null);
|
||||
@ -364,6 +370,7 @@ public interface FrameLocator {
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByAltText(Pattern text, GetByAltTextOptions options);
|
||||
/**
|
||||
@ -371,6 +378,7 @@ public interface FrameLocator {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByLabel(String text) {
|
||||
return getByLabel(text, null);
|
||||
@ -380,6 +388,7 @@ public interface FrameLocator {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByLabel(String text, GetByLabelOptions options);
|
||||
/**
|
||||
@ -387,6 +396,7 @@ public interface FrameLocator {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByLabel(Pattern text) {
|
||||
return getByLabel(text, null);
|
||||
@ -396,6 +406,7 @@ public interface FrameLocator {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByLabel(Pattern text, GetByLabelOptions options);
|
||||
/**
|
||||
@ -403,6 +414,7 @@ public interface FrameLocator {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByPlaceholder(String text) {
|
||||
return getByPlaceholder(text, null);
|
||||
@ -412,6 +424,7 @@ public interface FrameLocator {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByPlaceholder(String text, GetByPlaceholderOptions options);
|
||||
/**
|
||||
@ -419,6 +432,7 @@ public interface FrameLocator {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByPlaceholder(Pattern text) {
|
||||
return getByPlaceholder(text, null);
|
||||
@ -428,6 +442,7 @@ public interface FrameLocator {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByPlaceholder(Pattern text, GetByPlaceholderOptions options);
|
||||
/**
|
||||
@ -443,6 +458,7 @@ public interface FrameLocator {
|
||||
* aria-*} attributes to default values.
|
||||
*
|
||||
* @param role Required aria role.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByRole(AriaRole role) {
|
||||
return getByRole(role, null);
|
||||
@ -460,6 +476,7 @@ public interface FrameLocator {
|
||||
* aria-*} attributes to default values.
|
||||
*
|
||||
* @param role Required aria role.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByRole(AriaRole role, GetByRoleOptions options);
|
||||
/**
|
||||
@ -467,6 +484,7 @@ public interface FrameLocator {
|
||||
* Selectors#setTestIdAttribute Selectors.setTestIdAttribute()} to configure a different test id attribute if necessary.
|
||||
*
|
||||
* @param testId Id to locate the element by.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTestId(String testId);
|
||||
/**
|
||||
@ -474,6 +492,7 @@ public interface FrameLocator {
|
||||
* Selectors#setTestIdAttribute Selectors.setTestIdAttribute()} to configure a different test id attribute if necessary.
|
||||
*
|
||||
* @param testId Id to locate the element by.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTestId(Pattern testId);
|
||||
/**
|
||||
@ -507,6 +526,7 @@ public interface FrameLocator {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByText(String text) {
|
||||
return getByText(text, null);
|
||||
@ -542,6 +562,7 @@ public interface FrameLocator {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByText(String text, GetByTextOptions options);
|
||||
/**
|
||||
@ -575,6 +596,7 @@ public interface FrameLocator {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByText(Pattern text) {
|
||||
return getByText(text, null);
|
||||
@ -610,12 +632,14 @@ public interface FrameLocator {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByText(Pattern text, GetByTextOptions options);
|
||||
/**
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByTitle(String text) {
|
||||
return getByTitle(text, null);
|
||||
@ -624,12 +648,14 @@ public interface FrameLocator {
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTitle(String text, GetByTitleOptions options);
|
||||
/**
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByTitle(Pattern text) {
|
||||
return getByTitle(text, null);
|
||||
@ -638,10 +664,13 @@ public interface FrameLocator {
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTitle(Pattern text, GetByTitleOptions options);
|
||||
/**
|
||||
* Returns locator to the last matching frame.
|
||||
*
|
||||
* @since v1.17
|
||||
*/
|
||||
FrameLocator last();
|
||||
/**
|
||||
@ -651,6 +680,7 @@ public interface FrameLocator {
|
||||
* <p> <a href="https://playwright.dev/java/docs/locators">Learn more about locators</a>.
|
||||
*
|
||||
* @param selector A selector to use when resolving DOM element.
|
||||
* @since v1.17
|
||||
*/
|
||||
default Locator locator(String selector) {
|
||||
return locator(selector, null);
|
||||
@ -662,10 +692,13 @@ public interface FrameLocator {
|
||||
* <p> <a href="https://playwright.dev/java/docs/locators">Learn more about locators</a>.
|
||||
*
|
||||
* @param selector A selector to use when resolving DOM element.
|
||||
* @since v1.17
|
||||
*/
|
||||
Locator locator(String selector, LocatorOptions options);
|
||||
/**
|
||||
* Returns locator to the n-th matching frame. It's zero based, {@code nth(0)} selects the first frame.
|
||||
*
|
||||
* @since v1.17
|
||||
*/
|
||||
FrameLocator nth(int index);
|
||||
}
|
||||
|
||||
@ -36,10 +36,14 @@ import java.util.*;
|
||||
public interface JSHandle {
|
||||
/**
|
||||
* Returns either {@code null} or the object handle itself, if the object handle is an instance of {@code ElementHandle}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
ElementHandle asElement();
|
||||
/**
|
||||
* The {@code jsHandle.dispose} method stops referencing the element handle.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void dispose();
|
||||
/**
|
||||
@ -59,6 +63,7 @@ public interface JSHandle {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.8
|
||||
*/
|
||||
default Object evaluate(String expression) {
|
||||
return evaluate(expression, null);
|
||||
@ -81,6 +86,7 @@ public interface JSHandle {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.8
|
||||
*/
|
||||
Object evaluate(String expression, Object arg);
|
||||
/**
|
||||
@ -99,6 +105,7 @@ public interface JSHandle {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.8
|
||||
*/
|
||||
default JSHandle evaluateHandle(String expression) {
|
||||
return evaluateHandle(expression, null);
|
||||
@ -120,6 +127,7 @@ public interface JSHandle {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.8
|
||||
*/
|
||||
JSHandle evaluateHandle(String expression, Object arg);
|
||||
/**
|
||||
@ -133,12 +141,15 @@ public interface JSHandle {
|
||||
* JSHandle documentHandle = properties.get("document");
|
||||
* handle.dispose();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Map<String, JSHandle> getProperties();
|
||||
/**
|
||||
* Fetches a single property from the referenced object.
|
||||
*
|
||||
* @param propertyName property to get
|
||||
* @since v1.8
|
||||
*/
|
||||
JSHandle getProperty(String propertyName);
|
||||
/**
|
||||
@ -146,6 +157,8 @@ public interface JSHandle {
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> The method will return an empty JSON object if the referenced object is not stringifiable. It will throw an error if the
|
||||
* object has circular references.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Object jsonValue();
|
||||
}
|
||||
|
||||
@ -113,6 +113,7 @@ public interface Keyboard {
|
||||
* <p> <strong>NOTE:</strong> Modifier keys DO influence {@code keyboard.down}. Holding down {@code Shift} will type the text in upper case.
|
||||
*
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.8
|
||||
*/
|
||||
void down(String key);
|
||||
/**
|
||||
@ -127,6 +128,7 @@ public interface Keyboard {
|
||||
* case.
|
||||
*
|
||||
* @param text Sets input to the specified text value.
|
||||
* @since v1.8
|
||||
*/
|
||||
void insertText(String text);
|
||||
/**
|
||||
@ -167,6 +169,7 @@ public interface Keyboard {
|
||||
* <p> Shortcut for {@link Keyboard#down Keyboard.down()} and {@link Keyboard#up Keyboard.up()}.
|
||||
*
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void press(String key) {
|
||||
press(key, null);
|
||||
@ -209,6 +212,7 @@ public interface Keyboard {
|
||||
* <p> Shortcut for {@link Keyboard#down Keyboard.down()} and {@link Keyboard#up Keyboard.up()}.
|
||||
*
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.8
|
||||
*/
|
||||
void press(String key, PressOptions options);
|
||||
/**
|
||||
@ -229,6 +233,7 @@ public interface Keyboard {
|
||||
* <p> <strong>NOTE:</strong> For characters that are not on a US keyboard, only an {@code input} event will be sent.
|
||||
*
|
||||
* @param text A text to type into a focused element.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void type(String text) {
|
||||
type(text, null);
|
||||
@ -251,12 +256,14 @@ public interface Keyboard {
|
||||
* <p> <strong>NOTE:</strong> For characters that are not on a US keyboard, only an {@code input} event will be sent.
|
||||
*
|
||||
* @param text A text to type into a focused element.
|
||||
* @since v1.8
|
||||
*/
|
||||
void type(String text, TypeOptions options);
|
||||
/**
|
||||
* Dispatches a {@code keyup} event.
|
||||
*
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.8
|
||||
*/
|
||||
void up(String key);
|
||||
}
|
||||
|
||||
@ -1945,24 +1945,34 @@ public interface Locator {
|
||||
* for (Locator li : page.getByRole('listitem').all())
|
||||
* li.click();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.29
|
||||
*/
|
||||
List<Locator> all();
|
||||
/**
|
||||
* Returns an array of {@code node.innerText} values for all matching nodes.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
List<String> allInnerTexts();
|
||||
/**
|
||||
* Returns an array of {@code node.textContent} values for all matching nodes.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
List<String> allTextContents();
|
||||
/**
|
||||
* Calls <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur">blur</a> on the element.
|
||||
*
|
||||
* @since v1.28
|
||||
*/
|
||||
default void blur() {
|
||||
blur(null);
|
||||
}
|
||||
/**
|
||||
* Calls <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/blur">blur</a> on the element.
|
||||
*
|
||||
* @since v1.28
|
||||
*/
|
||||
void blur(BlurOptions options);
|
||||
/**
|
||||
@ -1984,6 +1994,8 @@ public interface Locator {
|
||||
* BoundingBox box = element.boundingBox();
|
||||
* page.mouse().click(box.x + box.width / 2, box.y + box.height / 2);
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default BoundingBox boundingBox() {
|
||||
return boundingBox(null);
|
||||
@ -2007,6 +2019,8 @@ public interface Locator {
|
||||
* BoundingBox box = element.boundingBox();
|
||||
* page.mouse().click(box.x + box.width / 2, box.y + box.height / 2);
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
BoundingBox boundingBox(BoundingBoxOptions options);
|
||||
/**
|
||||
@ -2026,6 +2040,8 @@ public interface Locator {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void check() {
|
||||
check(null);
|
||||
@ -2047,6 +2063,8 @@ public interface Locator {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void check(CheckOptions options);
|
||||
/**
|
||||
@ -2057,6 +2075,8 @@ public interface Locator {
|
||||
* throws an error. However, if the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be
|
||||
* cleared instead.
|
||||
*
|
||||
* @since v1.28
|
||||
*/
|
||||
default void clear() {
|
||||
clear(null);
|
||||
@ -2069,6 +2089,8 @@ public interface Locator {
|
||||
* throws an error. However, if the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, the control will be
|
||||
* cleared instead.
|
||||
*
|
||||
* @since v1.28
|
||||
*/
|
||||
void clear(ClearOptions options);
|
||||
/**
|
||||
@ -2089,6 +2111,8 @@ public interface Locator {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void click() {
|
||||
click(null);
|
||||
@ -2111,10 +2135,14 @@ public interface Locator {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void click(ClickOptions options);
|
||||
/**
|
||||
* Returns the number of elements matching given selector.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
int count();
|
||||
/**
|
||||
@ -2134,6 +2162,8 @@ public interface Locator {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> {@code element.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void dblclick() {
|
||||
dblclick(null);
|
||||
@ -2155,6 +2185,8 @@ public interface Locator {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> {@code element.dblclick()} dispatches two {@code click} events and a single {@code dblclick} event.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void dblclick(DblclickOptions options);
|
||||
/**
|
||||
@ -2193,6 +2225,7 @@ public interface Locator {
|
||||
*
|
||||
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
|
||||
* @param eventInit Optional event-specific initialization properties.
|
||||
* @since v1.14
|
||||
*/
|
||||
default void dispatchEvent(String type, Object eventInit) {
|
||||
dispatchEvent(type, eventInit, null);
|
||||
@ -2232,6 +2265,7 @@ public interface Locator {
|
||||
* }</pre>
|
||||
*
|
||||
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
|
||||
* @since v1.14
|
||||
*/
|
||||
default void dispatchEvent(String type) {
|
||||
dispatchEvent(type, null);
|
||||
@ -2272,6 +2306,7 @@ public interface Locator {
|
||||
*
|
||||
* @param type DOM event type: {@code "click"}, {@code "dragstart"}, etc.
|
||||
* @param eventInit Optional event-specific initialization properties.
|
||||
* @since v1.14
|
||||
*/
|
||||
void dispatchEvent(String type, Object eventInit, DispatchEventOptions options);
|
||||
/**
|
||||
@ -2290,6 +2325,7 @@ public interface Locator {
|
||||
* }</pre>
|
||||
*
|
||||
* @param target Locator of the element to drag to.
|
||||
* @since v1.18
|
||||
*/
|
||||
default void dragTo(Locator target) {
|
||||
dragTo(target, null);
|
||||
@ -2310,11 +2346,14 @@ public interface Locator {
|
||||
* }</pre>
|
||||
*
|
||||
* @param target Locator of the element to drag to.
|
||||
* @since v1.18
|
||||
*/
|
||||
void dragTo(Locator target, DragToOptions options);
|
||||
/**
|
||||
* Resolves given locator to the first matching DOM element. If no elements matching the query are visible, waits for them
|
||||
* up to a given timeout. If multiple elements match the selector, throws.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default ElementHandle elementHandle() {
|
||||
return elementHandle(null);
|
||||
@ -2322,10 +2361,14 @@ public interface Locator {
|
||||
/**
|
||||
* Resolves given locator to the first matching DOM element. If no elements matching the query are visible, waits for them
|
||||
* up to a given timeout. If multiple elements match the selector, throws.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
ElementHandle elementHandle(ElementHandleOptions options);
|
||||
/**
|
||||
* Resolves given locator to all matching DOM elements.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
List<ElementHandle> elementHandles();
|
||||
/**
|
||||
@ -2346,6 +2389,7 @@ public interface Locator {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.14
|
||||
*/
|
||||
default Object evaluate(String expression, Object arg) {
|
||||
return evaluate(expression, arg, null);
|
||||
@ -2367,6 +2411,7 @@ public interface Locator {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.14
|
||||
*/
|
||||
default Object evaluate(String expression) {
|
||||
return evaluate(expression, null);
|
||||
@ -2389,6 +2434,7 @@ public interface Locator {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.14
|
||||
*/
|
||||
Object evaluate(String expression, Object arg, EvaluateOptions options);
|
||||
/**
|
||||
@ -2407,6 +2453,7 @@ public interface Locator {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.14
|
||||
*/
|
||||
default Object evaluateAll(String expression) {
|
||||
return evaluateAll(expression, null);
|
||||
@ -2428,6 +2475,7 @@ public interface Locator {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.14
|
||||
*/
|
||||
Object evaluateAll(String expression, Object arg);
|
||||
/**
|
||||
@ -2447,6 +2495,7 @@ public interface Locator {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.14
|
||||
*/
|
||||
default JSHandle evaluateHandle(String expression, Object arg) {
|
||||
return evaluateHandle(expression, arg, null);
|
||||
@ -2467,6 +2516,7 @@ public interface Locator {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.14
|
||||
*/
|
||||
default JSHandle evaluateHandle(String expression) {
|
||||
return evaluateHandle(expression, null);
|
||||
@ -2488,6 +2538,7 @@ public interface Locator {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.14
|
||||
*/
|
||||
JSHandle evaluateHandle(String expression, Object arg, EvaluateHandleOptions options);
|
||||
/**
|
||||
@ -2503,6 +2554,7 @@ public interface Locator {
|
||||
* <p> To send fine-grained keyboard events, use {@link Locator#type Locator.type()}.
|
||||
*
|
||||
* @param value Value to set for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
|
||||
* @since v1.14
|
||||
*/
|
||||
default void fill(String value) {
|
||||
fill(value, null);
|
||||
@ -2520,6 +2572,7 @@ public interface Locator {
|
||||
* <p> To send fine-grained keyboard events, use {@link Locator#type Locator.type()}.
|
||||
*
|
||||
* @param value Value to set for the {@code <input>}, {@code <textarea>} or {@code [contenteditable]} element.
|
||||
* @since v1.14
|
||||
*/
|
||||
void fill(String value, FillOptions options);
|
||||
/**
|
||||
@ -2537,6 +2590,8 @@ public interface Locator {
|
||||
* ))
|
||||
* .screenshot();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.22
|
||||
*/
|
||||
default Locator filter() {
|
||||
return filter(null);
|
||||
@ -2556,20 +2611,28 @@ public interface Locator {
|
||||
* ))
|
||||
* .screenshot();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.22
|
||||
*/
|
||||
Locator filter(FilterOptions options);
|
||||
/**
|
||||
* Returns locator to the first matching element.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
Locator first();
|
||||
/**
|
||||
* Calls <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus">focus</a> on the element.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void focus() {
|
||||
focus(null);
|
||||
}
|
||||
/**
|
||||
* Calls <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus">focus</a> on the element.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void focus(FocusOptions options);
|
||||
/**
|
||||
@ -2583,12 +2646,14 @@ public interface Locator {
|
||||
* }</pre>
|
||||
*
|
||||
* @param selector A selector to use when resolving DOM element.
|
||||
* @since v1.17
|
||||
*/
|
||||
FrameLocator frameLocator(String selector);
|
||||
/**
|
||||
* Returns element attribute value.
|
||||
*
|
||||
* @param name Attribute name to get the value for.
|
||||
* @since v1.14
|
||||
*/
|
||||
default String getAttribute(String name) {
|
||||
return getAttribute(name, null);
|
||||
@ -2597,12 +2662,14 @@ public interface Locator {
|
||||
* Returns element attribute value.
|
||||
*
|
||||
* @param name Attribute name to get the value for.
|
||||
* @since v1.14
|
||||
*/
|
||||
String getAttribute(String name, GetAttributeOptions options);
|
||||
/**
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByAltText(String text) {
|
||||
return getByAltText(text, null);
|
||||
@ -2611,12 +2678,14 @@ public interface Locator {
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByAltText(String text, GetByAltTextOptions options);
|
||||
/**
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByAltText(Pattern text) {
|
||||
return getByAltText(text, null);
|
||||
@ -2625,6 +2694,7 @@ public interface Locator {
|
||||
* Allows locating elements by their alt text. For example, this method will find the image by alt text "Castle":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByAltText(Pattern text, GetByAltTextOptions options);
|
||||
/**
|
||||
@ -2632,6 +2702,7 @@ public interface Locator {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByLabel(String text) {
|
||||
return getByLabel(text, null);
|
||||
@ -2641,6 +2712,7 @@ public interface Locator {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByLabel(String text, GetByLabelOptions options);
|
||||
/**
|
||||
@ -2648,6 +2720,7 @@ public interface Locator {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByLabel(Pattern text) {
|
||||
return getByLabel(text, null);
|
||||
@ -2657,6 +2730,7 @@ public interface Locator {
|
||||
* label text "Password" in the following DOM:
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByLabel(Pattern text, GetByLabelOptions options);
|
||||
/**
|
||||
@ -2664,6 +2738,7 @@ public interface Locator {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByPlaceholder(String text) {
|
||||
return getByPlaceholder(text, null);
|
||||
@ -2673,6 +2748,7 @@ public interface Locator {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByPlaceholder(String text, GetByPlaceholderOptions options);
|
||||
/**
|
||||
@ -2680,6 +2756,7 @@ public interface Locator {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByPlaceholder(Pattern text) {
|
||||
return getByPlaceholder(text, null);
|
||||
@ -2689,6 +2766,7 @@ public interface Locator {
|
||||
* "Country":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByPlaceholder(Pattern text, GetByPlaceholderOptions options);
|
||||
/**
|
||||
@ -2704,6 +2782,7 @@ public interface Locator {
|
||||
* aria-*} attributes to default values.
|
||||
*
|
||||
* @param role Required aria role.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByRole(AriaRole role) {
|
||||
return getByRole(role, null);
|
||||
@ -2721,6 +2800,7 @@ public interface Locator {
|
||||
* aria-*} attributes to default values.
|
||||
*
|
||||
* @param role Required aria role.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByRole(AriaRole role, GetByRoleOptions options);
|
||||
/**
|
||||
@ -2728,6 +2808,7 @@ public interface Locator {
|
||||
* Selectors#setTestIdAttribute Selectors.setTestIdAttribute()} to configure a different test id attribute if necessary.
|
||||
*
|
||||
* @param testId Id to locate the element by.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTestId(String testId);
|
||||
/**
|
||||
@ -2735,6 +2816,7 @@ public interface Locator {
|
||||
* Selectors#setTestIdAttribute Selectors.setTestIdAttribute()} to configure a different test id attribute if necessary.
|
||||
*
|
||||
* @param testId Id to locate the element by.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTestId(Pattern testId);
|
||||
/**
|
||||
@ -2768,6 +2850,7 @@ public interface Locator {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByText(String text) {
|
||||
return getByText(text, null);
|
||||
@ -2803,6 +2886,7 @@ public interface Locator {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByText(String text, GetByTextOptions options);
|
||||
/**
|
||||
@ -2836,6 +2920,7 @@ public interface Locator {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByText(Pattern text) {
|
||||
return getByText(text, null);
|
||||
@ -2871,12 +2956,14 @@ public interface Locator {
|
||||
* content. For example, locating by text {@code "Log in"} matches {@code <input type=button value="Log in">}.
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByText(Pattern text, GetByTextOptions options);
|
||||
/**
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByTitle(String text) {
|
||||
return getByTitle(text, null);
|
||||
@ -2885,12 +2972,14 @@ public interface Locator {
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTitle(String text, GetByTitleOptions options);
|
||||
/**
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
default Locator getByTitle(Pattern text) {
|
||||
return getByTitle(text, null);
|
||||
@ -2899,11 +2988,14 @@ public interface Locator {
|
||||
* Allows locating elements by their title. For example, this method will find the button by its title "Place the order":
|
||||
*
|
||||
* @param text Text to locate the element for.
|
||||
* @since v1.27
|
||||
*/
|
||||
Locator getByTitle(Pattern text, GetByTitleOptions options);
|
||||
/**
|
||||
* Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses {@link
|
||||
* Locator#highlight Locator.highlight()}.
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
void highlight();
|
||||
/**
|
||||
@ -2920,6 +3012,8 @@ public interface Locator {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void hover() {
|
||||
hover(null);
|
||||
@ -2938,26 +3032,36 @@ public interface Locator {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void hover(HoverOptions options);
|
||||
/**
|
||||
* Returns the {@code element.innerHTML}.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default String innerHTML() {
|
||||
return innerHTML(null);
|
||||
}
|
||||
/**
|
||||
* Returns the {@code element.innerHTML}.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
String innerHTML(InnerHTMLOptions options);
|
||||
/**
|
||||
* Returns the {@code element.innerText}.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default String innerText() {
|
||||
return innerText(null);
|
||||
}
|
||||
/**
|
||||
* Returns the {@code element.innerText}.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
String innerText(InnerTextOptions options);
|
||||
/**
|
||||
@ -2966,6 +3070,8 @@ public interface Locator {
|
||||
* <p> Throws for non-input elements. However, if the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, returns the value of the
|
||||
* control.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default String inputValue() {
|
||||
return inputValue(null);
|
||||
@ -2976,21 +3082,29 @@ public interface Locator {
|
||||
* <p> Throws for non-input elements. However, if the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, returns the value of the
|
||||
* control.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
String inputValue(InputValueOptions options);
|
||||
/**
|
||||
* Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default boolean isChecked() {
|
||||
return isChecked(null);
|
||||
}
|
||||
/**
|
||||
* Returns whether the element is checked. Throws if the element is not a checkbox or radio input.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
boolean isChecked(IsCheckedOptions options);
|
||||
/**
|
||||
* Returns whether the element is disabled, the opposite of <a
|
||||
* href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default boolean isDisabled() {
|
||||
return isDisabled(null);
|
||||
@ -2998,31 +3112,43 @@ public interface Locator {
|
||||
/**
|
||||
* Returns whether the element is disabled, the opposite of <a
|
||||
* href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
boolean isDisabled(IsDisabledOptions options);
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#editable">editable</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default boolean isEditable() {
|
||||
return isEditable(null);
|
||||
}
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#editable">editable</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
boolean isEditable(IsEditableOptions options);
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default boolean isEnabled() {
|
||||
return isEnabled(null);
|
||||
}
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#enabled">enabled</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
boolean isEnabled(IsEnabledOptions options);
|
||||
/**
|
||||
* Returns whether the element is hidden, the opposite of <a
|
||||
* href="https://playwright.dev/java/docs/actionability#visible">visible</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default boolean isHidden() {
|
||||
return isHidden(null);
|
||||
@ -3030,20 +3156,28 @@ public interface Locator {
|
||||
/**
|
||||
* Returns whether the element is hidden, the opposite of <a
|
||||
* href="https://playwright.dev/java/docs/actionability#visible">visible</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
boolean isHidden(IsHiddenOptions options);
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#visible">visible</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default boolean isVisible() {
|
||||
return isVisible(null);
|
||||
}
|
||||
/**
|
||||
* Returns whether the element is <a href="https://playwright.dev/java/docs/actionability#visible">visible</a>.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
boolean isVisible(IsVisibleOptions options);
|
||||
/**
|
||||
* Returns locator to the last matching element.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
Locator last();
|
||||
/**
|
||||
@ -3053,6 +3187,7 @@ public interface Locator {
|
||||
* <p> <a href="https://playwright.dev/java/docs/locators">Learn more about locators</a>.
|
||||
*
|
||||
* @param selector A selector to use when resolving DOM element.
|
||||
* @since v1.14
|
||||
*/
|
||||
default Locator locator(String selector) {
|
||||
return locator(selector, null);
|
||||
@ -3064,14 +3199,19 @@ public interface Locator {
|
||||
* <p> <a href="https://playwright.dev/java/docs/locators">Learn more about locators</a>.
|
||||
*
|
||||
* @param selector A selector to use when resolving DOM element.
|
||||
* @since v1.14
|
||||
*/
|
||||
Locator locator(String selector, LocatorOptions options);
|
||||
/**
|
||||
* Returns locator to the n-th matching element. It's zero based, {@code nth(0)} selects the first element.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
Locator nth(int index);
|
||||
/**
|
||||
* A page this locator belongs to.
|
||||
*
|
||||
* @since v1.19
|
||||
*/
|
||||
Page page();
|
||||
/**
|
||||
@ -3099,6 +3239,7 @@ public interface Locator {
|
||||
* the modifier, modifier is pressed and being held while the subsequent key is being pressed.
|
||||
*
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.14
|
||||
*/
|
||||
default void press(String key) {
|
||||
press(key, null);
|
||||
@ -3128,6 +3269,7 @@ public interface Locator {
|
||||
* the modifier, modifier is pressed and being held while the subsequent key is being pressed.
|
||||
*
|
||||
* @param key Name of the key to press or a character to generate, such as {@code ArrowLeft} or {@code a}.
|
||||
* @since v1.14
|
||||
*/
|
||||
void press(String key, PressOptions options);
|
||||
/**
|
||||
@ -3139,6 +3281,8 @@ public interface Locator {
|
||||
* scrolls element into view before taking a screenshot. If the element is detached from DOM, the method throws an error.
|
||||
*
|
||||
* <p> Returns the buffer with the captured screenshot.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default byte[] screenshot() {
|
||||
return screenshot(null);
|
||||
@ -3152,6 +3296,8 @@ public interface Locator {
|
||||
* scrolls element into view before taking a screenshot. If the element is detached from DOM, the method throws an error.
|
||||
*
|
||||
* <p> Returns the buffer with the captured screenshot.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
byte[] screenshot(ScreenshotOptions options);
|
||||
/**
|
||||
@ -3159,6 +3305,8 @@ public interface Locator {
|
||||
* scroll element into view, unless it is completely visible as defined by <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API">IntersectionObserver</a>'s {@code
|
||||
* ratio}.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void scrollIntoViewIfNeeded() {
|
||||
scrollIntoViewIfNeeded(null);
|
||||
@ -3168,6 +3316,8 @@ public interface Locator {
|
||||
* scroll element into view, unless it is completely visible as defined by <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API">IntersectionObserver</a>'s {@code
|
||||
* ratio}.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void scrollIntoViewIfNeeded(ScrollIntoViewIfNeededOptions options);
|
||||
/**
|
||||
@ -3200,6 +3350,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
default List<String> selectOption(String values) {
|
||||
return selectOption(values, null);
|
||||
@ -3234,6 +3385,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
List<String> selectOption(String values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3266,6 +3418,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
default List<String> selectOption(ElementHandle values) {
|
||||
return selectOption(values, null);
|
||||
@ -3300,6 +3453,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
List<String> selectOption(ElementHandle values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3332,6 +3486,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
default List<String> selectOption(String[] values) {
|
||||
return selectOption(values, null);
|
||||
@ -3366,6 +3521,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
List<String> selectOption(String[] values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3398,6 +3554,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
default List<String> selectOption(SelectOption values) {
|
||||
return selectOption(values, null);
|
||||
@ -3432,6 +3589,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
List<String> selectOption(SelectOption values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3464,6 +3622,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
default List<String> selectOption(ElementHandle[] values) {
|
||||
return selectOption(values, null);
|
||||
@ -3498,6 +3657,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
List<String> selectOption(ElementHandle[] values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3530,6 +3690,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
default List<String> selectOption(SelectOption[] values) {
|
||||
return selectOption(values, null);
|
||||
@ -3564,6 +3725,7 @@ public interface Locator {
|
||||
* @param values Options to select. If the {@code <select>} has the {@code multiple} attribute, all matching options are selected,
|
||||
* otherwise only the first option matching one of the passed options is selected. String values are matching both values
|
||||
* and labels. Option is considered matching if all specified properties match.
|
||||
* @since v1.14
|
||||
*/
|
||||
List<String> selectOption(SelectOption[] values, SelectOptionOptions options);
|
||||
/**
|
||||
@ -3573,6 +3735,8 @@ public interface Locator {
|
||||
* <p> If the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, focuses and selects text
|
||||
* in the control instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void selectText() {
|
||||
selectText(null);
|
||||
@ -3584,6 +3748,8 @@ public interface Locator {
|
||||
* <p> If the element is inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, focuses and selects text
|
||||
* in the control instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void selectText(SelectTextOptions options);
|
||||
/**
|
||||
@ -3603,6 +3769,7 @@ public interface Locator {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param checked Whether to check or uncheck the checkbox.
|
||||
* @since v1.15
|
||||
*/
|
||||
default void setChecked(boolean checked) {
|
||||
setChecked(checked, null);
|
||||
@ -3624,6 +3791,7 @@ public interface Locator {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @param checked Whether to check or uncheck the checkbox.
|
||||
* @since v1.15
|
||||
*/
|
||||
void setChecked(boolean checked, SetCheckedOptions options);
|
||||
/**
|
||||
@ -3635,6 +3803,8 @@ public interface Locator {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void setInputFiles(Path files) {
|
||||
setInputFiles(files, null);
|
||||
@ -3648,6 +3818,8 @@ public interface Locator {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void setInputFiles(Path files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -3659,6 +3831,8 @@ public interface Locator {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void setInputFiles(Path[] files) {
|
||||
setInputFiles(files, null);
|
||||
@ -3672,6 +3846,8 @@ public interface Locator {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void setInputFiles(Path[] files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -3683,6 +3859,8 @@ public interface Locator {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void setInputFiles(FilePayload files) {
|
||||
setInputFiles(files, null);
|
||||
@ -3696,6 +3874,8 @@ public interface Locator {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void setInputFiles(FilePayload files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -3707,6 +3887,8 @@ public interface Locator {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void setInputFiles(FilePayload[] files) {
|
||||
setInputFiles(files, null);
|
||||
@ -3720,6 +3902,8 @@ public interface Locator {
|
||||
* inside the {@code <label>} element that has an associated <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control">control</a>, targets the control
|
||||
* instead.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void setInputFiles(FilePayload[] files, SetInputFilesOptions options);
|
||||
/**
|
||||
@ -3738,6 +3922,8 @@ public interface Locator {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> {@code element.tap()} requires that the {@code hasTouch} option of the browser context be set to true.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void tap() {
|
||||
tap(null);
|
||||
@ -3758,16 +3944,22 @@ public interface Locator {
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* <p> <strong>NOTE:</strong> {@code element.tap()} requires that the {@code hasTouch} option of the browser context be set to true.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void tap(TapOptions options);
|
||||
/**
|
||||
* Returns the {@code node.textContent}.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default String textContent() {
|
||||
return textContent(null);
|
||||
}
|
||||
/**
|
||||
* Returns the {@code node.textContent}.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
String textContent(TextContentOptions options);
|
||||
/**
|
||||
@ -3790,6 +3982,7 @@ public interface Locator {
|
||||
* }</pre>
|
||||
*
|
||||
* @param text A text to type into a focused element.
|
||||
* @since v1.14
|
||||
*/
|
||||
default void type(String text) {
|
||||
type(text, null);
|
||||
@ -3814,6 +4007,7 @@ public interface Locator {
|
||||
* }</pre>
|
||||
*
|
||||
* @param text A text to type into a focused element.
|
||||
* @since v1.14
|
||||
*/
|
||||
void type(String text, TypeOptions options);
|
||||
/**
|
||||
@ -3833,6 +4027,8 @@ public interface Locator {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
default void uncheck() {
|
||||
uncheck(null);
|
||||
@ -3854,6 +4050,8 @@ public interface Locator {
|
||||
*
|
||||
* <p> When all steps combined have not finished during the specified {@code timeout}, this method throws a {@code
|
||||
* TimeoutError}. Passing zero timeout disables this.
|
||||
*
|
||||
* @since v1.14
|
||||
*/
|
||||
void uncheck(UncheckOptions options);
|
||||
/**
|
||||
@ -3867,6 +4065,8 @@ public interface Locator {
|
||||
* Locator orderSent = page.locator("#order-sent");
|
||||
* orderSent.waitFor();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
default void waitFor() {
|
||||
waitFor(null);
|
||||
@ -3882,6 +4082,8 @@ public interface Locator {
|
||||
* Locator orderSent = page.locator("#order-sent");
|
||||
* orderSent.waitFor();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
void waitFor(WaitForOptions options);
|
||||
}
|
||||
|
||||
@ -161,17 +161,23 @@ public interface Mouse {
|
||||
}
|
||||
/**
|
||||
* Shortcut for {@link Mouse#move Mouse.move()}, {@link Mouse#down Mouse.down()}, {@link Mouse#up Mouse.up()}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void click(double x, double y) {
|
||||
click(x, y, null);
|
||||
}
|
||||
/**
|
||||
* Shortcut for {@link Mouse#move Mouse.move()}, {@link Mouse#down Mouse.down()}, {@link Mouse#up Mouse.up()}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void click(double x, double y, ClickOptions options);
|
||||
/**
|
||||
* Shortcut for {@link Mouse#move Mouse.move()}, {@link Mouse#down Mouse.down()}, {@link Mouse#up Mouse.up()}, {@link
|
||||
* Mouse#down Mouse.down()} and {@link Mouse#up Mouse.up()}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void dblclick(double x, double y) {
|
||||
dblclick(x, y, null);
|
||||
@ -179,36 +185,50 @@ public interface Mouse {
|
||||
/**
|
||||
* Shortcut for {@link Mouse#move Mouse.move()}, {@link Mouse#down Mouse.down()}, {@link Mouse#up Mouse.up()}, {@link
|
||||
* Mouse#down Mouse.down()} and {@link Mouse#up Mouse.up()}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void dblclick(double x, double y, DblclickOptions options);
|
||||
/**
|
||||
* Dispatches a {@code mousedown} event.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void down() {
|
||||
down(null);
|
||||
}
|
||||
/**
|
||||
* Dispatches a {@code mousedown} event.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void down(DownOptions options);
|
||||
/**
|
||||
* Dispatches a {@code mousemove} event.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void move(double x, double y) {
|
||||
move(x, y, null);
|
||||
}
|
||||
/**
|
||||
* Dispatches a {@code mousemove} event.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void move(double x, double y, MoveOptions options);
|
||||
/**
|
||||
* Dispatches a {@code mouseup} event.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void up() {
|
||||
up(null);
|
||||
}
|
||||
/**
|
||||
* Dispatches a {@code mouseup} event.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void up(UpOptions options);
|
||||
/**
|
||||
@ -219,6 +239,7 @@ public interface Mouse {
|
||||
*
|
||||
* @param deltaX Pixels to scroll horizontally.
|
||||
* @param deltaY Pixels to scroll vertically.
|
||||
* @since v1.15
|
||||
*/
|
||||
void wheel(double deltaX, double deltaY);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -58,27 +58,39 @@ public interface Playwright extends AutoCloseable {
|
||||
}
|
||||
/**
|
||||
* This object can be used to launch or connect to Chromium, returning instances of {@code Browser}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
BrowserType chromium();
|
||||
/**
|
||||
* This object can be used to launch or connect to Firefox, returning instances of {@code Browser}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
BrowserType firefox();
|
||||
/**
|
||||
* Exposes API that can be used for the Web API testing.
|
||||
*
|
||||
* @since v1.16
|
||||
*/
|
||||
APIRequest request();
|
||||
/**
|
||||
* Selectors can be used to install custom selector engines. See <a
|
||||
* href="https://playwright.dev/java/docs/extensibility">extensibility</a> for more information.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Selectors selectors();
|
||||
/**
|
||||
* This object can be used to launch or connect to WebKit, returning instances of {@code Browser}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
BrowserType webkit();
|
||||
/**
|
||||
* Terminates this instance of Playwright, will also close all created browsers if they are still running.
|
||||
*
|
||||
* @since v1.9
|
||||
*/
|
||||
void close();
|
||||
/**
|
||||
@ -91,6 +103,8 @@ public interface Playwright extends AutoCloseable {
|
||||
* page.navigate("https://www.w3.org/");
|
||||
* playwright.close();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.10
|
||||
*/
|
||||
static Playwright create(CreateOptions options) {
|
||||
return PlaywrightImpl.create(options);
|
||||
|
||||
@ -40,6 +40,8 @@ import java.util.*;
|
||||
public interface Request {
|
||||
/**
|
||||
* An object with all the request HTTP headers associated with this request. The header names are lower-cased.
|
||||
*
|
||||
* @since v1.15
|
||||
*/
|
||||
Map<String, String> allHeaders();
|
||||
/**
|
||||
@ -53,44 +55,61 @@ public interface Request {
|
||||
* System.out.println(request.url() + " " + request.failure());
|
||||
* });
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String failure();
|
||||
/**
|
||||
* Returns the {@code Frame} that initiated this request.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Frame frame();
|
||||
/**
|
||||
* An object with the request HTTP headers. The header names are lower-cased. Note that this method does not return
|
||||
* security-related headers, including cookie-related ones. You can use {@link Request#allHeaders Request.allHeaders()} for
|
||||
* complete list of headers that include {@code cookie} information.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Map<String, String> headers();
|
||||
/**
|
||||
* An array with all the request HTTP headers associated with this request. Unlike {@link Request#allHeaders
|
||||
* Request.allHeaders()}, header names are NOT lower-cased. Headers with multiple entries, such as {@code Set-Cookie},
|
||||
* appear in the array multiple times.
|
||||
*
|
||||
* @since v1.15
|
||||
*/
|
||||
List<HttpHeader> headersArray();
|
||||
/**
|
||||
* Returns the value of the header matching the name. The name is case insensitive.
|
||||
*
|
||||
* @param name Name of the header.
|
||||
* @since v1.15
|
||||
*/
|
||||
String headerValue(String name);
|
||||
/**
|
||||
* Whether this request is driving frame's navigation.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isNavigationRequest();
|
||||
/**
|
||||
* Request's method (GET, POST, etc.)
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String method();
|
||||
/**
|
||||
* Request's post body, if any.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String postData();
|
||||
/**
|
||||
* Request's post body in a binary form, if any.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
byte[] postDataBuffer();
|
||||
/**
|
||||
@ -113,6 +132,8 @@ public interface Request {
|
||||
* Response response = page.navigate("https://google.com");
|
||||
* System.out.println(response.request().redirectedFrom()); // null
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Request redirectedFrom();
|
||||
/**
|
||||
@ -124,20 +145,28 @@ public interface Request {
|
||||
* <pre>{@code
|
||||
* System.out.println(request.redirectedFrom().redirectedTo() == request); // true
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Request redirectedTo();
|
||||
/**
|
||||
* Contains the request's resource type as it was perceived by the rendering engine. ResourceType will be one of the
|
||||
* following: {@code document}, {@code stylesheet}, {@code image}, {@code media}, {@code font}, {@code script}, {@code
|
||||
* texttrack}, {@code xhr}, {@code fetch}, {@code eventsource}, {@code websocket}, {@code manifest}, {@code other}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String resourceType();
|
||||
/**
|
||||
* Returns the matching {@code Response} object, or {@code null} if the response was not received due to error.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Response response();
|
||||
/**
|
||||
* Returns resource size information for given request.
|
||||
*
|
||||
* @since v1.15
|
||||
*/
|
||||
Sizes sizes();
|
||||
/**
|
||||
@ -153,10 +182,14 @@ public interface Request {
|
||||
* });
|
||||
* page.navigate("http://example.com");
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Timing timing();
|
||||
/**
|
||||
* URL of the request.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String url();
|
||||
}
|
||||
|
||||
@ -25,35 +25,49 @@ import java.util.*;
|
||||
public interface Response {
|
||||
/**
|
||||
* An object with all the response HTTP headers associated with this response.
|
||||
*
|
||||
* @since v1.15
|
||||
*/
|
||||
Map<String, String> allHeaders();
|
||||
/**
|
||||
* Returns the buffer with response body.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
byte[] body();
|
||||
/**
|
||||
* Waits for this response to finish, returns always {@code null}.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String finished();
|
||||
/**
|
||||
* Returns the {@code Frame} that initiated this response.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Frame frame();
|
||||
/**
|
||||
* Indicates whether this Response was fulfilled by a Service Worker's Fetch Handler (i.e. via <a
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/API/FetchEvent/respondWith">FetchEvent.respondWith</a>).
|
||||
*
|
||||
* @since v1.23
|
||||
*/
|
||||
boolean fromServiceWorker();
|
||||
/**
|
||||
* An object with the response HTTP headers. The header names are lower-cased. Note that this method does not return
|
||||
* security-related headers, including cookie-related ones. You can use {@link Response#allHeaders Response.allHeaders()}
|
||||
* for complete list of headers that include {@code cookie} information.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Map<String, String> headers();
|
||||
/**
|
||||
* An array with all the request HTTP headers associated with this response. Unlike {@link Response#allHeaders
|
||||
* Response.allHeaders()}, header names are NOT lower-cased. Headers with multiple entries, such as {@code Set-Cookie},
|
||||
* appear in the array multiple times.
|
||||
*
|
||||
* @since v1.15
|
||||
*/
|
||||
List<HttpHeader> headersArray();
|
||||
/**
|
||||
@ -62,44 +76,62 @@ public interface Response {
|
||||
* separator is used. If no headers are found, {@code null} is returned.
|
||||
*
|
||||
* @param name Name of the header.
|
||||
* @since v1.15
|
||||
*/
|
||||
String headerValue(String name);
|
||||
/**
|
||||
* Returns all values of the headers matching the name, for example {@code set-cookie}. The name is case insensitive.
|
||||
*
|
||||
* @param name Name of the header.
|
||||
* @since v1.15
|
||||
*/
|
||||
List<String> headerValues(String name);
|
||||
/**
|
||||
* Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean ok();
|
||||
/**
|
||||
* Returns the matching {@code Request} object.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Request request();
|
||||
/**
|
||||
* Returns SSL and other security information.
|
||||
*
|
||||
* @since v1.13
|
||||
*/
|
||||
SecurityDetails securityDetails();
|
||||
/**
|
||||
* Returns the IP address and port of the server.
|
||||
*
|
||||
* @since v1.13
|
||||
*/
|
||||
ServerAddr serverAddr();
|
||||
/**
|
||||
* Contains the status code of the response (e.g., 200 for a success).
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
int status();
|
||||
/**
|
||||
* Contains the status text of the response (e.g. usually an "OK" for a success).
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String statusText();
|
||||
/**
|
||||
* Returns the text representation of response body.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String text();
|
||||
/**
|
||||
* Contains the URL of the response.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String url();
|
||||
}
|
||||
|
||||
@ -276,6 +276,8 @@ public interface Route {
|
||||
}
|
||||
/**
|
||||
* Aborts the route's request.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void abort() {
|
||||
abort(null);
|
||||
@ -302,6 +304,7 @@ public interface Route {
|
||||
* <li> {@code "timedout"} - An operation timed out.</li>
|
||||
* <li> {@code "failed"} - A generic failure occurred.</li>
|
||||
* </ul>
|
||||
* @since v1.8
|
||||
*/
|
||||
void abort(String errorCode);
|
||||
/**
|
||||
@ -317,6 +320,8 @@ public interface Route {
|
||||
* route.resume(new Route.ResumeOptions().setHeaders(headers));
|
||||
* });
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void resume() {
|
||||
resume(null);
|
||||
@ -334,6 +339,8 @@ public interface Route {
|
||||
* route.resume(new Route.ResumeOptions().setHeaders(headers));
|
||||
* });
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void resume(ResumeOptions options);
|
||||
/**
|
||||
@ -395,6 +402,8 @@ public interface Route {
|
||||
* route.fallback(new Route.ResumeOptions().setHeaders(headers));
|
||||
* });
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.23
|
||||
*/
|
||||
default void fallback() {
|
||||
fallback(null);
|
||||
@ -458,6 +467,8 @@ public interface Route {
|
||||
* route.fallback(new Route.ResumeOptions().setHeaders(headers));
|
||||
* });
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.23
|
||||
*/
|
||||
void fallback(FallbackOptions options);
|
||||
/**
|
||||
@ -476,6 +487,8 @@ public interface Route {
|
||||
* .setBody(json.toString()));
|
||||
* });
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.29
|
||||
*/
|
||||
default APIResponse fetch() {
|
||||
return fetch(null);
|
||||
@ -496,6 +509,8 @@ public interface Route {
|
||||
* .setBody(json.toString()));
|
||||
* });
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.29
|
||||
*/
|
||||
APIResponse fetch(FetchOptions options);
|
||||
/**
|
||||
@ -518,6 +533,8 @@ public interface Route {
|
||||
* page.route("**\/xhr_endpoint", route -> route.fulfill(
|
||||
* new Route.FulfillOptions().setPath(Paths.get("mock_data.json"))));
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
default void fulfill() {
|
||||
fulfill(null);
|
||||
@ -542,10 +559,14 @@ public interface Route {
|
||||
* page.route("**\/xhr_endpoint", route -> route.fulfill(
|
||||
* new Route.FulfillOptions().setPath(Paths.get("mock_data.json"))));
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void fulfill(FulfillOptions options);
|
||||
/**
|
||||
* A request to be routed.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Request request();
|
||||
}
|
||||
|
||||
@ -74,6 +74,7 @@ public interface Selectors {
|
||||
* @param name Name that is used in selectors as a prefix, e.g. {@code {name: 'foo'}} enables {@code foo=myselectorbody} selectors. May
|
||||
* only contain {@code [a-zA-Z0-9_]} characters.
|
||||
* @param script Script that evaluates to a selector engine instance. The script is evaluated in the page context.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void register(String name, String script) {
|
||||
register(name, script, null);
|
||||
@ -111,6 +112,7 @@ public interface Selectors {
|
||||
* @param name Name that is used in selectors as a prefix, e.g. {@code {name: 'foo'}} enables {@code foo=myselectorbody} selectors. May
|
||||
* only contain {@code [a-zA-Z0-9_]} characters.
|
||||
* @param script Script that evaluates to a selector engine instance. The script is evaluated in the page context.
|
||||
* @since v1.8
|
||||
*/
|
||||
void register(String name, String script, RegisterOptions options);
|
||||
/**
|
||||
@ -146,6 +148,7 @@ public interface Selectors {
|
||||
* @param name Name that is used in selectors as a prefix, e.g. {@code {name: 'foo'}} enables {@code foo=myselectorbody} selectors. May
|
||||
* only contain {@code [a-zA-Z0-9_]} characters.
|
||||
* @param script Script that evaluates to a selector engine instance. The script is evaluated in the page context.
|
||||
* @since v1.8
|
||||
*/
|
||||
default void register(String name, Path script) {
|
||||
register(name, script, null);
|
||||
@ -183,6 +186,7 @@ public interface Selectors {
|
||||
* @param name Name that is used in selectors as a prefix, e.g. {@code {name: 'foo'}} enables {@code foo=myselectorbody} selectors. May
|
||||
* only contain {@code [a-zA-Z0-9_]} characters.
|
||||
* @param script Script that evaluates to a selector engine instance. The script is evaluated in the page context.
|
||||
* @since v1.8
|
||||
*/
|
||||
void register(String name, Path script, RegisterOptions options);
|
||||
/**
|
||||
@ -190,6 +194,7 @@ public interface Selectors {
|
||||
* default.
|
||||
*
|
||||
* @param attributeName Test id attribute name.
|
||||
* @since v1.27
|
||||
*/
|
||||
void setTestIdAttribute(String attributeName);
|
||||
}
|
||||
|
||||
@ -24,6 +24,8 @@ package com.microsoft.playwright;
|
||||
public interface Touchscreen {
|
||||
/**
|
||||
* Dispatches a {@code touchstart} and {@code touchend} event with a single touch at the position ({@code x},{@code y}).
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
void tap(double x, double y);
|
||||
}
|
||||
|
||||
@ -165,6 +165,8 @@ public interface Tracing {
|
||||
* context.tracing().stop(new Tracing.StopOptions()
|
||||
* .setPath(Paths.get("trace.zip")));
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.12
|
||||
*/
|
||||
default void start() {
|
||||
start(null);
|
||||
@ -182,6 +184,8 @@ public interface Tracing {
|
||||
* context.tracing().stop(new Tracing.StopOptions()
|
||||
* .setPath(Paths.get("trace.zip")));
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.12
|
||||
*/
|
||||
void start(StartOptions options);
|
||||
/**
|
||||
@ -209,6 +213,8 @@ public interface Tracing {
|
||||
* context.tracing().stopChunk(new Tracing.StopChunkOptions()
|
||||
* .setPath(Paths.get("trace2.zip")));
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.15
|
||||
*/
|
||||
default void startChunk() {
|
||||
startChunk(null);
|
||||
@ -238,26 +244,36 @@ public interface Tracing {
|
||||
* context.tracing().stopChunk(new Tracing.StopChunkOptions()
|
||||
* .setPath(Paths.get("trace2.zip")));
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.15
|
||||
*/
|
||||
void startChunk(StartChunkOptions options);
|
||||
/**
|
||||
* Stop tracing.
|
||||
*
|
||||
* @since v1.12
|
||||
*/
|
||||
default void stop() {
|
||||
stop(null);
|
||||
}
|
||||
/**
|
||||
* Stop tracing.
|
||||
*
|
||||
* @since v1.12
|
||||
*/
|
||||
void stop(StopOptions options);
|
||||
/**
|
||||
* Stop the trace chunk. See {@link Tracing#startChunk Tracing.startChunk()} for more details about multiple trace chunks.
|
||||
*
|
||||
* @since v1.15
|
||||
*/
|
||||
default void stopChunk() {
|
||||
stopChunk(null);
|
||||
}
|
||||
/**
|
||||
* Stop the trace chunk. See {@link Tracing#startChunk Tracing.startChunk()} for more details about multiple trace chunks.
|
||||
*
|
||||
* @since v1.15
|
||||
*/
|
||||
void stopChunk(StopChunkOptions options);
|
||||
}
|
||||
|
||||
@ -27,11 +27,15 @@ import java.nio.file.Path;
|
||||
public interface Video {
|
||||
/**
|
||||
* Deletes the video file. Will wait for the video to finish if necessary.
|
||||
*
|
||||
* @since v1.11
|
||||
*/
|
||||
void delete();
|
||||
/**
|
||||
* Returns the file system path this video will be recorded to. The video is guaranteed to be written to the filesystem
|
||||
* upon closing the browser context. This method throws when connected remotely.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
Path path();
|
||||
/**
|
||||
@ -39,6 +43,7 @@ public interface Video {
|
||||
* the page has closed. This method waits until the page is closed and the video is fully saved.
|
||||
*
|
||||
* @param path Path where the video should be saved.
|
||||
* @since v1.11
|
||||
*/
|
||||
void saveAs(Path path);
|
||||
}
|
||||
|
||||
@ -116,10 +116,14 @@ public interface WebSocket {
|
||||
}
|
||||
/**
|
||||
* Indicates that the web socket has been closed.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
boolean isClosed();
|
||||
/**
|
||||
* Contains the URL of the WebSocket.
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String url();
|
||||
/**
|
||||
@ -128,6 +132,7 @@ public interface WebSocket {
|
||||
* error if the WebSocket or Page is closed before the frame is received.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.10
|
||||
*/
|
||||
default WebSocketFrame waitForFrameReceived(Runnable callback) {
|
||||
return waitForFrameReceived(null, callback);
|
||||
@ -138,6 +143,7 @@ public interface WebSocket {
|
||||
* error if the WebSocket or Page is closed before the frame is received.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.10
|
||||
*/
|
||||
WebSocketFrame waitForFrameReceived(WaitForFrameReceivedOptions options, Runnable callback);
|
||||
/**
|
||||
@ -146,6 +152,7 @@ public interface WebSocket {
|
||||
* error if the WebSocket or Page is closed before the frame is sent.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.10
|
||||
*/
|
||||
default WebSocketFrame waitForFrameSent(Runnable callback) {
|
||||
return waitForFrameSent(null, callback);
|
||||
@ -156,6 +163,7 @@ public interface WebSocket {
|
||||
* error if the WebSocket or Page is closed before the frame is sent.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.10
|
||||
*/
|
||||
WebSocketFrame waitForFrameSent(WaitForFrameSentOptions options, Runnable callback);
|
||||
}
|
||||
|
||||
@ -25,10 +25,14 @@ package com.microsoft.playwright;
|
||||
public interface WebSocketFrame {
|
||||
/**
|
||||
* Returns binary payload.
|
||||
*
|
||||
* @since v1.9
|
||||
*/
|
||||
byte[] binary();
|
||||
/**
|
||||
* Returns text payload.
|
||||
*
|
||||
* @since v1.9
|
||||
*/
|
||||
String text();
|
||||
}
|
||||
|
||||
@ -73,6 +73,7 @@ public interface Worker {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.8
|
||||
*/
|
||||
default Object evaluate(String expression) {
|
||||
return evaluate(expression, null);
|
||||
@ -91,6 +92,7 @@ public interface Worker {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.8
|
||||
*/
|
||||
Object evaluate(String expression, Object arg);
|
||||
/**
|
||||
@ -105,6 +107,7 @@ public interface Worker {
|
||||
*
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @since v1.8
|
||||
*/
|
||||
default JSHandle evaluateHandle(String expression) {
|
||||
return evaluateHandle(expression, null);
|
||||
@ -122,13 +125,20 @@ public interface Worker {
|
||||
* @param expression JavaScript expression to be evaluated in the browser context. If the expression evaluates to a function, the function is
|
||||
* automatically invoked.
|
||||
* @param arg Optional argument to pass to {@code expression}.
|
||||
* @since v1.8
|
||||
*/
|
||||
JSHandle evaluateHandle(String expression, Object arg);
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
String url();
|
||||
/**
|
||||
* Performs action and waits for the Worker to close.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.10
|
||||
*/
|
||||
default Worker waitForClose(Runnable callback) {
|
||||
return waitForClose(null, callback);
|
||||
@ -137,6 +147,7 @@ public interface Worker {
|
||||
* Performs action and waits for the Worker to close.
|
||||
*
|
||||
* @param callback Callback that performs the action triggering the event.
|
||||
* @since v1.10
|
||||
*/
|
||||
Worker waitForClose(WaitForCloseOptions options, Runnable callback);
|
||||
}
|
||||
|
||||
@ -43,6 +43,8 @@ public interface APIResponseAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(response).not().isOK();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
APIResponseAssertions not();
|
||||
/**
|
||||
@ -52,6 +54,8 @@ public interface APIResponseAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(response).isOK();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.18
|
||||
*/
|
||||
void isOK();
|
||||
}
|
||||
|
||||
@ -364,6 +364,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(locator).not().containsText("error");
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
LocatorAssertions not();
|
||||
/**
|
||||
@ -373,6 +375,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.getByLabel("Subscribe to newsletter")).isChecked();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
default void isChecked() {
|
||||
isChecked(null);
|
||||
@ -384,6 +388,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.getByLabel("Subscribe to newsletter")).isChecked();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
void isChecked(IsCheckedOptions options);
|
||||
/**
|
||||
@ -398,6 +404,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator("button.submit")).isDisabled();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
default void isDisabled() {
|
||||
isDisabled(null);
|
||||
@ -414,6 +422,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator("button.submit")).isDisabled();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
void isDisabled(IsDisabledOptions options);
|
||||
/**
|
||||
@ -423,6 +433,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.getByRole(AriaRole.TEXTBOX)).isEditable();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
default void isEditable() {
|
||||
isEditable(null);
|
||||
@ -434,6 +446,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.getByRole(AriaRole.TEXTBOX)).isEditable();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
void isEditable(IsEditableOptions options);
|
||||
/**
|
||||
@ -443,6 +457,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator("div.warning")).isEmpty();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
default void isEmpty() {
|
||||
isEmpty(null);
|
||||
@ -454,6 +470,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator("div.warning")).isEmpty();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
void isEmpty(IsEmptyOptions options);
|
||||
/**
|
||||
@ -463,6 +481,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator("button.submit")).isEnabled();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
default void isEnabled() {
|
||||
isEnabled(null);
|
||||
@ -474,6 +494,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator("button.submit")).isEnabled();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
void isEnabled(IsEnabledOptions options);
|
||||
/**
|
||||
@ -483,6 +505,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.getByRole(AriaRole.TEXTBOX)).isFocused();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
default void isFocused() {
|
||||
isFocused(null);
|
||||
@ -494,6 +518,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.getByRole(AriaRole.TEXTBOX)).isFocused();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
void isFocused(IsFocusedOptions options);
|
||||
/**
|
||||
@ -504,6 +530,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator(".my-element")).isHidden();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
default void isHidden() {
|
||||
isHidden(null);
|
||||
@ -516,6 +544,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator(".my-element")).isHidden();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
void isHidden(IsHiddenOptions options);
|
||||
/**
|
||||
@ -526,6 +556,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator(".my-element")).isVisible();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
default void isVisible() {
|
||||
isVisible(null);
|
||||
@ -538,6 +570,8 @@ public interface LocatorAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page.locator(".my-element")).isVisible();
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
void isVisible(IsVisibleOptions options);
|
||||
/**
|
||||
@ -575,6 +609,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected substring or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void containsText(String expected) {
|
||||
containsText(expected, null);
|
||||
@ -614,6 +649,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected substring or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void containsText(String expected, ContainsTextOptions options);
|
||||
/**
|
||||
@ -651,6 +687,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected substring or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void containsText(Pattern expected) {
|
||||
containsText(expected, null);
|
||||
@ -690,6 +727,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected substring or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void containsText(Pattern expected, ContainsTextOptions options);
|
||||
/**
|
||||
@ -727,6 +765,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected substring or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void containsText(String[] expected) {
|
||||
containsText(expected, null);
|
||||
@ -766,6 +805,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected substring or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void containsText(String[] expected, ContainsTextOptions options);
|
||||
/**
|
||||
@ -803,6 +843,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected substring or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void containsText(Pattern[] expected) {
|
||||
containsText(expected, null);
|
||||
@ -842,6 +883,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected substring or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void containsText(Pattern[] expected, ContainsTextOptions options);
|
||||
/**
|
||||
@ -854,6 +896,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name Attribute name.
|
||||
* @param value Expected attribute value.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasAttribute(String name, String value) {
|
||||
hasAttribute(name, value, (HasAttributeOptions) null);
|
||||
@ -868,6 +911,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name Attribute name.
|
||||
* @param value Expected attribute value.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasAttribute(String name, String value, HasAttributeOptions options);
|
||||
/**
|
||||
@ -880,6 +924,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name Attribute name.
|
||||
* @param value Expected attribute value.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasAttribute(String name, Pattern value) {
|
||||
hasAttribute(name, value, (HasAttributeOptions) null);
|
||||
@ -894,6 +939,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name Attribute name.
|
||||
* @param value Expected attribute value.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasAttribute(String name, Pattern value, HasAttributeOptions options);
|
||||
/**
|
||||
@ -912,6 +958,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected class or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasClass(String expected) {
|
||||
hasClass(expected, null);
|
||||
@ -932,6 +979,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected class or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasClass(String expected, HasClassOptions options);
|
||||
/**
|
||||
@ -950,6 +998,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected class or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasClass(Pattern expected) {
|
||||
hasClass(expected, null);
|
||||
@ -970,6 +1019,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected class or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasClass(Pattern expected, HasClassOptions options);
|
||||
/**
|
||||
@ -988,6 +1038,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected class or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasClass(String[] expected) {
|
||||
hasClass(expected, null);
|
||||
@ -1008,6 +1059,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected class or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasClass(String[] expected, HasClassOptions options);
|
||||
/**
|
||||
@ -1026,6 +1078,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected class or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasClass(Pattern[] expected) {
|
||||
hasClass(expected, null);
|
||||
@ -1046,6 +1099,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected class or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasClass(Pattern[] expected, HasClassOptions options);
|
||||
/**
|
||||
@ -1057,6 +1111,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param count Expected count.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasCount(int count) {
|
||||
hasCount(count, null);
|
||||
@ -1070,6 +1125,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param count Expected count.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasCount(int count, HasCountOptions options);
|
||||
/**
|
||||
@ -1082,6 +1138,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name CSS property name.
|
||||
* @param value CSS property value.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasCSS(String name, String value) {
|
||||
hasCSS(name, value, null);
|
||||
@ -1096,6 +1153,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name CSS property name.
|
||||
* @param value CSS property value.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasCSS(String name, String value, HasCSSOptions options);
|
||||
/**
|
||||
@ -1108,6 +1166,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name CSS property name.
|
||||
* @param value CSS property value.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasCSS(String name, Pattern value) {
|
||||
hasCSS(name, value, null);
|
||||
@ -1122,6 +1181,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name CSS property name.
|
||||
* @param value CSS property value.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasCSS(String name, Pattern value, HasCSSOptions options);
|
||||
/**
|
||||
@ -1133,6 +1193,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param id Element id.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasId(String id) {
|
||||
hasId(id, null);
|
||||
@ -1146,6 +1207,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param id Element id.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasId(String id, HasIdOptions options);
|
||||
/**
|
||||
@ -1157,6 +1219,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param id Element id.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasId(Pattern id) {
|
||||
hasId(id, null);
|
||||
@ -1170,6 +1233,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param id Element id.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasId(Pattern id, HasIdOptions options);
|
||||
/**
|
||||
@ -1183,6 +1247,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name Property name.
|
||||
* @param value Property value.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasJSProperty(String name, Object value) {
|
||||
hasJSProperty(name, value, null);
|
||||
@ -1198,6 +1263,7 @@ public interface LocatorAssertions {
|
||||
*
|
||||
* @param name Property name.
|
||||
* @param value Property value.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasJSProperty(String name, Object value, HasJSPropertyOptions options);
|
||||
/**
|
||||
@ -1235,6 +1301,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected string or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasText(String expected) {
|
||||
hasText(expected, null);
|
||||
@ -1274,6 +1341,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected string or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasText(String expected, HasTextOptions options);
|
||||
/**
|
||||
@ -1311,6 +1379,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected string or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasText(Pattern expected) {
|
||||
hasText(expected, null);
|
||||
@ -1350,6 +1419,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected string or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasText(Pattern expected, HasTextOptions options);
|
||||
/**
|
||||
@ -1387,6 +1457,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected string or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasText(String[] expected) {
|
||||
hasText(expected, null);
|
||||
@ -1426,6 +1497,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected string or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasText(String[] expected, HasTextOptions options);
|
||||
/**
|
||||
@ -1463,6 +1535,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected string or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasText(Pattern[] expected) {
|
||||
hasText(expected, null);
|
||||
@ -1502,6 +1575,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param expected Expected string or RegExp or a list of those.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasText(Pattern[] expected, HasTextOptions options);
|
||||
/**
|
||||
@ -1514,6 +1588,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param value Expected value.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasValue(String value) {
|
||||
hasValue(value, null);
|
||||
@ -1528,6 +1603,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param value Expected value.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasValue(String value, HasValueOptions options);
|
||||
/**
|
||||
@ -1540,6 +1616,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param value Expected value.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasValue(Pattern value) {
|
||||
hasValue(value, null);
|
||||
@ -1554,6 +1631,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param value Expected value.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasValue(Pattern value, HasValueOptions options);
|
||||
/**
|
||||
@ -1569,6 +1647,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param values Expected options currently selected.
|
||||
* @since v1.23
|
||||
*/
|
||||
default void hasValues(String[] values) {
|
||||
hasValues(values, null);
|
||||
@ -1586,6 +1665,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param values Expected options currently selected.
|
||||
* @since v1.23
|
||||
*/
|
||||
void hasValues(String[] values, HasValuesOptions options);
|
||||
/**
|
||||
@ -1601,6 +1681,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param values Expected options currently selected.
|
||||
* @since v1.23
|
||||
*/
|
||||
default void hasValues(Pattern[] values) {
|
||||
hasValues(values, null);
|
||||
@ -1618,6 +1699,7 @@ public interface LocatorAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param values Expected options currently selected.
|
||||
* @since v1.23
|
||||
*/
|
||||
void hasValues(Pattern[] values, HasValuesOptions options);
|
||||
}
|
||||
|
||||
@ -72,6 +72,8 @@ public interface PageAssertions {
|
||||
* <pre>{@code
|
||||
* assertThat(page).not().hasURL("error");
|
||||
* }</pre>
|
||||
*
|
||||
* @since v1.20
|
||||
*/
|
||||
PageAssertions not();
|
||||
/**
|
||||
@ -83,6 +85,7 @@ public interface PageAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param titleOrRegExp Expected title or RegExp.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasTitle(String titleOrRegExp) {
|
||||
hasTitle(titleOrRegExp, null);
|
||||
@ -96,6 +99,7 @@ public interface PageAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param titleOrRegExp Expected title or RegExp.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasTitle(String titleOrRegExp, HasTitleOptions options);
|
||||
/**
|
||||
@ -107,6 +111,7 @@ public interface PageAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param titleOrRegExp Expected title or RegExp.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasTitle(Pattern titleOrRegExp) {
|
||||
hasTitle(titleOrRegExp, null);
|
||||
@ -120,6 +125,7 @@ public interface PageAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param titleOrRegExp Expected title or RegExp.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasTitle(Pattern titleOrRegExp, HasTitleOptions options);
|
||||
/**
|
||||
@ -131,6 +137,7 @@ public interface PageAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param urlOrRegExp Expected URL string or RegExp.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasURL(String urlOrRegExp) {
|
||||
hasURL(urlOrRegExp, null);
|
||||
@ -144,6 +151,7 @@ public interface PageAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param urlOrRegExp Expected URL string or RegExp.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasURL(String urlOrRegExp, HasURLOptions options);
|
||||
/**
|
||||
@ -155,6 +163,7 @@ public interface PageAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param urlOrRegExp Expected URL string or RegExp.
|
||||
* @since v1.20
|
||||
*/
|
||||
default void hasURL(Pattern urlOrRegExp) {
|
||||
hasURL(urlOrRegExp, null);
|
||||
@ -168,6 +177,7 @@ public interface PageAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param urlOrRegExp Expected URL string or RegExp.
|
||||
* @since v1.20
|
||||
*/
|
||||
void hasURL(Pattern urlOrRegExp, HasURLOptions options);
|
||||
}
|
||||
|
||||
@ -60,6 +60,7 @@ public interface PlaywrightAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param response {@code APIResponse} object to use for assertions.
|
||||
* @since v1.18
|
||||
*/
|
||||
static APIResponseAssertions assertThat(APIResponse response) {
|
||||
return new APIResponseAssertionsImpl(response);
|
||||
@ -74,6 +75,7 @@ public interface PlaywrightAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param locator {@code Locator} object to use for assertions.
|
||||
* @since v1.18
|
||||
*/
|
||||
static LocatorAssertions assertThat(Locator locator) {
|
||||
return new LocatorAssertionsImpl(locator);
|
||||
@ -88,6 +90,7 @@ public interface PlaywrightAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param page {@code Page} object to use for assertions.
|
||||
* @since v1.18
|
||||
*/
|
||||
static PageAssertions assertThat(Page page) {
|
||||
return new PageAssertionsImpl(page);
|
||||
@ -102,6 +105,7 @@ public interface PlaywrightAssertions {
|
||||
* }</pre>
|
||||
*
|
||||
* @param timeout Timeout in milliseconds.
|
||||
* @since v1.25
|
||||
*/
|
||||
static void setDefaultAssertionTimeout(double milliseconds) {
|
||||
AssertionsTimeout.setDefaultTimeout(milliseconds);
|
||||
|
||||
@ -34,6 +34,8 @@ import java.nio.file.Path;
|
||||
public interface FormData {
|
||||
/**
|
||||
* Creates new instance of {@code FormData}.
|
||||
*
|
||||
* @since v1.18
|
||||
*/
|
||||
static FormData create() {
|
||||
return new FormDataImpl();
|
||||
@ -43,6 +45,7 @@ public interface FormData {
|
||||
*
|
||||
* @param name Field name.
|
||||
* @param value Field value.
|
||||
* @since v1.18
|
||||
*/
|
||||
FormData set(String name, String value);
|
||||
/**
|
||||
@ -50,6 +53,7 @@ public interface FormData {
|
||||
*
|
||||
* @param name Field name.
|
||||
* @param value Field value.
|
||||
* @since v1.18
|
||||
*/
|
||||
FormData set(String name, boolean value);
|
||||
/**
|
||||
@ -57,6 +61,7 @@ public interface FormData {
|
||||
*
|
||||
* @param name Field name.
|
||||
* @param value Field value.
|
||||
* @since v1.18
|
||||
*/
|
||||
FormData set(String name, int value);
|
||||
/**
|
||||
@ -64,6 +69,7 @@ public interface FormData {
|
||||
*
|
||||
* @param name Field name.
|
||||
* @param value Field value.
|
||||
* @since v1.18
|
||||
*/
|
||||
FormData set(String name, Path value);
|
||||
/**
|
||||
@ -71,6 +77,7 @@ public interface FormData {
|
||||
*
|
||||
* @param name Field name.
|
||||
* @param value Field value.
|
||||
* @since v1.18
|
||||
*/
|
||||
FormData set(String name, FilePayload value);
|
||||
}
|
||||
|
||||
@ -59,6 +59,8 @@ import com.microsoft.playwright.impl.RequestOptionsImpl;
|
||||
public interface RequestOptions {
|
||||
/**
|
||||
* Creates new instance of {@code RequestOptions}.
|
||||
*
|
||||
* @since v1.18
|
||||
*/
|
||||
static RequestOptions create() {
|
||||
return new RequestOptionsImpl();
|
||||
@ -69,6 +71,7 @@ public interface RequestOptions {
|
||||
* @param data Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
|
||||
* {@code content-type} header will be set to {@code application/json} if not explicitly set. Otherwise the {@code
|
||||
* content-type} header will be set to {@code application/octet-stream} if not explicitly set.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setData(String data);
|
||||
/**
|
||||
@ -77,6 +80,7 @@ public interface RequestOptions {
|
||||
* @param data Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
|
||||
* {@code content-type} header will be set to {@code application/json} if not explicitly set. Otherwise the {@code
|
||||
* content-type} header will be set to {@code application/octet-stream} if not explicitly set.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setData(byte[] data);
|
||||
/**
|
||||
@ -85,12 +89,14 @@ public interface RequestOptions {
|
||||
* @param data Allows to set post data of the request. If the data parameter is an object, it will be serialized to json string and
|
||||
* {@code content-type} header will be set to {@code application/json} if not explicitly set. Otherwise the {@code
|
||||
* content-type} header will be set to {@code application/octet-stream} if not explicitly set.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setData(Object data);
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param failOnStatusCode Whether to throw on response codes other than 2xx and 3xx. By default response object is returned for all status codes.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setFailOnStatusCode(boolean failOnStatusCode);
|
||||
/**
|
||||
@ -100,6 +106,7 @@ public interface RequestOptions {
|
||||
*
|
||||
* @param form Form data to be serialized as html form using {@code application/x-www-form-urlencoded} encoding and sent as this
|
||||
* request body.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setForm(FormData form);
|
||||
/**
|
||||
@ -107,12 +114,14 @@ public interface RequestOptions {
|
||||
*
|
||||
* @param name Header name.
|
||||
* @param value Header value.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setHeader(String name, String value);
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param ignoreHTTPSErrors Whether to ignore HTTPS errors when sending network requests.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors);
|
||||
/**
|
||||
@ -120,6 +129,7 @@ public interface RequestOptions {
|
||||
*
|
||||
* @param maxRedirects Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
|
||||
* exceeded. Defaults to {@code 20}. Pass {@code 0} to not follow redirects.
|
||||
* @since v1.26
|
||||
*/
|
||||
RequestOptions setMaxRedirects(int maxRedirects);
|
||||
/**
|
||||
@ -127,6 +137,7 @@ public interface RequestOptions {
|
||||
* href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST">POST</a>).
|
||||
*
|
||||
* @param method Request method, e.g. <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST">POST</a>.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setMethod(String method);
|
||||
/**
|
||||
@ -135,6 +146,7 @@ public interface RequestOptions {
|
||||
* multipart/form-data} unless explicitly provided.
|
||||
*
|
||||
* @param form Form data to be serialized as html form using {@code multipart/form-data} encoding and sent as this request body.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setMultipart(FormData form);
|
||||
/**
|
||||
@ -142,6 +154,7 @@ public interface RequestOptions {
|
||||
*
|
||||
* @param name Parameter name.
|
||||
* @param value Parameter value.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setQueryParam(String name, String value);
|
||||
/**
|
||||
@ -149,6 +162,7 @@ public interface RequestOptions {
|
||||
*
|
||||
* @param name Parameter name.
|
||||
* @param value Parameter value.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setQueryParam(String name, boolean value);
|
||||
/**
|
||||
@ -156,12 +170,14 @@ public interface RequestOptions {
|
||||
*
|
||||
* @param name Parameter name.
|
||||
* @param value Parameter value.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setQueryParam(String name, int value);
|
||||
/**
|
||||
* Sets request timeout in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout.
|
||||
*
|
||||
* @param timeout Request timeout in milliseconds.
|
||||
* @since v1.18
|
||||
*/
|
||||
RequestOptions setTimeout(double timeout);
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
|
||||
package com.microsoft.playwright;
|
||||
|
||||
import com.microsoft.playwright.options.AriaRole;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.condition.DisabledIf;
|
||||
import org.junit.jupiter.api.condition.EnabledIf;
|
||||
|
||||
@ -779,6 +779,14 @@ class Method extends Element {
|
||||
String returnComment = jsonElement.getAsJsonObject().get("returnComment").getAsString();
|
||||
sections.add("@return " + returnComment);
|
||||
}
|
||||
if (jsonElement.getAsJsonObject().has("since")) {
|
||||
if (!hasBlankLine) {
|
||||
sections.add("");
|
||||
hasBlankLine = true;
|
||||
}
|
||||
String since = jsonElement.getAsJsonObject().get("since").getAsString();
|
||||
sections.add("@since " + since);
|
||||
}
|
||||
writeJavadoc(output, offset, String.join("\n", sections));
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user