diff --git a/README.md b/README.md index 64391cc56..9df7ac493 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ Playwright is a Java library to automate [Chromium](https://www.chromium.org/Hom | | Linux | macOS | Windows | | :--- | :---: | :---: | :---: | -| Chromium 108.0.5359.29 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Chromium 109.0.5414.46 | :white_check_mark: | :white_check_mark: | :white_check_mark: | | WebKit 16.4 | ✅ | ✅ | ✅ | -| Firefox 106.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 107.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | Headless execution is supported for all the browsers on all platforms. Check out [system requirements](https://playwright.dev/java/docs/next/intro/#system-requirements) for details. diff --git a/playwright/src/main/java/com/microsoft/playwright/APIRequest.java b/playwright/src/main/java/com/microsoft/playwright/APIRequest.java index 43f8f19dc..3222c2246 100644 --- a/playwright/src/main/java/com/microsoft/playwright/APIRequest.java +++ b/playwright/src/main/java/com/microsoft/playwright/APIRequest.java @@ -57,17 +57,17 @@ class NewContextOptions { */ public Proxy proxy; /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()} or {@link APIRequestContext#storageState - * APIRequestContext.storageState()}. Either a path to the file with saved storage, or the value returned by one of {@link - * BrowserContext#storageState BrowserContext.storageState()} or {@link APIRequestContext#storageState - * APIRequestContext.storageState()} methods. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()} or {@link + * APIRequestContext#storageState APIRequestContext.storageState()}. Either a path to the file with saved storage, or the + * value returned by one of {@link BrowserContext#storageState BrowserContext.storageState()} or {@link + * APIRequestContext#storageState APIRequestContext.storageState()} methods. */ public String storageState; /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved storage - * state. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved + * storage state. */ public Path storageStatePath; /** @@ -136,20 +136,20 @@ public NewContextOptions setProxy(Proxy proxy) { return this; } /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()} or {@link APIRequestContext#storageState - * APIRequestContext.storageState()}. Either a path to the file with saved storage, or the value returned by one of {@link - * BrowserContext#storageState BrowserContext.storageState()} or {@link APIRequestContext#storageState - * APIRequestContext.storageState()} methods. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()} or {@link + * APIRequestContext#storageState APIRequestContext.storageState()}. Either a path to the file with saved storage, or the + * value returned by one of {@link BrowserContext#storageState BrowserContext.storageState()} or {@link + * APIRequestContext#storageState APIRequestContext.storageState()} methods. */ public NewContextOptions setStorageState(String storageState) { this.storageState = storageState; return this; } /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved storage - * state. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved + * storage state. */ public NewContextOptions setStorageStatePath(Path storageStatePath) { this.storageStatePath = storageStatePath; diff --git a/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java b/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java index c4810ab55..78610a99f 100644 --- a/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java +++ b/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java @@ -20,8 +20,8 @@ import java.nio.file.Path; /** - * This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services, prepare - * environment or the service to your e2e test. + * This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services, + * prepare environment or the service to your e2e test. * *
Each Playwright browser context has associated with it {@code APIRequestContext} instance which shares cookie storage with the * browser context and can be accessed via {@link BrowserContext#request BrowserContext.request()} or {@link Page#request @@ -36,8 +36,8 @@ * automatically update {@code BrowserContext} cookies and requests made from the page will pick them up. This means that if you * log in using this API, your e2e test will be logged in and vice versa. * - *
If you want API requests to not interfere with the browser cookies you should create a new {@code APIRequestContext} by - * calling {@link APIRequest#newContext APIRequest.newContext()}. Such {@code APIRequestContext} object will have its own + *
If you want API requests to not interfere with the browser cookies you should create a new {@code APIRequestContext} + * by calling {@link APIRequest#newContext APIRequest.newContext()}. Such {@code APIRequestContext} object will have its own * isolated cookie storage. */ public interface APIRequestContext { @@ -83,10 +83,11 @@ default APIResponse delete(String url) { */ void dispose(); /** - * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update - * context cookies from the response. The method will automatically follow redirects. + * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and + * update context cookies from the response. The method will automatically follow redirects. JSON objects can be passed + * directly to the request. * - *
JSON objects can be passed directly to the request: + *
**Usage** *
{@code * Mapdata = new HashMap(); * data.put("title", "Book Title"); @@ -117,10 +118,11 @@ default APIResponse fetch(String urlOrRequest) { return fetch(urlOrRequest, null); } /** - * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update - * context cookies from the response. The method will automatically follow redirects. + * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and + * update context cookies from the response. The method will automatically follow redirects. JSON objects can be passed + * directly to the request. * - * JSON objects can be passed directly to the request: + *
**Usage** *
{@code * Mapdata = new HashMap(); * data.put("title", "Book Title"); @@ -150,10 +152,11 @@ default APIResponse fetch(String urlOrRequest) { */ APIResponse fetch(String urlOrRequest, RequestOptions params); /** - * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update - * context cookies from the response. The method will automatically follow redirects. + * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and + * update context cookies from the response. The method will automatically follow redirects. JSON objects can be passed + * directly to the request. * - * JSON objects can be passed directly to the request: + *
**Usage** *
{@code * Mapdata = new HashMap(); * data.put("title", "Book Title"); @@ -184,10 +187,11 @@ default APIResponse fetch(Request urlOrRequest) { return fetch(urlOrRequest, null); } /** - * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update - * context cookies from the response. The method will automatically follow redirects. + * Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and + * update context cookies from the response. The method will automatically follow redirects. JSON objects can be passed + * directly to the request. * - * JSON objects can be passed directly to the request: + *
**Usage** *
{@code * Mapdata = new HashMap(); * data.put("title", "Book Title"); @@ -221,6 +225,8 @@ default APIResponse fetch(Request urlOrRequest) { * response. The method will populate request cookies from the context and update context cookies from the response. The * method will automatically follow redirects. * + * **Usage** + * *
Request parameters can be configured with {@code params} option, they will be serialized into the URL search parameters: *
{@code * request.get("https://example.com/api/getText", RequestOptions.create() @@ -238,6 +244,8 @@ default APIResponse get(String url) { * response. The method will populate request cookies from the context and update context cookies from the response. The * method will automatically follow redirects. * + ***Usage** + * *
Request parameters can be configured with {@code params} option, they will be serialized into the URL search parameters: *
{@code * request.get("https://example.com/api/getText", RequestOptions.create() @@ -292,6 +300,8 @@ default APIResponse patch(String url) { * response. The method will populate request cookies from the context and update context cookies from the response. The * method will automatically follow redirects. * + ***Usage** + * *
JSON objects can be passed directly to the request: *
{@code * Mapdata = new HashMap(); @@ -335,6 +345,8 @@ default APIResponse post(String url) { * response. The method will populate request cookies from the context and update context cookies from the response. The * method will automatically follow redirects. * + * **Usage** + * *
JSON objects can be passed directly to the request: *
{@code * Mapdata = new HashMap(); diff --git a/playwright/src/main/java/com/microsoft/playwright/Browser.java b/playwright/src/main/java/com/microsoft/playwright/Browser.java index 745970f80..1166e62e2 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Browser.java +++ b/playwright/src/main/java/com/microsoft/playwright/Browser.java @@ -80,8 +80,8 @@ class NewContextOptions { */ public Boolean bypassCSP; /** - * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. See - * {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. + * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. + * See {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. * Defaults to {@code "light"}. */ public Optional colorScheme; @@ -112,8 +112,8 @@ class NewContextOptions { */ public Boolean ignoreHTTPSErrors; /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not supported - * in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not + * supported in Firefox. */ public Boolean isMobile; /** @@ -121,8 +121,8 @@ class NewContextOptions { */ public Boolean javaScriptEnabled; /** - * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, {@code Accept-Language} - * request header value as well as number and date formatting rules. + * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, + * {@code Accept-Language} request header value as well as number and date formatting rules. */ public String locale; /** @@ -196,20 +196,20 @@ class NewContextOptions { */ public ServiceWorkerPolicy serviceWorkers; /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. */ public String storageState; /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved storage - * state. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved + * storage state. */ public Path storageStatePath; /** - * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors - * that imply single target DOM element will throw when more than one element matches the selector. See {@code Locator} to learn - * more about the strict mode. + * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors + * that imply single target DOM element will throw when more than one element matches the selector. This option does not + * affect any Locator APIs (Locators are always strict). See {@code Locator} to learn more about the strict mode. */ public Boolean strictSelectors; /** @@ -259,8 +259,8 @@ public NewContextOptions setBypassCSP(boolean bypassCSP) { return this; } /** - * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. See - * {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. + * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. + * See {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. * Defaults to {@code "light"}. */ public NewContextOptions setColorScheme(ColorScheme colorScheme) { @@ -324,8 +324,8 @@ public NewContextOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) { return this; } /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not supported - * in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not + * supported in Firefox. */ public NewContextOptions setIsMobile(boolean isMobile) { this.isMobile = isMobile; @@ -339,8 +339,8 @@ public NewContextOptions setJavaScriptEnabled(boolean javaScriptEnabled) { return this; } /** - * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, {@code Accept-Language} - * request header value as well as number and date formatting rules. + * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, + * {@code Accept-Language} request header value as well as number and date formatting rules. */ public NewContextOptions setLocale(String locale) { this.locale = locale; @@ -485,26 +485,26 @@ public NewContextOptions setServiceWorkers(ServiceWorkerPolicy serviceWorkers) { return this; } /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. */ public NewContextOptions setStorageState(String storageState) { this.storageState = storageState; return this; } /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved storage - * state. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved + * storage state. */ public NewContextOptions setStorageStatePath(Path storageStatePath) { this.storageStatePath = storageStatePath; return this; } /** - * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors - * that imply single target DOM element will throw when more than one element matches the selector. See {@code Locator} to learn - * more about the strict mode. + * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors + * that imply single target DOM element will throw when more than one element matches the selector. This option does not + * affect any Locator APIs (Locators are always strict). See {@code Locator} to learn more about the strict mode. */ public NewContextOptions setStrictSelectors(boolean strictSelectors) { this.strictSelectors = strictSelectors; @@ -564,8 +564,8 @@ class NewPageOptions { */ public Boolean bypassCSP; /** - * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. See - * {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. + * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. + * See {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. * Defaults to {@code "light"}. */ public Optional colorScheme; @@ -596,8 +596,8 @@ class NewPageOptions { */ public Boolean ignoreHTTPSErrors; /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not supported - * in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not + * supported in Firefox. */ public Boolean isMobile; /** @@ -605,8 +605,8 @@ class NewPageOptions { */ public Boolean javaScriptEnabled; /** - * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, {@code Accept-Language} - * request header value as well as number and date formatting rules. + * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, + * {@code Accept-Language} request header value as well as number and date formatting rules. */ public String locale; /** @@ -680,20 +680,20 @@ class NewPageOptions { */ public ServiceWorkerPolicy serviceWorkers; /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. */ public String storageState; /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved storage - * state. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved + * storage state. */ public Path storageStatePath; /** - * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors - * that imply single target DOM element will throw when more than one element matches the selector. See {@code Locator} to learn - * more about the strict mode. + * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors + * that imply single target DOM element will throw when more than one element matches the selector. This option does not + * affect any Locator APIs (Locators are always strict). See {@code Locator} to learn more about the strict mode. */ public Boolean strictSelectors; /** @@ -743,8 +743,8 @@ public NewPageOptions setBypassCSP(boolean bypassCSP) { return this; } /** - * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. See - * {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. + * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. + * See {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. * Defaults to {@code "light"}. */ public NewPageOptions setColorScheme(ColorScheme colorScheme) { @@ -808,8 +808,8 @@ public NewPageOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) { return this; } /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not supported - * in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not + * supported in Firefox. */ public NewPageOptions setIsMobile(boolean isMobile) { this.isMobile = isMobile; @@ -823,8 +823,8 @@ public NewPageOptions setJavaScriptEnabled(boolean javaScriptEnabled) { return this; } /** - * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, {@code Accept-Language} - * request header value as well as number and date formatting rules. + * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, + * {@code Accept-Language} request header value as well as number and date formatting rules. */ public NewPageOptions setLocale(String locale) { this.locale = locale; @@ -969,26 +969,26 @@ public NewPageOptions setServiceWorkers(ServiceWorkerPolicy serviceWorkers) { return this; } /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. */ public NewPageOptions setStorageState(String storageState) { this.storageState = storageState; return this; } /** - * Populates context with given storage state. This option can be used to initialize context with logged-in information - * obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved storage - * state. + * Populates context with given storage state. This option can be used to initialize context with logged-in + * information obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved + * storage state. */ public NewPageOptions setStorageStatePath(Path storageStatePath) { this.storageStatePath = storageStatePath; return this; } /** - * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors - * that imply single target DOM element will throw when more than one element matches the selector. See {@code Locator} to learn - * more about the strict mode. + * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors + * that imply single target DOM element will throw when more than one element matches the selector. This option does not + * affect any Locator APIs (Locators are always strict). See {@code Locator} to learn more about the strict mode. */ public NewPageOptions setStrictSelectors(boolean strictSelectors) { this.strictSelectors = strictSelectors; @@ -1068,8 +1068,8 @@ public StartTracingOptions setScreenshots(boolean screenshots) { * In case this browser is obtained using {@link BrowserType#launch BrowserType.launch()}, closes the browser and all of * its pages (if any were opened). * - * In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from the - * browser server. + *
In case this browser is connected to, clears all created contexts belonging to this browser and disconnects from + * the browser server. * *
NOTE: This is similar to force quitting the browser. Therefore, you should call {@link BrowserContext#close * BrowserContext.close()} on any {@code BrowserContext}'s you explicitly created earlier with {@link Browser#newContext @@ -1080,6 +1080,8 @@ public StartTracingOptions setScreenshots(boolean screenshots) { void close(); /** * Returns an array of all open browser contexts. In a newly created browser, this will return zero browser contexts. + * + *
**Usage** *
{@code * Browser browser = pw.webkit().launch(); * System.out.println(browser.contexts().size()); // prints "0" @@ -1099,6 +1101,8 @@ public StartTracingOptions setScreenshots(boolean screenshots) { * via {@link BrowserContext#close BrowserContext.close()} when your code is done with the {@code BrowserContext}, and before * calling {@link Browser#close Browser.close()}. This will ensure the {@code context} is closed gracefully and any * artifacts—like HARs and videos—are fully flushed and saved. + * + ***Usage** *
{@code * Browser browser = playwright.firefox().launch(); // Or 'chromium' or 'webkit'. * // Create a new incognito browser context. @@ -1122,6 +1126,8 @@ default BrowserContext newContext() { * via {@link BrowserContext#close BrowserContext.close()} when your code is done with the {@code BrowserContext}, and before * calling {@link Browser#close Browser.close()}. This will ensure the {@code context} is closed gracefully and any * artifacts—like HARs and videos—are fully flushed and saved. + * + ***Usage** *
{@code * Browser browser = playwright.firefox().launch(); // Or 'chromium' or 'webkit'. * // Create a new incognito browser context. @@ -1139,8 +1145,8 @@ default BrowserContext newContext() { /** * Creates a new page in a new browser context. Closing this page will close the context as well. * - *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 + *
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. */ default Page newPage() { @@ -1149,8 +1155,8 @@ default Page newPage() { /** * Creates a new page in a new browser context. Closing this page will close the context as well. * - *
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 + *
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. */ Page newPage(NewPageOptions options); @@ -1162,6 +1168,8 @@ default Page newPage() { * *
You can use {@link Browser#startTracing Browser.startTracing()} and {@link Browser#stopTracing Browser.stopTracing()} to * create a trace file that can be opened in Chrome DevTools performance panel. + * + *
**Usage** *
{@code * browser.startTracing(page, new Browser.StartTracingOptions() * .setPath(Paths.get("trace.json"))); @@ -1182,6 +1190,8 @@ default void startTracing(Page page) { * *You can use {@link Browser#startTracing Browser.startTracing()} and {@link Browser#stopTracing Browser.stopTracing()} to * create a trace file that can be opened in Chrome DevTools performance panel. + * + *
**Usage** *
{@code * browser.startTracing(page, new Browser.StartTracingOptions() * .setPath(Paths.get("trace.json"))); @@ -1200,6 +1210,8 @@ default void startTracing() { * *You can use {@link Browser#startTracing Browser.startTracing()} and {@link Browser#stopTracing Browser.stopTracing()} to * create a trace file that can be opened in Chrome DevTools performance panel. + * + *
**Usage** *
{@code * browser.startTracing(page, new Browser.StartTracingOptions() * .setPath(Paths.get("trace.json"))); diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java index 193b29228..49b5be4d7 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java @@ -26,8 +26,8 @@ /** * BrowserContexts provide a way to operate multiple independent browser sessions. * - *If a page opens another page, e.g. with a {@code window.open} call, the popup will belong to the parent page's browser - * context. + *
If a page opens another page, e.g. with a {@code window.open} call, the popup will belong to the parent page's + * browser context. * *
Playwright allows creating "incognito" browser contexts with {@link Browser#newContext Browser.newContext()} method. * "Incognito" browser contexts don't write any browsing data to disk. @@ -58,16 +58,16 @@ public interface BrowserContext extends AutoCloseable { void offClose(Consumer
handler); /** - * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event will - * also fire for popup pages. See also {@link Page#onPopup Page.onPopup()} to receive events about popups relevant to a - * specific page. + * The event is emitted when a new Page is created in the BrowserContext. The page may still be loading. The event + * will also fire for popup pages. See also {@link Page#onPopup Page.onPopup()} to receive events about popups relevant to + * a specific page. * - * The earliest moment that page is available is when it has navigated to the initial url. For example, when opening a - * popup with {@code window.open('http://example.com')}, this event will fire when the network request to "http://example.com" is - * done and its response has started loading in the popup. + *
The earliest moment that page is available is when it has navigated to the initial url. For example, when opening + * a popup with {@code window.open('http://example.com')}, this event will fire when the network request to "http://example.com" + * is done and its response has started loading in the popup. *
{@code * Page newPage = context.waitForPage(() -> { - * page.locator("a[target=_blank]").click(); + * page.getByText("open new page").click(); * }); * System.out.println(newPage.evaluate("location.href")); * }@@ -98,8 +98,8 @@ public interface BrowserContext extends AutoCloseable { * Emitted when a request fails, for example by timing out. To only listen for failed requests from a particular page, use * {@link Page#onRequestFailed Page.onRequestFailed()}. * - *NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will complete - * with {@link BrowserContext#onRequestFinished BrowserContext.onRequestFinished()} event and not with {@link + *
NOTE: HTTP Error responses, such as 404 or 503, are still successful responses from HTTP standpoint, so request will + * complete with {@link BrowserContext#onRequestFinished BrowserContext.onRequestFinished()} event and not with {@link * BrowserContext#onRequestFailed BrowserContext.onRequestFailed()}. */ void onRequestFailed(Consumer
handler); @@ -109,9 +109,9 @@ public interface BrowserContext extends AutoCloseable { void offRequestFailed(Consumer handler); /** - * Emitted when a request finishes successfully after downloading the response body. For a successful response, the - * sequence of events is {@code request}, {@code response} and {@code requestfinished}. To listen for successful requests from a particular - * page, use {@link Page#onRequestFinished Page.onRequestFinished()}. + * Emitted when a request finishes successfully after downloading the response body. For a successful response, + * the sequence of events is {@code request}, {@code response} and {@code requestfinished}. To listen for successful requests from a + * particular page, use {@link Page#onRequestFinished Page.onRequestFinished()}. */ void onRequestFinished(Consumer handler); /** @@ -120,8 +120,8 @@ public interface BrowserContext extends AutoCloseable { void offRequestFinished(Consumer handler); /** - * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of events - * is {@code request}, {@code response} and {@code requestfinished}. To listen for response events from a particular page, use {@link + * Emitted when [response] status and headers are received for a request. For a successful response, the sequence of + * events is {@code request}, {@code response} and {@code requestfinished}. To listen for response events from a particular page, use {@link * Page#onResponse Page.onResponse()}. */ void onResponse(Consumer handler); @@ -132,14 +132,14 @@ public interface BrowserContext extends AutoCloseable { class ExposeBindingOptions { /** - * Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is - * supported. When passing by value, multiple arguments are supported. + * Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument + * is supported. When passing by value, multiple arguments are supported. */ public Boolean handle; /** - * Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is - * supported. When passing by value, multiple arguments are supported. + * Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument + * is supported. When passing by value, multiple arguments are supported. */ public ExposeBindingOptions setHandle(boolean handle) { this.handle = handle; @@ -276,8 +276,10 @@ public WaitForPageOptions setTimeout(double timeout) { } } /** - * Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies can be - * obtained via {@link BrowserContext#cookies BrowserContext.cookies()}. + * Adds cookies into this browser context. All pages within this context will have these cookies installed. Cookies can + * be obtained via {@link BrowserContext#cookies BrowserContext.cookies()}. + * + * **Usage** *
{@code * browserContext.addCookies(Arrays.asList(cookieObject1, cookieObject2)); * }@@ -287,12 +289,14 @@ public WaitForPageOptions setTimeout(double timeout) { * Adds a script which would be evaluated in one of the following scenarios: **
* - *- Whenever a page is created in the browser context or is navigated.
- *- Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script is - * evaluated in the context of the newly attached frame.
+ *- Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script + * is evaluated in the context of the newly attached frame.
*The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend - * the JavaScript environment, e.g. to seed {@code Math.random}. + *
The script is evaluated after the document was created but before any of its scripts were run. This is useful to + * amend the JavaScript environment, e.g. to seed {@code Math.random}. + * + *
**Usage** * *
An example of overriding {@code Math.random} before the page loads: *
{@code @@ -310,12 +314,14 @@ public WaitForPageOptions setTimeout(double timeout) { * Adds a script which would be evaluated in one of the following scenarios: **
* - *- Whenever a page is created in the browser context or is navigated.
- *- Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script is - * evaluated in the context of the newly attached frame.
+ *- Whenever a child frame is attached or navigated in any page in the browser context. In this case, the script + * is evaluated in the context of the newly attached frame.
*The script is evaluated after the document was created but before any of its scripts were run. This is useful to amend - * the JavaScript environment, e.g. to seed {@code Math.random}. + *
The script is evaluated after the document was created but before any of its scripts were run. This is useful to + * amend the JavaScript environment, e.g. to seed {@code Math.random}. + * + *
**Usage** * *
An example of overriding {@code Math.random} before the page loads: *
{@code @@ -339,6 +345,8 @@ public WaitForPageOptions setTimeout(double timeout) { void clearCookies(); /** * Clears all permission overrides for the browser context. + * + ***Usage** *
{@code * BrowserContext context = browser.newContext(); * context.grantPermissions(Arrays.asList("clipboard-read")); @@ -354,22 +362,22 @@ public WaitForPageOptions setTimeout(double timeout) { */ void close(); /** - * If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs - * are returned. + * If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those + * URLs are returned. */ default Listcookies() { return cookies((String) null); } /** - * If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs - * are returned. + * If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those + * URLs are returned. * * @param urls Optional list of URLs. */ List cookies(String urls); /** - * If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those URLs - * are returned. + * If no URLs are specified, this method returns all cookies. If URLs are specified, only cookies that affect those + * URLs are returned. * * @param urls Optional list of URLs. */ @@ -387,6 +395,8 @@ default List cookies() { * * See {@link Page#exposeBinding Page.exposeBinding()} for page-only version. * + *
**Usage** + * *
An example of exposing page URL to all frames in all pages in the context: *
{@code * import com.microsoft.playwright.*; @@ -406,7 +416,7 @@ default Listcookies() { * "\n" + * "\n" + * ""); - * page.getByRole("button").click(); + * page.getByRole(AriaRole.BUTTON).click(); * } * } * } @@ -446,6 +456,8 @@ default void exposeBinding(String name, BindingCallback callback) { * * See {@link Page#exposeBinding Page.exposeBinding()} for page-only version. * + *
**Usage** + * *
An example of exposing page URL to all frames in all pages in the context: *
{@code * import com.microsoft.playwright.*; @@ -465,7 +477,7 @@ default void exposeBinding(String name, BindingCallback callback) { * "\n" + * "\n" + * ""); - * page.getByRole("button").click(); + * page.getByRole(AriaRole.BUTTON).click(); * } * } * } @@ -502,6 +514,8 @@ default void exposeBinding(String name, BindingCallback callback) { * *See {@link Page#exposeFunction Page.exposeFunction()} for page-only version. * + *
**Usage** + * *
An example of adding a {@code sha256} function to all pages in the context: *
{@code * import com.microsoft.playwright.*; @@ -535,7 +549,7 @@ default void exposeBinding(String name, BindingCallback callback) { * "\n" + * "\n" + * "\n"); - * page.getByRole("button").click(); + * page.getByRole(AriaRole.BUTTON).click(); * } * } * } @@ -546,8 +560,8 @@ default void exposeBinding(String name, BindingCallback callback) { */ void exposeFunction(String name, FunctionCallback callback); /** - * Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if - * specified. + * Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin + * if specified. * * @param permissions A permission or an array of permissions to grant. Permissions can be one of the following values: *@@ -572,8 +586,8 @@ default void grantPermissions(List
permissions) { grantPermissions(permissions, null); } /** - * Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin if - * specified. + * Grants specified permissions to the browser context. Only grants corresponding permissions to the given origin + * if specified. * * @param permissions A permission or an array of permissions to grant. Permissions can be one of the following values: * @@ -608,13 +622,15 @@ default void grantPermissions(List
permissions) { */ APIRequestContext request(); /** - * Routing provides the capability to modify network requests that are made by any page in the browser context. Once route - * is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. + * Routing provides the capability to modify network requests that are made by any page in the browser context. Once + * route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. * * NOTE: {@link BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by Service Worker. See this issue. We recommend disabling Service Workers when * using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}. * + *
**Usage** + * *
An example of a naive handler that aborts all image requests: *
{@code * BrowserContext context = browser.newContext(); @@ -660,13 +676,15 @@ default void route(String url, Consumerhandler) { route(url, handler, null); } /** - * Routing provides the capability to modify network requests that are made by any page in the browser context. Once route - * is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. + * Routing provides the capability to modify network requests that are made by any page in the browser context. Once + * route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. * * NOTE: {@link BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by Service Worker. See this issue. We recommend disabling Service Workers when * using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}. * + *
**Usage** + * *
An example of a naive handler that aborts all image requests: *
{@code * BrowserContext context = browser.newContext(); @@ -710,13 +728,15 @@ default void route(String url, Consumerhandler) { */ void route(String url, Consumer handler, RouteOptions options); /** - * Routing provides the capability to modify network requests that are made by any page in the browser context. Once route - * is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. + * Routing provides the capability to modify network requests that are made by any page in the browser context. Once + * route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. * * NOTE: {@link BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by Service Worker. See this issue. We recommend disabling Service Workers when * using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}. * + *
**Usage** + * *
An example of a naive handler that aborts all image requests: *
{@code * BrowserContext context = browser.newContext(); @@ -762,13 +782,15 @@ default void route(Pattern url, Consumerhandler) { route(url, handler, null); } /** - * Routing provides the capability to modify network requests that are made by any page in the browser context. Once route - * is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. + * Routing provides the capability to modify network requests that are made by any page in the browser context. Once + * route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. * * NOTE: {@link BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by Service Worker. See this issue. We recommend disabling Service Workers when * using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}. * + *
**Usage** + * *
An example of a naive handler that aborts all image requests: *
{@code * BrowserContext context = browser.newContext(); @@ -812,13 +834,15 @@ default void route(Pattern url, Consumerhandler) { */ void route(Pattern url, Consumer handler, RouteOptions options); /** - * Routing provides the capability to modify network requests that are made by any page in the browser context. Once route - * is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. + * Routing provides the capability to modify network requests that are made by any page in the browser context. Once + * route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. * * NOTE: {@link BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by Service Worker. See this issue. We recommend disabling Service Workers when * using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}. * + *
**Usage** + * *
An example of a naive handler that aborts all image requests: *
{@code * BrowserContext context = browser.newContext(); @@ -864,13 +888,15 @@ default void route(Predicateurl, Consumer handler) { route(url, handler, null); } /** - * Routing provides the capability to modify network requests that are made by any page in the browser context. Once route - * is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. + * Routing provides the capability to modify network requests that are made by any page in the browser context. Once + * route is enabled, every request matching the url pattern will stall unless it's continued, fulfilled or aborted. * * NOTE: {@link BrowserContext#route BrowserContext.route()} will not intercept requests intercepted by Service Worker. See this issue. We recommend disabling Service Workers when * using request interception by setting {@code Browser.newContext.serviceWorkers} to {@code "block"}. * + *
**Usage** + * *
An example of a naive handler that aborts all image requests: *
{@code * BrowserContext context = browser.newContext(); @@ -969,9 +995,9 @@ default void routeFromHAR(Path har) { */ void setDefaultTimeout(double timeout); /** - * The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are merged - * with page-specific extra HTTP headers set with {@link Page#setExtraHTTPHeaders Page.setExtraHTTPHeaders()}. If page - * overrides a particular header, page-specific header value will be used instead of the browser context header value. + * The extra HTTP headers will be sent with every request initiated by any page in the context. These headers are + * merged with page-specific extra HTTP headers set with {@link Page#setExtraHTTPHeaders Page.setExtraHTTPHeaders()}. If + * page overrides a particular header, page-specific header value will be used instead of the browser context header value. * *NOTE: {@link BrowserContext#setExtraHTTPHeaders BrowserContext.setExtraHTTPHeaders()} does not guarantee the order of headers * in the outgoing requests. @@ -981,6 +1007,8 @@ default void routeFromHAR(Path har) { void setExtraHTTPHeaders(Map
headers); /** * Sets the context's geolocation. Passing {@code null} or {@code undefined} emulates position unavailable. + * + * **Usage** *
{@code * browserContext.setGeolocation(new Geolocation(59.95, 30.31667)); * }diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java index 62ba750b9..4eef6126a 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java @@ -22,8 +22,8 @@ import java.util.regex.Pattern; /** - * BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is a - * typical example of using Playwright to drive automation: + * BrowserType provides methods to launch a specific browser instance or connect to an existing one. The following is + * a typical example of using Playwright to drive automation: *{@code * import com.microsoft.playwright.*; * @@ -142,9 +142,9 @@ class LaunchOptions { */ public Boolean devtools; /** - * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is - * deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in - * is closed. + * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and + * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created + * in is closed. */ public Path downloadsPath; /** @@ -177,8 +177,8 @@ class LaunchOptions { /** * Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to {@code true} unless the - * {@code devtools} option is {@code true}. + * href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode">Firefox. Defaults to {@code true} unless + * the {@code devtools} option is {@code true}. */ public Boolean headless; /** @@ -200,8 +200,8 @@ class LaunchOptions { */ public Double slowMo; /** - * Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to - * disable timeout. + * Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass {@code 0} + * to disable timeout. */ public Double timeout; /** @@ -252,9 +252,9 @@ public LaunchOptions setDevtools(boolean devtools) { return this; } /** - * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is - * deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in - * is closed. + * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and + * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created + * in is closed. */ public LaunchOptions setDownloadsPath(Path downloadsPath) { this.downloadsPath = downloadsPath; @@ -308,8 +308,8 @@ public LaunchOptions setHandleSIGTERM(boolean handleSIGTERM) { /** * Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to {@code true} unless the - * {@code devtools} option is {@code true}. + * href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode">Firefox. Defaults to {@code true} unless + * the {@code devtools} option is {@code true}. */ public LaunchOptions setHeadless(boolean headless) { this.headless = headless; @@ -352,8 +352,8 @@ public LaunchOptions setSlowMo(double slowMo) { return this; } /** - * Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to - * disable timeout. + * Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass {@code 0} + * to disable timeout. */ public LaunchOptions setTimeout(double timeout) { this.timeout = timeout; @@ -406,8 +406,8 @@ class LaunchPersistentContextOptions { */ public Boolean chromiumSandbox; /** - * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. See - * {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. + * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. + * See {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. * Defaults to {@code "light"}. */ public OptionalcolorScheme; @@ -421,9 +421,9 @@ class LaunchPersistentContextOptions { */ public Boolean devtools; /** - * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is - * deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in - * is closed. + * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and + * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created + * in is closed. */ public Path downloadsPath; /** @@ -465,8 +465,8 @@ class LaunchPersistentContextOptions { /** * Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to {@code true} unless the - * {@code devtools} option is {@code true}. + * href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode">Firefox. Defaults to {@code true} unless + * the {@code devtools} option is {@code true}. */ public Boolean headless; /** @@ -488,8 +488,8 @@ class LaunchPersistentContextOptions { */ public Boolean ignoreHTTPSErrors; /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not supported - * in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not + * supported in Firefox. */ public Boolean isMobile; /** @@ -497,8 +497,8 @@ class LaunchPersistentContextOptions { */ public Boolean javaScriptEnabled; /** - * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, {@code Accept-Language} - * request header value as well as number and date formatting rules. + * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, + * {@code Accept-Language} request header value as well as number and date formatting rules. */ public String locale; /** @@ -572,14 +572,14 @@ class LaunchPersistentContextOptions { */ public Double slowMo; /** - * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors - * that imply single target DOM element will throw when more than one element matches the selector. See {@code Locator} to learn - * more about the strict mode. + * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors + * that imply single target DOM element will throw when more than one element matches the selector. This option does not + * affect any Locator APIs (Locators are always strict). See {@code Locator} to learn more about the strict mode. */ public Boolean strictSelectors; /** - * Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to - * disable timeout. + * Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass {@code 0} + * to disable timeout. */ public Double timeout; /** @@ -667,8 +667,8 @@ public LaunchPersistentContextOptions setChromiumSandbox(boolean chromiumSandbox return this; } /** - * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. See - * {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. + * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. + * See {@link Page#emulateMedia Page.emulateMedia()} for more details. Passing {@code null} resets emulation to system defaults. * Defaults to {@code "light"}. */ public LaunchPersistentContextOptions setColorScheme(ColorScheme colorScheme) { @@ -691,9 +691,9 @@ public LaunchPersistentContextOptions setDevtools(boolean devtools) { return this; } /** - * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is - * deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created in - * is closed. + * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and + * is deleted when browser is closed. In either case, the downloads are deleted when the browser context they were created + * in is closed. */ public LaunchPersistentContextOptions setDownloadsPath(Path downloadsPath) { this.downloadsPath = downloadsPath; @@ -768,8 +768,8 @@ public LaunchPersistentContextOptions setHasTouch(boolean hasTouch) { /** * Whether to run browser in headless mode. More details for Chromium and Firefox. Defaults to {@code true} unless the - * {@code devtools} option is {@code true}. + * href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Headless_mode">Firefox. Defaults to {@code true} unless + * the {@code devtools} option is {@code true}. */ public LaunchPersistentContextOptions setHeadless(boolean headless) { this.headless = headless; @@ -812,8 +812,8 @@ public LaunchPersistentContextOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSEr return this; } /** - * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not supported - * in Firefox. + * Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not + * supported in Firefox. */ public LaunchPersistentContextOptions setIsMobile(boolean isMobile) { this.isMobile = isMobile; @@ -827,8 +827,8 @@ public LaunchPersistentContextOptions setJavaScriptEnabled(boolean javaScriptEna return this; } /** - * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, {@code Accept-Language} - * request header value as well as number and date formatting rules. + * Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, + * {@code Accept-Language} request header value as well as number and date formatting rules. */ public LaunchPersistentContextOptions setLocale(String locale) { this.locale = locale; @@ -972,17 +972,17 @@ public LaunchPersistentContextOptions setSlowMo(double slowMo) { return this; } /** - * If specified, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors - * that imply single target DOM element will throw when more than one element matches the selector. See {@code Locator} to learn - * more about the strict mode. + * If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors + * that imply single target DOM element will throw when more than one element matches the selector. This option does not + * affect any Locator APIs (Locators are always strict). See {@code Locator} to learn more about the strict mode. */ public LaunchPersistentContextOptions setStrictSelectors(boolean strictSelectors) { this.strictSelectors = strictSelectors; return this; } /** - * Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to - * disable timeout. + * Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass {@code 0} + * to disable timeout. */ public LaunchPersistentContextOptions setTimeout(double timeout) { this.timeout = timeout; @@ -1049,6 +1049,8 @@ default Browser connect(String wsEndpoint) { * The default browser context is accessible via {@link Browser#contexts Browser.contexts()}. * *
NOTE: Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers. + * + *
**Usage** *
{@code * Browser browser = playwright.chromium().connectOverCDP("http://localhost:9222"); * BrowserContext defaultContext = browser.contexts().get(0); @@ -1067,6 +1069,8 @@ default Browser connectOverCDP(String endpointURL) { *The default browser context is accessible via {@link Browser#contexts Browser.contexts()}. * *
NOTE: Connecting over the Chrome DevTools Protocol is only supported for Chromium-based browsers. + * + *
**Usage** *
{@code * Browser browser = playwright.chromium().connectOverCDP("http://localhost:9222"); * BrowserContext defaultContext = browser.contexts().get(0); @@ -1084,6 +1088,8 @@ default Browser connectOverCDP(String endpointURL) { /** * Returns the browser instance. * + ***Usage** + * *
You can use {@code ignoreDefaultArgs} to filter out {@code --mute-audio} from default arguments: *
{@code * // Or "firefox" or "webkit". @@ -1107,8 +1113,8 @@ default Browser connectOverCDP(String endpointURL) { * video playback. See this article for * other differences between Chromium and Chrome. This article - * describes some differences for Linux users. + * href="https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md">This + * article describes some differences for Linux users. */ default Browser launch() { return launch(null); @@ -1116,6 +1122,8 @@ default Browser launch() { /** * Returns the browser instance. * + ***Usage** + * *
You can use {@code ignoreDefaultArgs} to filter out {@code --mute-audio} from default arguments: *
{@code * // Or "firefox" or "webkit". @@ -1139,8 +1147,8 @@ default Browser launch() { * video playback. See this article for * other differences between Chromium and Chrome. This article - * describes some differences for Linux users. + * href="https://chromium.googlesource.com/chromium/src/+/lkgr/docs/chromium_browser_vs_google_chrome.md">This + * article describes some differences for Linux users. */ Browser launch(LaunchOptions options); /** diff --git a/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java b/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java index 53ffc56cb..c0109704a 100644 --- a/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java +++ b/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java @@ -56,9 +56,9 @@ public interface ConsoleMessage { */ String text(); /** - * One of the following values: {@code "log"}, {@code "debug"}, {@code "info"}, {@code "error"}, {@code "warning"}, {@code "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"}. + * One of the following values: {@code "log"}, {@code "debug"}, {@code "info"}, {@code "error"}, {@code "warning"}, {@code "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"}. */ String type(); } diff --git a/playwright/src/main/java/com/microsoft/playwright/Download.java b/playwright/src/main/java/com/microsoft/playwright/Download.java index 3a74d7eb1..8ee2ca1ae 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Download.java +++ b/playwright/src/main/java/com/microsoft/playwright/Download.java @@ -60,8 +60,8 @@ public interface Download { * Returns path to the downloaded file in case of successful download. The method will wait for the download to finish if * necessary. The method throws when connected remotely. * - *Note that the download's file name is a random GUID, use {@link Download#suggestedFilename Download.suggestedFilename()} - * to get suggested file name. + *
Note that the download's file name is a random GUID, use {@link Download#suggestedFilename + * Download.suggestedFilename()} to get suggested file name. */ Path path(); /** diff --git a/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java b/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java index 4c452af9a..038401120 100644 --- a/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java +++ b/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java @@ -64,20 +64,20 @@ class CheckOptions { */ public Boolean force; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public Position position; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** @@ -96,33 +96,33 @@ public CheckOptions setForce(boolean force) { return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public CheckOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public CheckOptions setPosition(double x, double y) { return setPosition(new Position(x, y)); } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public CheckOptions setPosition(Position position) { this.position = position; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public CheckOptions setTimeout(double timeout) { this.timeout = timeout; @@ -157,25 +157,25 @@ class ClickOptions { */ public Boolean force; /** - * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current - * modifiers back. If not specified, currently pressed modifiers are used. + * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores + * current modifiers back. If not specified, currently pressed modifiers are used. */ public List
modifiers; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public Position position; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** @@ -215,41 +215,41 @@ public ClickOptions setForce(boolean force) { return this; } /** - * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current - * modifiers back. If not specified, currently pressed modifiers are used. + * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores + * current modifiers back. If not specified, currently pressed modifiers are used. */ public ClickOptions setModifiers(List modifiers) { this.modifiers = modifiers; return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public ClickOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public ClickOptions setPosition(double x, double y) { return setPosition(new Position(x, y)); } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public ClickOptions setPosition(Position position) { this.position = position; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public ClickOptions setTimeout(double timeout) { this.timeout = timeout; @@ -280,25 +280,25 @@ class DblclickOptions { */ public Boolean force; /** - * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current - * modifiers back. If not specified, currently pressed modifiers are used. + * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores + * current modifiers back. If not specified, currently pressed modifiers are used. */ public List modifiers; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public Position position; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** @@ -331,41 +331,41 @@ public DblclickOptions setForce(boolean force) { return this; } /** - * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current - * modifiers back. If not specified, currently pressed modifiers are used. + * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores + * current modifiers back. If not specified, currently pressed modifiers are used. */ public DblclickOptions setModifiers(List modifiers) { this.modifiers = modifiers; return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public DblclickOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public DblclickOptions setPosition(double x, double y) { return setPosition(new Position(x, y)); } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public DblclickOptions setPosition(Position position) { this.position = position; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public DblclickOptions setTimeout(double timeout) { this.timeout = timeout; @@ -388,15 +388,15 @@ class FillOptions { */ public Boolean force; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; @@ -409,18 +409,18 @@ public FillOptions setForce(boolean force) { return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public FillOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public FillOptions setTimeout(double timeout) { this.timeout = timeout; @@ -434,25 +434,25 @@ class HoverOptions { */ public Boolean force; /** - * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current - * modifiers back. If not specified, currently pressed modifiers are used. + * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores + * current modifiers back. If not specified, currently pressed modifiers are used. */ public List modifiers; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public Position position; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** @@ -471,41 +471,41 @@ public HoverOptions setForce(boolean force) { return this; } /** - * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current - * modifiers back. If not specified, currently pressed modifiers are used. + * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores + * current modifiers back. If not specified, currently pressed modifiers are used. */ public HoverOptions setModifiers(List modifiers) { this.modifiers = modifiers; return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public HoverOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public HoverOptions setPosition(double x, double y) { return setPosition(new Position(x, y)); } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public HoverOptions setPosition(Position position) { this.position = position; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public HoverOptions setTimeout(double timeout) { this.timeout = timeout; @@ -523,16 +523,16 @@ public HoverOptions setTrial(boolean trial) { } class InputValueOptions { /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public InputValueOptions setTimeout(double timeout) { this.timeout = timeout; @@ -545,15 +545,15 @@ class PressOptions { */ public Double delay; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; @@ -565,18 +565,18 @@ public PressOptions setDelay(double delay) { return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public PressOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public PressOptions setTimeout(double timeout) { this.timeout = timeout; @@ -606,8 +606,8 @@ class ScreenshotOptions { */ public List mask; /** - * Hides default white background and allows capturing screenshots with transparency. Not applicable to {@code jpeg} images. - * Defaults to {@code false}. + * Hides default white background and allows capturing screenshots with transparency. Not applicable to {@code jpeg} + * images. Defaults to {@code false}. */ public Boolean omitBackground; /** @@ -629,9 +629,9 @@ class ScreenshotOptions { */ public ScreenshotScale scale; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** @@ -670,8 +670,8 @@ public ScreenshotOptions setMask(List mask) { return this; } /** - * Hides default white background and allows capturing screenshots with transparency. Not applicable to {@code jpeg} images. - * Defaults to {@code false}. + * Hides default white background and allows capturing screenshots with transparency. Not applicable to {@code jpeg} + * images. Defaults to {@code false}. */ public ScreenshotOptions setOmitBackground(boolean omitBackground) { this.omitBackground = omitBackground; @@ -705,9 +705,9 @@ public ScreenshotOptions setScale(ScreenshotScale scale) { return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public ScreenshotOptions setTimeout(double timeout) { this.timeout = timeout; @@ -723,16 +723,16 @@ public ScreenshotOptions setType(ScreenshotType type) { } class ScrollIntoViewIfNeededOptions { /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public ScrollIntoViewIfNeededOptions setTimeout(double timeout) { this.timeout = timeout; @@ -746,15 +746,15 @@ class SelectOptionOptions { */ public Boolean force; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; @@ -767,18 +767,18 @@ public SelectOptionOptions setForce(boolean force) { return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public SelectOptionOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public SelectOptionOptions setTimeout(double timeout) { this.timeout = timeout; @@ -792,9 +792,9 @@ class SelectTextOptions { */ public Boolean force; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; @@ -807,9 +807,9 @@ public SelectTextOptions setForce(boolean force) { return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public SelectTextOptions setTimeout(double timeout) { this.timeout = timeout; @@ -823,20 +823,20 @@ class SetCheckedOptions { */ public Boolean force; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public Position position; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** @@ -855,33 +855,33 @@ public SetCheckedOptions setForce(boolean force) { return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public SetCheckedOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public SetCheckedOptions setPosition(double x, double y) { return setPosition(new Position(x, y)); } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public SetCheckedOptions setPosition(Position position) { this.position = position; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public SetCheckedOptions setTimeout(double timeout) { this.timeout = timeout; @@ -899,31 +899,31 @@ public SetCheckedOptions setTrial(boolean trial) { } class SetInputFilesOptions { /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public SetInputFilesOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public SetInputFilesOptions setTimeout(double timeout) { this.timeout = timeout; @@ -937,25 +937,25 @@ class TapOptions { */ public Boolean force; /** - * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current - * modifiers back. If not specified, currently pressed modifiers are used. + * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores + * current modifiers back. If not specified, currently pressed modifiers are used. */ public List modifiers; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public Position position; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** @@ -974,41 +974,41 @@ public TapOptions setForce(boolean force) { return this; } /** - * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current - * modifiers back. If not specified, currently pressed modifiers are used. + * Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores + * current modifiers back. If not specified, currently pressed modifiers are used. */ public TapOptions setModifiers(List modifiers) { this.modifiers = modifiers; return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public TapOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public TapOptions setPosition(double x, double y) { return setPosition(new Position(x, y)); } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public TapOptions setPosition(Position position) { this.position = position; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public TapOptions setTimeout(double timeout) { this.timeout = timeout; @@ -1030,15 +1030,15 @@ class TypeOptions { */ public Double delay; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; @@ -1050,18 +1050,18 @@ public TypeOptions setDelay(double delay) { return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public TypeOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public TypeOptions setTimeout(double timeout) { this.timeout = timeout; @@ -1075,20 +1075,20 @@ class UncheckOptions { */ public Boolean force; /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public Boolean noWaitAfter; /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public Position position; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** @@ -1107,33 +1107,33 @@ public UncheckOptions setForce(boolean force) { return this; } /** - * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can - * opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to - * inaccessible pages. Defaults to {@code false}. + * Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You + * can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as + * navigating to inaccessible pages. Defaults to {@code false}. */ public UncheckOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public UncheckOptions setPosition(double x, double y) { return setPosition(new Position(x, y)); } /** - * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the - * element. + * A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of + * the element. */ public UncheckOptions setPosition(Position position) { this.position = position; return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public UncheckOptions setTimeout(double timeout) { this.timeout = timeout; @@ -1151,16 +1151,16 @@ public UncheckOptions setTrial(boolean trial) { } class WaitForElementStateOptions { /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public WaitForElementStateOptions setTimeout(double timeout) { this.timeout = timeout; @@ -1186,9 +1186,9 @@ class WaitForSelectorOptions { */ public Boolean strict; /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public Double timeout; @@ -1216,9 +1216,9 @@ public WaitForSelectorOptions setStrict(boolean strict) { return this; } /** - * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by - * using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link Page#setDefaultTimeout - * Page.setDefaultTimeout()} methods. + * Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed + * by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. */ public WaitForSelectorOptions setTimeout(double timeout) { this.timeout = timeout; @@ -1226,8 +1226,8 @@ public WaitForSelectorOptions setTimeout(double timeout) { } } /** - * This method returns the bounding box of the element, or {@code null} if the element is not visible. The bounding box is - * calculated relative to the main frame viewport - which is usually the same as the browser window. + * This method returns the bounding box of the element, or {@code null} if the element is not visible. The bounding box + * is calculated relative to the main frame viewport - which is usually the same as the browser window. * * Scrolling affects the returned bounding box, similarly to Element.getBoundingClientRect. @@ -1236,8 +1236,10 @@ public WaitForSelectorOptions setTimeout(double timeout) { *
Elements from child frames return the bounding box relative to the main frame, unlike the Element.getBoundingClientRect. * - *
Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the following - * snippet should click the center of the element. + *
Assuming the page is static, it is safe to use bounding box coordinates to perform input. For example, the + * following snippet should click the center of the element. + * + *
**Usage** *
{@code * BoundingBox box = elementHandle.boundingBox(); * page.mouse().click(box.x + box.width / 2, box.y + box.height / 2); @@ -1366,6 +1368,8 @@ default void dblclick() { * The snippet below dispatches the {@code click} event on the element. Regardless of the visibility state of the element, * {@code click} is dispatched. This is equivalent to calling element.click(). + * + ***Usage** *
{@code * elementHandle.dispatchEvent("click"); * }@@ -1402,6 +1406,8 @@ default void dispatchEvent(String type) { * The snippet below dispatches the {@code click} event on the element. Regardless of the visibility state of the element, * {@code click} is dispatched. This is equivalent to calling element.click(). + * + ***Usage** *
{@code * elementHandle.dispatchEvent("click"); * }@@ -1436,23 +1442,21 @@ default void dispatchEvent(String type) { /** * Returns the return value of {@code expression}. * - *The method finds an element matching the specified selector in the {@code ElementHandle}s subtree and passes it as a first - * argument to {@code expression}. See Working with selectors for more - * details. If no elements match the selector, the method throws an error. + *
The method finds an element matching the specified selector in the {@code ElementHandle}s subtree and passes it as a + * first argument to {@code expression}. If no elements match the selector, the method throws an error. * *
If {@code expression} returns a Promise, then {@link * ElementHandle#evalOnSelector ElementHandle.evalOnSelector()} would wait for the promise to resolve and return its value. * - *
Examples: + *
**Usage** *
{@code * ElementHandle tweetHandle = page.querySelector(".tweet"); * assertEquals("100", tweetHandle.evalOnSelector(".like", "node => node.innerText")); * assertEquals("10", tweetHandle.evalOnSelector(".retweets", "node => node.innerText")); * }* - * @param selector A selector to query for. See working with selectors for more - * details. + * @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. */ @@ -1462,23 +1466,21 @@ default Object evalOnSelector(String selector, String expression) { /** * Returns the return value of {@code expression}. * - *The method finds an element matching the specified selector in the {@code ElementHandle}s subtree and passes it as a first - * argument to {@code expression}. See Working with selectors for more - * details. If no elements match the selector, the method throws an error. + *
The method finds an element matching the specified selector in the {@code ElementHandle}s subtree and passes it as a + * first argument to {@code expression}. If no elements match the selector, the method throws an error. * *
If {@code expression} returns a Promise, then {@link * ElementHandle#evalOnSelector ElementHandle.evalOnSelector()} would wait for the promise to resolve and return its value. * - *
Examples: + *
**Usage** *
{@code * ElementHandle tweetHandle = page.querySelector(".tweet"); * assertEquals("100", tweetHandle.evalOnSelector(".like", "node => node.innerText")); * assertEquals("10", tweetHandle.evalOnSelector(".retweets", "node => node.innerText")); * }* - * @param selector A selector to query for. See working with selectors for more - * details. + * @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. * @param arg Optional argument to pass to {@code expression}. @@ -1487,23 +1489,21 @@ default Object evalOnSelector(String selector, String expression) { /** * Returns the return value of {@code expression}. * - *The method finds all elements matching the specified selector in the {@code ElementHandle}'s subtree and passes an array of - * matched elements as a first argument to {@code expression}. See Working - * with selectors for more details. + *
The method finds all elements matching the specified selector in the {@code ElementHandle}'s subtree and passes an array + * of matched elements as a first argument to {@code expression}. * *
If {@code expression} returns a Promise, then {@link - * ElementHandle#evalOnSelectorAll ElementHandle.evalOnSelectorAll()} would wait for the promise to resolve and return its - * value. + * ElementHandle#evalOnSelectorAll ElementHandle.evalOnSelectorAll()} would wait for the promise to resolve and return + * its value. * - *
Examples: + *
**Usage** *
{@code * ElementHandle feedHandle = page.querySelector(".feed"); * assertEquals(Arrays.asList("Hello!", "Hi!"), feedHandle.evalOnSelectorAll(".tweet", "nodes => nodes.map(n => n.innerText)")); * }* - * @param selector A selector to query for. See working with selectors for more - * details. + * @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. */ @@ -1513,23 +1513,21 @@ default Object evalOnSelectorAll(String selector, String expression) { /** * Returns the return value of {@code expression}. * - *The method finds all elements matching the specified selector in the {@code ElementHandle}'s subtree and passes an array of - * matched elements as a first argument to {@code expression}. See Working - * with selectors for more details. + *
The method finds all elements matching the specified selector in the {@code ElementHandle}'s subtree and passes an array + * of matched elements as a first argument to {@code expression}. * *
If {@code expression} returns a Promise, then {@link - * ElementHandle#evalOnSelectorAll ElementHandle.evalOnSelectorAll()} would wait for the promise to resolve and return its - * value. + * ElementHandle#evalOnSelectorAll ElementHandle.evalOnSelectorAll()} would wait for the promise to resolve and return + * its value. * - *
Examples: + *
**Usage** *
{@code * ElementHandle feedHandle = page.querySelector(".feed"); * assertEquals(Arrays.asList("Hello!", "Hi!"), feedHandle.evalOnSelectorAll(".tweet", "nodes => nodes.map(n => n.innerText)")); * }* - * @param selector A selector to query for. See working with selectors for more - * details. + * @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. * @param arg Optional argument to pass to {@code expression}. @@ -1675,8 +1673,9 @@ default String inputValue() { * character to generate the text for. A superset of the {@code key} values can be found here. Examples of the keys are: * - *{@code F1} - {@code F12}, {@code Digit0}- {@code Digit9}, {@code KeyA}- {@code KeyZ}, {@code Backquote}, {@code Minus}, {@code Equal}, {@code Backslash}, {@code Backspace}, {@code Tab}, - * {@code Delete}, {@code Escape}, {@code ArrowDown}, {@code End}, {@code Enter}, {@code Home}, {@code Insert}, {@code PageDown}, {@code PageUp}, {@code ArrowRight}, {@code ArrowUp}, etc. + *
{@code F1} - {@code F12}, {@code Digit0}- {@code Digit9}, {@code KeyA}- {@code KeyZ}, {@code Backquote}, {@code Minus}, {@code Equal}, {@code Backslash}, {@code Backspace}, + * {@code Tab}, {@code Delete}, {@code Escape}, {@code ArrowDown}, {@code End}, {@code Enter}, {@code Home}, {@code Insert}, {@code PageDown}, {@code PageUp}, {@code ArrowRight}, {@code ArrowUp}, + * etc. * *
Following modification shortcuts are also supported: {@code Shift}, {@code Control}, {@code Alt}, {@code Meta}, {@code ShiftLeft}. * @@ -1685,8 +1684,8 @@ default String inputValue() { *
If {@code key} is a single character, it is case-sensitive, so the values {@code a} and {@code A} will generate different respective * texts. * - *
Shortcuts such as {@code key: "Control+o"} or {@code key: "Control+Shift+T"} are supported as well. When specified with the - * modifier, modifier is pressed and being held while the subsequent key is being pressed. + *
Shortcuts such as {@code key: "Control+o"} or {@code key: "Control+Shift+T"} are supported as well. When specified with + * 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}. */ @@ -1701,8 +1700,9 @@ default void press(String key) { * character to generate the text for. A superset of the {@code key} values can be found here. Examples of the keys are: * - *
{@code F1} - {@code F12}, {@code Digit0}- {@code Digit9}, {@code KeyA}- {@code KeyZ}, {@code Backquote}, {@code Minus}, {@code Equal}, {@code Backslash}, {@code Backspace}, {@code Tab}, - * {@code Delete}, {@code Escape}, {@code ArrowDown}, {@code End}, {@code Enter}, {@code Home}, {@code Insert}, {@code PageDown}, {@code PageUp}, {@code ArrowRight}, {@code ArrowUp}, etc. + *
{@code F1} - {@code F12}, {@code Digit0}- {@code Digit9}, {@code KeyA}- {@code KeyZ}, {@code Backquote}, {@code Minus}, {@code Equal}, {@code Backslash}, {@code Backspace}, + * {@code Tab}, {@code Delete}, {@code Escape}, {@code ArrowDown}, {@code End}, {@code Enter}, {@code Home}, {@code Insert}, {@code PageDown}, {@code PageUp}, {@code ArrowRight}, {@code ArrowUp}, + * etc. * *
Following modification shortcuts are also supported: {@code Shift}, {@code Control}, {@code Alt}, {@code Meta}, {@code ShiftLeft}. * @@ -1711,28 +1711,24 @@ default void press(String key) { *
If {@code key} is a single character, it is case-sensitive, so the values {@code a} and {@code A} will generate different respective * texts. * - *
Shortcuts such as {@code key: "Control+o"} or {@code key: "Control+Shift+T"} are supported as well. When specified with the - * modifier, modifier is pressed and being held while the subsequent key is being pressed. + *
Shortcuts such as {@code key: "Control+o"} or {@code key: "Control+Shift+T"} are supported as well. When specified with + * 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}. */ void press(String key, PressOptions options); /** - * The method finds an element matching the specified selector in the {@code ElementHandle}'s subtree. See Working with selectors for more details. If no elements match the + * The method finds an element matching the specified selector in the {@code ElementHandle}'s subtree. If no elements match the * selector, returns {@code null}. * - * @param selector A selector to query for. See working with selectors for more - * details. + * @param selector A selector to query for. */ ElementHandle querySelector(String selector); /** - * The method finds all elements matching the specified selector in the {@code ElementHandle}s subtree. See Working with selectors for more details. If no elements match the + * The method finds all elements matching the specified selector in the {@code ElementHandle}s subtree. If no elements match the * selector, returns empty array. * - * @param selector A selector to query for. See working with selectors for more - * details. + * @param selector A selector to query for. */ List
querySelectorAll(String selector); /** @@ -1791,6 +1787,8 @@ default void scrollIntoViewIfNeeded() { * Returns the array of option values that have been successfully selected. * *
Triggers a {@code change} and {@code input} event once all the provided options have been selected. + * + *
**Usage** *
{@code * // single selection matching the value * handle.selectOption("blue"); @@ -1800,9 +1798,9 @@ default void scrollIntoViewIfNeeded() { * handle.selectOption(new String[] {"red", "green", "blue"}); * }* - * @param values Options to select. If the {@code