diff --git a/playwright/src/main/java/com/microsoft/playwright/Browser.java b/playwright/src/main/java/com/microsoft/playwright/Browser.java index cf7b6d33..b895a262 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Browser.java +++ b/playwright/src/main/java/com/microsoft/playwright/Browser.java @@ -196,26 +196,53 @@ public interface Browser extends AutoCloseable { */ public Optional viewportSize; + /** + * Whether to automatically download all the attachments. Defaults to {@code false} where all the downloads are canceled. + */ public NewContextOptions setAcceptDownloads(boolean acceptDownloads) { this.acceptDownloads = acceptDownloads; return this; } + /** + * When using {@link Page#navigate Page.navigate()}, {@link Page#route Page.route()}, {@link Page#waitForURL + * Page.waitForURL()}, {@link Page#waitForRequest Page.waitForRequest()}, or {@link Page#waitForResponse + * Page.waitForResponse()} it takes the base URL in consideration by using the {@code URL()} constructor for building the corresponding + * URL. Examples: + * + */ public NewContextOptions setBaseURL(String baseURL) { this.baseURL = baseURL; return this; } + /** + * Toggles bypassing page's Content-Security-Policy. + */ public NewContextOptions setBypassCSP(boolean bypassCSP) { this.bypassCSP = 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. Defaults to {@code "light"}. + */ public NewContextOptions setColorScheme(ColorScheme colorScheme) { this.colorScheme = colorScheme; return this; } + /** + * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. + */ public NewContextOptions setDeviceScaleFactor(double deviceScaleFactor) { this.deviceScaleFactor = deviceScaleFactor; return this; } + /** + * An object containing additional HTTP headers to be sent with every request. All header values must be strings. + */ public NewContextOptions setExtraHTTPHeaders(Map extraHTTPHeaders) { this.extraHTTPHeaders = extraHTTPHeaders; return this; @@ -227,101 +254,207 @@ public interface Browser extends AutoCloseable { this.geolocation = geolocation; return this; } + /** + * Specifies if viewport supports touch events. Defaults to false. + */ public NewContextOptions setHasTouch(boolean hasTouch) { this.hasTouch = hasTouch; return this; } + /** + * Credentials for HTTP authentication. + */ public NewContextOptions setHttpCredentials(String username, String password) { return setHttpCredentials(new HttpCredentials(username, password)); } + /** + * Credentials for HTTP authentication. + */ public NewContextOptions setHttpCredentials(HttpCredentials httpCredentials) { this.httpCredentials = httpCredentials; return this; } + /** + * Whether to ignore HTTPS errors during navigation. Defaults to {@code false}. + */ public NewContextOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) { this.ignoreHTTPSErrors = 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. + */ public NewContextOptions setIsMobile(boolean isMobile) { this.isMobile = isMobile; return this; } + /** + * Whether or not to enable JavaScript in the context. Defaults to {@code true}. + */ public NewContextOptions setJavaScriptEnabled(boolean javaScriptEnabled) { this.javaScriptEnabled = 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. + */ public NewContextOptions setLocale(String locale) { this.locale = locale; return this; } + /** + * Whether to emulate network being offline. Defaults to {@code false}. + */ public NewContextOptions setOffline(boolean offline) { this.offline = offline; return this; } + /** + * A list of permissions to grant to all pages in this context. See {@link BrowserContext#grantPermissions + * BrowserContext.grantPermissions()} for more details. + */ public NewContextOptions setPermissions(List permissions) { this.permissions = permissions; return this; } + /** + * Network proxy settings to use with this context. + * + *

NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all contexts + * override the proxy, global proxy will be never used and can be any string, for example {@code launch({ proxy: { server: + * 'http://per-context' } })}. + */ public NewContextOptions setProxy(String server) { return setProxy(new Proxy(server)); } + /** + * Network proxy settings to use with this context. + * + *

NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all contexts + * override the proxy, global proxy will be never used and can be any string, for example {@code launch({ proxy: { server: + * 'http://per-context' } })}. + */ public NewContextOptions setProxy(Proxy proxy) { this.proxy = proxy; return this; } + /** + * Optional setting to control whether to omit request content from the HAR. Defaults to {@code false}. + */ public NewContextOptions setRecordHarOmitContent(boolean recordHarOmitContent) { this.recordHarOmitContent = recordHarOmitContent; return this; } + /** + * Enables HAR recording for all pages into the specified HAR + * file on the filesystem. If not specified, the HAR is not recorded. Make sure to call {@link BrowserContext#close + * BrowserContext.close()} for the HAR to be saved. + */ public NewContextOptions setRecordHarPath(Path recordHarPath) { this.recordHarPath = recordHarPath; return this; } + /** + * Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure + * to call {@link BrowserContext#close BrowserContext.close()} for videos to be saved. + */ public NewContextOptions setRecordVideoDir(Path recordVideoDir) { this.recordVideoDir = recordVideoDir; return this; } + /** + * Dimensions of the recorded videos. If not specified the size will be equal to {@code viewport} scaled down to fit into + * 800x800. If {@code viewport} is not configured explicitly the video size defaults to 800x450. Actual picture of each page will + * be scaled down if necessary to fit the specified size. + */ public NewContextOptions setRecordVideoSize(int width, int height) { return setRecordVideoSize(new RecordVideoSize(width, height)); } + /** + * Dimensions of the recorded videos. If not specified the size will be equal to {@code viewport} scaled down to fit into + * 800x800. If {@code viewport} is not configured explicitly the video size defaults to 800x450. Actual picture of each page will + * be scaled down if necessary to fit the specified size. + */ public NewContextOptions setRecordVideoSize(RecordVideoSize recordVideoSize) { this.recordVideoSize = recordVideoSize; return this; } + /** + * Emulates {@code "prefers-reduced-motion"} media feature, supported values are {@code "reduce"}, {@code "no-preference"}. See {@link + * Page#emulateMedia Page.emulateMedia()} for more details. Defaults to {@code "no-preference"}. + */ public NewContextOptions setReducedMotion(ReducedMotion reducedMotion) { this.reducedMotion = reducedMotion; return this; } + /** + * Emulates consistent window screen size available inside web page via {@code window.screen}. Is only used when the {@code viewport} + * is set. + */ public NewContextOptions setScreenSize(int width, int height) { return setScreenSize(new ScreenSize(width, height)); } + /** + * Emulates consistent window screen size available inside web page via {@code window.screen}. Is only used when the {@code viewport} + * is set. + */ public NewContextOptions setScreenSize(ScreenSize screenSize) { this.screenSize = screenSize; 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()}. + */ 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. + */ public NewContextOptions setStorageStatePath(Path storageStatePath) { this.storageStatePath = storageStatePath; return this; } + /** + * It 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. + */ public NewContextOptions setStrictSelectors(boolean strictSelectors) { this.strictSelectors = strictSelectors; return this; } + /** + * Changes the timezone of the context. See ICU's + * metaZones.txt for a list of supported timezone IDs. + */ public NewContextOptions setTimezoneId(String timezoneId) { this.timezoneId = timezoneId; return this; } + /** + * Specific user agent to use in this context. + */ public NewContextOptions setUserAgent(String userAgent) { this.userAgent = userAgent; return this; } + /** + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. {@code null} disables the default viewport. + */ public NewContextOptions setViewportSize(int width, int height) { return setViewportSize(new ViewportSize(width, height)); } + /** + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. {@code null} disables the default viewport. + */ public NewContextOptions setViewportSize(ViewportSize viewportSize) { this.viewportSize = Optional.ofNullable(viewportSize); return this; @@ -468,26 +601,53 @@ public interface Browser extends AutoCloseable { */ public Optional viewportSize; + /** + * Whether to automatically download all the attachments. Defaults to {@code false} where all the downloads are canceled. + */ public NewPageOptions setAcceptDownloads(boolean acceptDownloads) { this.acceptDownloads = acceptDownloads; return this; } + /** + * When using {@link Page#navigate Page.navigate()}, {@link Page#route Page.route()}, {@link Page#waitForURL + * Page.waitForURL()}, {@link Page#waitForRequest Page.waitForRequest()}, or {@link Page#waitForResponse + * Page.waitForResponse()} it takes the base URL in consideration by using the {@code URL()} constructor for building the corresponding + * URL. Examples: + *

    + *
  • baseURL: {@code http://localhost:3000} and navigating to {@code /bar.html} results in {@code http://localhost:3000/bar.html}
  • + *
  • baseURL: {@code http://localhost:3000/foo/} and navigating to {@code ./bar.html} results in {@code http://localhost:3000/foo/bar.html}
  • + *
+ */ public NewPageOptions setBaseURL(String baseURL) { this.baseURL = baseURL; return this; } + /** + * Toggles bypassing page's Content-Security-Policy. + */ public NewPageOptions setBypassCSP(boolean bypassCSP) { this.bypassCSP = 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. Defaults to {@code "light"}. + */ public NewPageOptions setColorScheme(ColorScheme colorScheme) { this.colorScheme = colorScheme; return this; } + /** + * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. + */ public NewPageOptions setDeviceScaleFactor(double deviceScaleFactor) { this.deviceScaleFactor = deviceScaleFactor; return this; } + /** + * An object containing additional HTTP headers to be sent with every request. All header values must be strings. + */ public NewPageOptions setExtraHTTPHeaders(Map extraHTTPHeaders) { this.extraHTTPHeaders = extraHTTPHeaders; return this; @@ -499,101 +659,207 @@ public interface Browser extends AutoCloseable { this.geolocation = geolocation; return this; } + /** + * Specifies if viewport supports touch events. Defaults to false. + */ public NewPageOptions setHasTouch(boolean hasTouch) { this.hasTouch = hasTouch; return this; } + /** + * Credentials for HTTP authentication. + */ public NewPageOptions setHttpCredentials(String username, String password) { return setHttpCredentials(new HttpCredentials(username, password)); } + /** + * Credentials for HTTP authentication. + */ public NewPageOptions setHttpCredentials(HttpCredentials httpCredentials) { this.httpCredentials = httpCredentials; return this; } + /** + * Whether to ignore HTTPS errors during navigation. Defaults to {@code false}. + */ public NewPageOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) { this.ignoreHTTPSErrors = 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. + */ public NewPageOptions setIsMobile(boolean isMobile) { this.isMobile = isMobile; return this; } + /** + * Whether or not to enable JavaScript in the context. Defaults to {@code true}. + */ public NewPageOptions setJavaScriptEnabled(boolean javaScriptEnabled) { this.javaScriptEnabled = 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. + */ public NewPageOptions setLocale(String locale) { this.locale = locale; return this; } + /** + * Whether to emulate network being offline. Defaults to {@code false}. + */ public NewPageOptions setOffline(boolean offline) { this.offline = offline; return this; } + /** + * A list of permissions to grant to all pages in this context. See {@link BrowserContext#grantPermissions + * BrowserContext.grantPermissions()} for more details. + */ public NewPageOptions setPermissions(List permissions) { this.permissions = permissions; return this; } + /** + * Network proxy settings to use with this context. + * + *

NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all contexts + * override the proxy, global proxy will be never used and can be any string, for example {@code launch({ proxy: { server: + * 'http://per-context' } })}. + */ public NewPageOptions setProxy(String server) { return setProxy(new Proxy(server)); } + /** + * Network proxy settings to use with this context. + * + *

NOTE: For Chromium on Windows the browser needs to be launched with the global proxy for this option to work. If all contexts + * override the proxy, global proxy will be never used and can be any string, for example {@code launch({ proxy: { server: + * 'http://per-context' } })}. + */ public NewPageOptions setProxy(Proxy proxy) { this.proxy = proxy; return this; } + /** + * Optional setting to control whether to omit request content from the HAR. Defaults to {@code false}. + */ public NewPageOptions setRecordHarOmitContent(boolean recordHarOmitContent) { this.recordHarOmitContent = recordHarOmitContent; return this; } + /** + * Enables HAR recording for all pages into the specified HAR + * file on the filesystem. If not specified, the HAR is not recorded. Make sure to call {@link BrowserContext#close + * BrowserContext.close()} for the HAR to be saved. + */ public NewPageOptions setRecordHarPath(Path recordHarPath) { this.recordHarPath = recordHarPath; return this; } + /** + * Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure + * to call {@link BrowserContext#close BrowserContext.close()} for videos to be saved. + */ public NewPageOptions setRecordVideoDir(Path recordVideoDir) { this.recordVideoDir = recordVideoDir; return this; } + /** + * Dimensions of the recorded videos. If not specified the size will be equal to {@code viewport} scaled down to fit into + * 800x800. If {@code viewport} is not configured explicitly the video size defaults to 800x450. Actual picture of each page will + * be scaled down if necessary to fit the specified size. + */ public NewPageOptions setRecordVideoSize(int width, int height) { return setRecordVideoSize(new RecordVideoSize(width, height)); } + /** + * Dimensions of the recorded videos. If not specified the size will be equal to {@code viewport} scaled down to fit into + * 800x800. If {@code viewport} is not configured explicitly the video size defaults to 800x450. Actual picture of each page will + * be scaled down if necessary to fit the specified size. + */ public NewPageOptions setRecordVideoSize(RecordVideoSize recordVideoSize) { this.recordVideoSize = recordVideoSize; return this; } + /** + * Emulates {@code "prefers-reduced-motion"} media feature, supported values are {@code "reduce"}, {@code "no-preference"}. See {@link + * Page#emulateMedia Page.emulateMedia()} for more details. Defaults to {@code "no-preference"}. + */ public NewPageOptions setReducedMotion(ReducedMotion reducedMotion) { this.reducedMotion = reducedMotion; return this; } + /** + * Emulates consistent window screen size available inside web page via {@code window.screen}. Is only used when the {@code viewport} + * is set. + */ public NewPageOptions setScreenSize(int width, int height) { return setScreenSize(new ScreenSize(width, height)); } + /** + * Emulates consistent window screen size available inside web page via {@code window.screen}. Is only used when the {@code viewport} + * is set. + */ public NewPageOptions setScreenSize(ScreenSize screenSize) { this.screenSize = screenSize; 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()}. + */ 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. + */ public NewPageOptions setStorageStatePath(Path storageStatePath) { this.storageStatePath = storageStatePath; return this; } + /** + * It 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. + */ public NewPageOptions setStrictSelectors(boolean strictSelectors) { this.strictSelectors = strictSelectors; return this; } + /** + * Changes the timezone of the context. See ICU's + * metaZones.txt for a list of supported timezone IDs. + */ public NewPageOptions setTimezoneId(String timezoneId) { this.timezoneId = timezoneId; return this; } + /** + * Specific user agent to use in this context. + */ public NewPageOptions setUserAgent(String userAgent) { this.userAgent = userAgent; return this; } + /** + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. {@code null} disables the default viewport. + */ public NewPageOptions setViewportSize(int width, int height) { return setViewportSize(new ViewportSize(width, height)); } + /** + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. {@code null} disables the default viewport. + */ public NewPageOptions setViewportSize(ViewportSize viewportSize) { this.viewportSize = Optional.ofNullable(viewportSize); return this; @@ -613,14 +879,23 @@ public interface Browser extends AutoCloseable { */ public Boolean screenshots; + /** + * specify custom categories to use instead of default. + */ public StartTracingOptions setCategories(List categories) { this.categories = categories; return this; } + /** + * A path to write the trace file to. + */ public StartTracingOptions setPath(Path path) { this.path = path; return this; } + /** + * captures screenshots in the trace. + */ public StartTracingOptions setScreenshots(boolean screenshots) { this.screenshots = screenshots; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java index ec7fbde6..36f422f6 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserContext.java @@ -137,6 +137,10 @@ public interface BrowserContext extends AutoCloseable { */ 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. + */ public ExposeBindingOptions setHandle(boolean handle) { this.handle = handle; return this; @@ -148,6 +152,9 @@ public interface BrowserContext extends AutoCloseable { */ public String origin; + /** + * The [origin] to grant permissions to, e.g. "https://example.com". + */ public GrantPermissionsOptions setOrigin(String origin) { this.origin = origin; return this; @@ -160,6 +167,10 @@ public interface BrowserContext extends AutoCloseable { */ public Path path; + /** + * The file path to save the storage state to. If {@code path} is a relative path, then it is resolved relative to current + * working directory. If no path is provided, storage state is still returned, but won't be saved to the disk. + */ public StorageStateOptions setPath(Path path) { this.path = path; return this; @@ -176,10 +187,17 @@ public interface BrowserContext extends AutoCloseable { */ public Double timeout; + /** + * Receives the {@code Page} object and resolves to truthy value when the waiting should resolve. + */ public WaitForPageOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForPageOptions setTimeout(double timeout) { this.timeout = timeout; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java index 8722ad32..cd8b82ad 100644 --- a/playwright/src/main/java/com/microsoft/playwright/BrowserType.java +++ b/playwright/src/main/java/com/microsoft/playwright/BrowserType.java @@ -57,14 +57,25 @@ public interface BrowserType { */ public Double timeout; + /** + * Additional HTTP headers to be sent with web socket connect request. Optional. + */ public ConnectOptions setHeaders(Map headers) { this.headers = headers; return this; } + /** + * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. + * Defaults to 0. + */ public ConnectOptions setSlowMo(double slowMo) { this.slowMo = slowMo; return this; } + /** + * Maximum time in milliseconds to wait for the connection to be established. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to + * disable timeout. + */ public ConnectOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -86,14 +97,25 @@ public interface BrowserType { */ public Double timeout; + /** + * Additional HTTP headers to be sent with connect request. Optional. + */ public ConnectOverCDPOptions setHeaders(Map headers) { this.headers = headers; return this; } + /** + * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. + * Defaults to 0. + */ public ConnectOverCDPOptions setSlowMo(double slowMo) { this.slowMo = slowMo; return this; } + /** + * Maximum time in milliseconds to wait for the connection to be established. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to + * disable timeout. + */ public ConnectOverCDPOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -187,82 +209,158 @@ public interface BrowserType { */ public Path tracesDir; + /** + * Additional arguments to pass to the browser instance. The list of Chromium flags can be found here. + */ public LaunchOptions setArgs(List args) { this.args = args; return this; } @Deprecated + /** + * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", + * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. + */ public LaunchOptions setChannel(BrowserChannel channel) { this.channel = channel; return this; } + /** + * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", + * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. + */ public LaunchOptions setChannel(String channel) { this.channel = channel; return this; } + /** + * Enable Chromium sandboxing. Defaults to {@code false}. + */ public LaunchOptions setChromiumSandbox(boolean chromiumSandbox) { this.chromiumSandbox = chromiumSandbox; return this; } + /** + * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is {@code true}, the {@code headless} + * option will be set {@code false}. + */ public LaunchOptions setDevtools(boolean devtools) { this.devtools = devtools; return this; } + /** + * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is + * deleted when browser is closed. + */ public LaunchOptions setDownloadsPath(Path downloadsPath) { this.downloadsPath = downloadsPath; return this; } + /** + * Specify environment variables that will be visible to the browser. Defaults to {@code process.env}. + */ public LaunchOptions setEnv(Map env) { this.env = env; return this; } + /** + * Path to a browser executable to run instead of the bundled one. If {@code executablePath} is a relative path, then it is + * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox + * or WebKit, use at your own risk. + */ public LaunchOptions setExecutablePath(Path executablePath) { this.executablePath = executablePath; return this; } + /** + * Firefox user preferences. Learn more about the Firefox user preferences at {@code about:config}. + */ public LaunchOptions setFirefoxUserPrefs(Map firefoxUserPrefs) { this.firefoxUserPrefs = firefoxUserPrefs; return this; } + /** + * Close the browser process on SIGHUP. Defaults to {@code true}. + */ public LaunchOptions setHandleSIGHUP(boolean handleSIGHUP) { this.handleSIGHUP = handleSIGHUP; return this; } + /** + * Close the browser process on Ctrl-C. Defaults to {@code true}. + */ public LaunchOptions setHandleSIGINT(boolean handleSIGINT) { this.handleSIGINT = handleSIGINT; return this; } + /** + * Close the browser process on SIGTERM. Defaults to {@code true}. + */ public LaunchOptions setHandleSIGTERM(boolean handleSIGTERM) { this.handleSIGTERM = handleSIGTERM; return this; } + /** + * 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}. + */ public LaunchOptions setHeadless(boolean headless) { this.headless = headless; return this; } + /** + * If {@code true}, Playwright does not pass its own configurations args and only uses the ones from {@code args}. Dangerous option; + * use with care. Defaults to {@code false}. + */ public LaunchOptions setIgnoreAllDefaultArgs(boolean ignoreAllDefaultArgs) { this.ignoreAllDefaultArgs = ignoreAllDefaultArgs; return this; } + /** + * If {@code true}, Playwright does not pass its own configurations args and only uses the ones from {@code args}. Dangerous option; + * use with care. + */ public LaunchOptions setIgnoreDefaultArgs(List ignoreDefaultArgs) { this.ignoreDefaultArgs = ignoreDefaultArgs; return this; } + /** + * Network proxy settings. + */ public LaunchOptions setProxy(String server) { return setProxy(new Proxy(server)); } + /** + * Network proxy settings. + */ public LaunchOptions setProxy(Proxy proxy) { this.proxy = proxy; return this; } + /** + * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. + */ public LaunchOptions setSlowMo(double slowMo) { this.slowMo = 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. + */ public LaunchOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * If specified, traces are saved into this directory. + */ public LaunchOptions setTracesDir(Path tracesDir) { this.tracesDir = tracesDir; return this; @@ -471,59 +569,119 @@ public interface BrowserType { */ public Optional viewportSize; + /** + * Whether to automatically download all the attachments. Defaults to {@code false} where all the downloads are canceled. + */ public LaunchPersistentContextOptions setAcceptDownloads(boolean acceptDownloads) { this.acceptDownloads = acceptDownloads; return this; } + /** + * Additional arguments to pass to the browser instance. The list of Chromium flags can be found here. + */ public LaunchPersistentContextOptions setArgs(List args) { this.args = args; return this; } + /** + * When using {@link Page#navigate Page.navigate()}, {@link Page#route Page.route()}, {@link Page#waitForURL + * Page.waitForURL()}, {@link Page#waitForRequest Page.waitForRequest()}, or {@link Page#waitForResponse + * Page.waitForResponse()} it takes the base URL in consideration by using the {@code URL()} constructor for building the corresponding + * URL. Examples: + *

    + *
  • baseURL: {@code http://localhost:3000} and navigating to {@code /bar.html} results in {@code http://localhost:3000/bar.html}
  • + *
  • baseURL: {@code http://localhost:3000/foo/} and navigating to {@code ./bar.html} results in {@code http://localhost:3000/foo/bar.html}
  • + *
+ */ public LaunchPersistentContextOptions setBaseURL(String baseURL) { this.baseURL = baseURL; return this; } + /** + * Toggles bypassing page's Content-Security-Policy. + */ public LaunchPersistentContextOptions setBypassCSP(boolean bypassCSP) { this.bypassCSP = bypassCSP; return this; } @Deprecated + /** + * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", + * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. + */ public LaunchPersistentContextOptions setChannel(BrowserChannel channel) { this.channel = channel; return this; } + /** + * Browser distribution channel. Supported values are "chrome", "chrome-beta", "chrome-dev", "chrome-canary", "msedge", + * "msedge-beta", "msedge-dev", "msedge-canary". Read more about using Google Chrome and Microsoft Edge. + */ public LaunchPersistentContextOptions setChannel(String channel) { this.channel = channel; return this; } + /** + * Enable Chromium sandboxing. Defaults to {@code false}. + */ public LaunchPersistentContextOptions setChromiumSandbox(boolean chromiumSandbox) { this.chromiumSandbox = 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. Defaults to {@code "light"}. + */ public LaunchPersistentContextOptions setColorScheme(ColorScheme colorScheme) { this.colorScheme = colorScheme; return this; } + /** + * Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}. + */ public LaunchPersistentContextOptions setDeviceScaleFactor(double deviceScaleFactor) { this.deviceScaleFactor = deviceScaleFactor; return this; } + /** + * **Chromium-only** Whether to auto-open a Developer Tools panel for each tab. If this option is {@code true}, the {@code headless} + * option will be set {@code false}. + */ public LaunchPersistentContextOptions setDevtools(boolean devtools) { this.devtools = devtools; return this; } + /** + * If specified, accepted downloads are downloaded into this directory. Otherwise, temporary directory is created and is + * deleted when browser is closed. + */ public LaunchPersistentContextOptions setDownloadsPath(Path downloadsPath) { this.downloadsPath = downloadsPath; return this; } + /** + * Specify environment variables that will be visible to the browser. Defaults to {@code process.env}. + */ public LaunchPersistentContextOptions setEnv(Map env) { this.env = env; return this; } + /** + * Path to a browser executable to run instead of the bundled one. If {@code executablePath} is a relative path, then it is + * resolved relative to the current working directory. Note that Playwright only works with the bundled Chromium, Firefox + * or WebKit, use at your own risk. + */ public LaunchPersistentContextOptions setExecutablePath(Path executablePath) { this.executablePath = executablePath; return this; } + /** + * An object containing additional HTTP headers to be sent with every request. All header values must be strings. + */ public LaunchPersistentContextOptions setExtraHTTPHeaders(Map extraHTTPHeaders) { this.extraHTTPHeaders = extraHTTPHeaders; return this; @@ -535,129 +693,251 @@ public interface BrowserType { this.geolocation = geolocation; return this; } + /** + * Close the browser process on SIGHUP. Defaults to {@code true}. + */ public LaunchPersistentContextOptions setHandleSIGHUP(boolean handleSIGHUP) { this.handleSIGHUP = handleSIGHUP; return this; } + /** + * Close the browser process on Ctrl-C. Defaults to {@code true}. + */ public LaunchPersistentContextOptions setHandleSIGINT(boolean handleSIGINT) { this.handleSIGINT = handleSIGINT; return this; } + /** + * Close the browser process on SIGTERM. Defaults to {@code true}. + */ public LaunchPersistentContextOptions setHandleSIGTERM(boolean handleSIGTERM) { this.handleSIGTERM = handleSIGTERM; return this; } + /** + * Specifies if viewport supports touch events. Defaults to false. + */ public LaunchPersistentContextOptions setHasTouch(boolean hasTouch) { this.hasTouch = hasTouch; return this; } + /** + * 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}. + */ public LaunchPersistentContextOptions setHeadless(boolean headless) { this.headless = headless; return this; } + /** + * Credentials for HTTP authentication. + */ public LaunchPersistentContextOptions setHttpCredentials(String username, String password) { return setHttpCredentials(new HttpCredentials(username, password)); } + /** + * Credentials for HTTP authentication. + */ public LaunchPersistentContextOptions setHttpCredentials(HttpCredentials httpCredentials) { this.httpCredentials = httpCredentials; return this; } + /** + * If {@code true}, Playwright does not pass its own configurations args and only uses the ones from {@code args}. Dangerous option; + * use with care. Defaults to {@code false}. + */ public LaunchPersistentContextOptions setIgnoreAllDefaultArgs(boolean ignoreAllDefaultArgs) { this.ignoreAllDefaultArgs = ignoreAllDefaultArgs; return this; } + /** + * If {@code true}, Playwright does not pass its own configurations args and only uses the ones from {@code args}. Dangerous option; + * use with care. + */ public LaunchPersistentContextOptions setIgnoreDefaultArgs(List ignoreDefaultArgs) { this.ignoreDefaultArgs = ignoreDefaultArgs; return this; } + /** + * Whether to ignore HTTPS errors during navigation. Defaults to {@code false}. + */ public LaunchPersistentContextOptions setIgnoreHTTPSErrors(boolean ignoreHTTPSErrors) { this.ignoreHTTPSErrors = 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. + */ public LaunchPersistentContextOptions setIsMobile(boolean isMobile) { this.isMobile = isMobile; return this; } + /** + * Whether or not to enable JavaScript in the context. Defaults to {@code true}. + */ public LaunchPersistentContextOptions setJavaScriptEnabled(boolean javaScriptEnabled) { this.javaScriptEnabled = 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. + */ public LaunchPersistentContextOptions setLocale(String locale) { this.locale = locale; return this; } + /** + * Whether to emulate network being offline. Defaults to {@code false}. + */ public LaunchPersistentContextOptions setOffline(boolean offline) { this.offline = offline; return this; } + /** + * A list of permissions to grant to all pages in this context. See {@link BrowserContext#grantPermissions + * BrowserContext.grantPermissions()} for more details. + */ public LaunchPersistentContextOptions setPermissions(List permissions) { this.permissions = permissions; return this; } + /** + * Network proxy settings. + */ public LaunchPersistentContextOptions setProxy(String server) { return setProxy(new Proxy(server)); } + /** + * Network proxy settings. + */ public LaunchPersistentContextOptions setProxy(Proxy proxy) { this.proxy = proxy; return this; } + /** + * Optional setting to control whether to omit request content from the HAR. Defaults to {@code false}. + */ public LaunchPersistentContextOptions setRecordHarOmitContent(boolean recordHarOmitContent) { this.recordHarOmitContent = recordHarOmitContent; return this; } + /** + * Enables HAR recording for all pages into the specified HAR + * file on the filesystem. If not specified, the HAR is not recorded. Make sure to call {@link BrowserContext#close + * BrowserContext.close()} for the HAR to be saved. + */ public LaunchPersistentContextOptions setRecordHarPath(Path recordHarPath) { this.recordHarPath = recordHarPath; return this; } + /** + * Enables video recording for all pages into the specified directory. If not specified videos are not recorded. Make sure + * to call {@link BrowserContext#close BrowserContext.close()} for videos to be saved. + */ public LaunchPersistentContextOptions setRecordVideoDir(Path recordVideoDir) { this.recordVideoDir = recordVideoDir; return this; } + /** + * Dimensions of the recorded videos. If not specified the size will be equal to {@code viewport} scaled down to fit into + * 800x800. If {@code viewport} is not configured explicitly the video size defaults to 800x450. Actual picture of each page will + * be scaled down if necessary to fit the specified size. + */ public LaunchPersistentContextOptions setRecordVideoSize(int width, int height) { return setRecordVideoSize(new RecordVideoSize(width, height)); } + /** + * Dimensions of the recorded videos. If not specified the size will be equal to {@code viewport} scaled down to fit into + * 800x800. If {@code viewport} is not configured explicitly the video size defaults to 800x450. Actual picture of each page will + * be scaled down if necessary to fit the specified size. + */ public LaunchPersistentContextOptions setRecordVideoSize(RecordVideoSize recordVideoSize) { this.recordVideoSize = recordVideoSize; return this; } + /** + * Emulates {@code "prefers-reduced-motion"} media feature, supported values are {@code "reduce"}, {@code "no-preference"}. See {@link + * Page#emulateMedia Page.emulateMedia()} for more details. Defaults to {@code "no-preference"}. + */ public LaunchPersistentContextOptions setReducedMotion(ReducedMotion reducedMotion) { this.reducedMotion = reducedMotion; return this; } + /** + * Emulates consistent window screen size available inside web page via {@code window.screen}. Is only used when the {@code viewport} + * is set. + */ public LaunchPersistentContextOptions setScreenSize(int width, int height) { return setScreenSize(new ScreenSize(width, height)); } + /** + * Emulates consistent window screen size available inside web page via {@code window.screen}. Is only used when the {@code viewport} + * is set. + */ public LaunchPersistentContextOptions setScreenSize(ScreenSize screenSize) { this.screenSize = screenSize; return this; } + /** + * Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. + */ public LaunchPersistentContextOptions setSlowMo(double slowMo) { this.slowMo = slowMo; return this; } + /** + * It 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. + */ 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. + */ public LaunchPersistentContextOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * Changes the timezone of the context. See ICU's + * metaZones.txt for a list of supported timezone IDs. + */ public LaunchPersistentContextOptions setTimezoneId(String timezoneId) { this.timezoneId = timezoneId; return this; } + /** + * If specified, traces are saved into this directory. + */ public LaunchPersistentContextOptions setTracesDir(Path tracesDir) { this.tracesDir = tracesDir; return this; } + /** + * Specific user agent to use in this context. + */ public LaunchPersistentContextOptions setUserAgent(String userAgent) { this.userAgent = userAgent; return this; } + /** + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. {@code null} disables the default viewport. + */ public LaunchPersistentContextOptions setViewportSize(int width, int height) { return setViewportSize(new ViewportSize(width, height)); } + /** + * Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. {@code null} disables the default viewport. + */ public LaunchPersistentContextOptions setViewportSize(ViewportSize viewportSize) { this.viewportSize = Optional.ofNullable(viewportSize); return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java b/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java index 650f5e48..bf0737e5 100644 --- a/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java +++ b/playwright/src/main/java/com/microsoft/playwright/ElementHandle.java @@ -89,25 +89,52 @@ public interface ElementHandle extends JSHandle { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public CheckOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ 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. + */ 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. + */ public CheckOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public CheckOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -160,41 +187,81 @@ public interface ElementHandle extends JSHandle { */ public Boolean trial; + /** + * Defaults to {@code left}. + */ public ClickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * defaults to 1. See [UIEvent.detail]. + */ public ClickOptions setClickCount(int clickCount) { this.clickCount = clickCount; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public ClickOptions setDelay(double delay) { this.delay = delay; return this; } + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public ClickOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ 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. + */ public ClickOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public ClickOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -243,37 +310,74 @@ public interface ElementHandle extends JSHandle { */ public Boolean trial; + /** + * Defaults to {@code left}. + */ public DblclickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public DblclickOptions setDelay(double delay) { this.delay = delay; return this; } + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public DblclickOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ 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. + */ public DblclickOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public DblclickOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -298,14 +402,28 @@ public interface ElementHandle extends JSHandle { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public FillOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ public FillOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -340,25 +458,51 @@ public interface ElementHandle extends JSHandle { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public HoverOptions setForce(boolean force) { this.force = 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. + */ public HoverOptions setModifiers(List modifiers) { this.modifiers = modifiers; 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. + */ 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. + */ 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. + */ public HoverOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public HoverOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -372,6 +516,11 @@ public interface ElementHandle extends JSHandle { */ 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. + */ public InputValueOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -395,14 +544,27 @@ public interface ElementHandle extends JSHandle { */ public Double timeout; + /** + * Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0. + */ public PressOptions setDelay(double delay) { this.delay = 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}. + */ 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. + */ public PressOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -435,22 +597,42 @@ public interface ElementHandle extends JSHandle { */ public ScreenshotType type; + /** + * 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; return this; } + /** + * The file path to save the image to. The screenshot type will be inferred from file extension. If {@code path} is a relative + * path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to + * the disk. + */ public ScreenshotOptions setPath(Path path) { this.path = path; return this; } + /** + * The quality of the image, between 0-100. Not applicable to {@code png} images. + */ public ScreenshotOptions setQuality(int quality) { this.quality = quality; 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. + */ public ScreenshotOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * Specify screenshot type, defaults to {@code png}. + */ public ScreenshotOptions setType(ScreenshotType type) { this.type = type; return this; @@ -464,6 +646,11 @@ public interface ElementHandle extends JSHandle { */ 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. + */ public ScrollIntoViewIfNeededOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -488,14 +675,28 @@ public interface ElementHandle extends JSHandle { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public SelectOptionOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ public SelectOptionOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -514,10 +715,19 @@ public interface ElementHandle extends JSHandle { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public SelectTextOptions setForce(boolean force) { this.force = 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. + */ public SelectTextOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -537,10 +747,20 @@ public interface ElementHandle extends JSHandle { */ 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}. + */ 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. + */ public SetInputFilesOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -581,29 +801,60 @@ public interface ElementHandle extends JSHandle { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public TapOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ 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. + */ public TapOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public TapOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -627,14 +878,27 @@ public interface ElementHandle extends JSHandle { */ public Double timeout; + /** + * Time to wait between key presses in milliseconds. Defaults to 0. + */ public TypeOptions setDelay(double delay) { this.delay = 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}. + */ 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. + */ public TypeOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -670,25 +934,52 @@ public interface ElementHandle extends JSHandle { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public UncheckOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ 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. + */ 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. + */ public UncheckOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public UncheckOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -702,6 +993,11 @@ public interface ElementHandle extends JSHandle { */ 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. + */ public WaitForElementStateOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -727,10 +1023,26 @@ public interface ElementHandle extends JSHandle { */ public Double timeout; + /** + * Defaults to {@code "visible"}. Can be either: + *
    + *
  • {@code "attached"} - wait for element to be present in DOM.
  • + *
  • {@code "detached"} - wait for element to not be present in DOM.
  • + *
  • {@code "visible"} - wait for element to have non-empty bounding box and no {@code visibility:hidden}. Note that element without any + * content or with {@code display:none} has an empty bounding box and is not considered visible.
  • + *
  • {@code "hidden"} - wait for element to be either detached from DOM, or have an empty bounding box or {@code visibility:hidden}. This + * is opposite to the {@code "visible"} option.
  • + *
+ */ public WaitForSelectorOptions setState(WaitForSelectorState state) { this.state = state; 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. + */ public WaitForSelectorOptions setTimeout(double timeout) { this.timeout = timeout; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/FileChooser.java b/playwright/src/main/java/com/microsoft/playwright/FileChooser.java index d5c5cf46..3eab28fb 100644 --- a/playwright/src/main/java/com/microsoft/playwright/FileChooser.java +++ b/playwright/src/main/java/com/microsoft/playwright/FileChooser.java @@ -42,10 +42,20 @@ public interface FileChooser { */ 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}. + */ public SetFilesOptions 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. + */ public SetFilesOptions setTimeout(double timeout) { this.timeout = timeout; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Frame.java b/playwright/src/main/java/com/microsoft/playwright/Frame.java index ba70aa54..a7b78243 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Frame.java +++ b/playwright/src/main/java/com/microsoft/playwright/Frame.java @@ -80,18 +80,32 @@ public interface Frame { */ public String url; + /** + * Raw JavaScript content to be injected into frame. + */ public AddScriptTagOptions setContent(String content) { this.content = content; return this; } + /** + * Path to the JavaScript file to be injected into frame. If {@code path} is a relative path, then it is resolved relative to the + * current working directory. + */ public AddScriptTagOptions setPath(Path path) { this.path = path; return this; } + /** + * Script type. Use 'module' in order to load a Javascript ES6 module. See script for more details. + */ public AddScriptTagOptions setType(String type) { this.type = type; return this; } + /** + * URL of a script to be added. + */ public AddScriptTagOptions setUrl(String url) { this.url = url; return this; @@ -112,14 +126,24 @@ public interface Frame { */ public String url; + /** + * Raw CSS content to be injected into frame. + */ public AddStyleTagOptions setContent(String content) { this.content = content; return this; } + /** + * Path to the CSS file to be injected into frame. If {@code path} is a relative path, then it is resolved relative to the + * current working directory. + */ public AddStyleTagOptions setPath(Path path) { this.path = path; return this; } + /** + * URL of the {@code } tag. + */ public AddStyleTagOptions setUrl(String url) { this.url = url; return this; @@ -160,29 +184,60 @@ public interface Frame { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public CheckOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ 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. + */ public CheckOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public CheckOptions setStrict(boolean strict) { this.strict = 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. + */ public CheckOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public CheckOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -240,45 +295,89 @@ public interface Frame { */ public Boolean trial; + /** + * Defaults to {@code left}. + */ public ClickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * defaults to 1. See [UIEvent.detail]. + */ public ClickOptions setClickCount(int clickCount) { this.clickCount = clickCount; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public ClickOptions setDelay(double delay) { this.delay = delay; return this; } + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public ClickOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ public ClickOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public ClickOptions setStrict(boolean strict) { this.strict = 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. + */ public ClickOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public ClickOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -332,41 +431,82 @@ public interface Frame { */ public Boolean trial; + /** + * Defaults to {@code left}. + */ public DblclickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public DblclickOptions setDelay(double delay) { this.delay = delay; return this; } + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public DblclickOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ public DblclickOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public DblclickOptions setStrict(boolean strict) { this.strict = 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. + */ public DblclickOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public DblclickOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -385,10 +525,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public DispatchEventOptions setStrict(boolean strict) { this.strict = 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. + */ public DispatchEventOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -434,36 +583,75 @@ public interface Frame { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public DragAndDropOptions setForce(boolean force) { this.force = 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}. + */ public DragAndDropOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not + * specified, some visible point of the element is used. + */ public DragAndDropOptions setSourcePosition(double x, double y) { return setSourcePosition(new Position(x, y)); } + /** + * Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not + * specified, some visible point of the element is used. + */ public DragAndDropOptions setSourcePosition(Position sourcePosition) { this.sourcePosition = sourcePosition; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public DragAndDropOptions setStrict(boolean strict) { this.strict = strict; return this; } + /** + * Drops on the target element at this point relative to the top-left corner of the element's padding box. If not + * specified, some visible point of the element is used. + */ public DragAndDropOptions setTargetPosition(double x, double y) { return setTargetPosition(new Position(x, y)); } + /** + * Drops on the target element at this point relative to the top-left corner of the element's padding box. If not + * specified, some visible point of the element is used. + */ public DragAndDropOptions setTargetPosition(Position targetPosition) { this.targetPosition = targetPosition; 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. + */ public DragAndDropOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public DragAndDropOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -476,6 +664,10 @@ public interface Frame { */ public Boolean strict; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public EvalOnSelectorOptions setStrict(boolean strict) { this.strict = strict; return this; @@ -505,18 +697,36 @@ public interface Frame { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public FillOptions setForce(boolean force) { this.force = 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}. + */ public FillOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public FillOptions setStrict(boolean strict) { this.strict = 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. + */ public FillOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -535,10 +745,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public FocusOptions setStrict(boolean strict) { this.strict = 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. + */ public FocusOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -557,10 +776,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public GetAttributeOptions setStrict(boolean strict) { this.strict = 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. + */ public GetAttributeOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -589,14 +817,32 @@ public interface Frame { */ public WaitUntilState waitUntil; + /** + * Referer header value. If provided it will take preference over the referer header value set by {@link + * Page#setExtraHTTPHeaders Page.setExtraHTTPHeaders()}. + */ public NavigateOptions setReferer(String referer) { this.referer = referer; return this; } + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public NavigateOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public NavigateOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -636,29 +882,59 @@ public interface Frame { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public HoverOptions setForce(boolean force) { this.force = 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. + */ public HoverOptions setModifiers(List modifiers) { this.modifiers = modifiers; 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. + */ 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. + */ public HoverOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public HoverOptions setStrict(boolean strict) { this.strict = 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. + */ public HoverOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public HoverOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -677,10 +953,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public InnerHTMLOptions setStrict(boolean strict) { this.strict = 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. + */ public InnerHTMLOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -699,10 +984,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public InnerTextOptions setStrict(boolean strict) { this.strict = 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. + */ public InnerTextOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -721,10 +1015,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public InputValueOptions setStrict(boolean strict) { this.strict = 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. + */ public InputValueOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -743,10 +1046,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsCheckedOptions setStrict(boolean strict) { this.strict = 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. + */ public IsCheckedOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -765,10 +1077,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsDisabledOptions setStrict(boolean strict) { this.strict = 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. + */ public IsDisabledOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -787,10 +1108,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsEditableOptions setStrict(boolean strict) { this.strict = 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. + */ public IsEditableOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -809,10 +1139,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsEnabledOptions setStrict(boolean strict) { this.strict = 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. + */ public IsEnabledOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -831,10 +1170,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsHiddenOptions setStrict(boolean strict) { this.strict = 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. + */ public IsHiddenOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -853,10 +1201,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsVisibleOptions setStrict(boolean strict) { this.strict = 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. + */ public IsVisibleOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -885,18 +1242,35 @@ public interface Frame { */ public Double timeout; + /** + * Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0. + */ public PressOptions setDelay(double delay) { this.delay = 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}. + */ public PressOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public PressOptions setStrict(boolean strict) { this.strict = 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. + */ public PressOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -909,6 +1283,10 @@ public interface Frame { */ public Boolean strict; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public QuerySelectorOptions setStrict(boolean strict) { this.strict = strict; return this; @@ -938,18 +1316,36 @@ public interface Frame { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public SelectOptionOptions setForce(boolean force) { this.force = 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}. + */ public SelectOptionOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public SelectOptionOptions setStrict(boolean strict) { this.strict = 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. + */ public SelectOptionOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -973,10 +1369,24 @@ public interface Frame { */ public WaitUntilState waitUntil; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public SetContentOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public SetContentOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -1001,14 +1411,28 @@ public interface Frame { */ 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}. + */ public SetInputFilesOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public SetInputFilesOptions setStrict(boolean strict) { this.strict = 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. + */ public SetInputFilesOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1054,33 +1478,68 @@ public interface Frame { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public TapOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ public TapOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public TapOptions setStrict(boolean strict) { this.strict = 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. + */ public TapOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public TapOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -1099,10 +1558,19 @@ public interface Frame { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public TextContentOptions setStrict(boolean strict) { this.strict = 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. + */ public TextContentOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1131,18 +1599,35 @@ public interface Frame { */ public Double timeout; + /** + * Time to wait between key presses in milliseconds. Defaults to 0. + */ public TypeOptions setDelay(double delay) { this.delay = 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}. + */ public TypeOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public TypeOptions setStrict(boolean strict) { this.strict = 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. + */ public TypeOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1183,29 +1668,60 @@ public interface Frame { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public UncheckOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ 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. + */ public UncheckOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public UncheckOptions setStrict(boolean strict) { this.strict = 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. + */ public UncheckOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public UncheckOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -1223,10 +1739,18 @@ public interface Frame { */ public Double timeout; + /** + * If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if + * the option is not specified {@code expression} is executed in {@code requestAnimationFrame} callback. + */ public WaitForFunctionOptions setPollingInterval(double pollingInterval) { this.pollingInterval = pollingInterval; return this; } + /** + * maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForFunctionOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1241,6 +1765,12 @@ public interface Frame { */ public Double timeout; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public WaitForLoadStateOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1268,22 +1798,45 @@ public interface Frame { */ public WaitUntilState waitUntil; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public WaitForNavigationOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + */ public WaitForNavigationOptions setUrl(String url) { this.url = url; return this; } + /** + * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + */ public WaitForNavigationOptions setUrl(Pattern url) { this.url = url; return this; } + /** + * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + */ public WaitForNavigationOptions setUrl(Predicate url) { this.url = url; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public WaitForNavigationOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -1314,14 +1867,34 @@ public interface Frame { */ public Double timeout; + /** + * Defaults to {@code "visible"}. Can be either: + *
    + *
  • {@code "attached"} - wait for element to be present in DOM.
  • + *
  • {@code "detached"} - wait for element to not be present in DOM.
  • + *
  • {@code "visible"} - wait for element to have non-empty bounding box and no {@code visibility:hidden}. Note that element without any + * content or with {@code display:none} has an empty bounding box and is not considered visible.
  • + *
  • {@code "hidden"} - wait for element to be either detached from DOM, or have an empty bounding box or {@code visibility:hidden}. This + * is opposite to the {@code "visible"} option.
  • + *
+ */ public WaitForSelectorOptions setState(WaitForSelectorState state) { this.state = state; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public WaitForSelectorOptions setStrict(boolean strict) { this.strict = 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. + */ public WaitForSelectorOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1345,10 +1918,24 @@ public interface Frame { */ public WaitUntilState waitUntil; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public WaitForURLOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public WaitForURLOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Keyboard.java b/playwright/src/main/java/com/microsoft/playwright/Keyboard.java index c23e2c6c..c5a08e08 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Keyboard.java +++ b/playwright/src/main/java/com/microsoft/playwright/Keyboard.java @@ -60,6 +60,9 @@ public interface Keyboard { */ public Double delay; + /** + * Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0. + */ public PressOptions setDelay(double delay) { this.delay = delay; return this; @@ -71,6 +74,9 @@ public interface Keyboard { */ public Double delay; + /** + * Time to wait between key presses in milliseconds. Defaults to 0. + */ public TypeOptions setDelay(double delay) { this.delay = delay; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Locator.java b/playwright/src/main/java/com/microsoft/playwright/Locator.java index 08c92057..7db4c46a 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Locator.java +++ b/playwright/src/main/java/com/microsoft/playwright/Locator.java @@ -69,6 +69,11 @@ public interface Locator { */ 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. + */ public BoundingBoxOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -104,25 +109,52 @@ public interface Locator { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public CheckOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ 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. + */ 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. + */ public CheckOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public CheckOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -175,41 +207,81 @@ public interface Locator { */ public Boolean trial; + /** + * Defaults to {@code left}. + */ public ClickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * defaults to 1. See [UIEvent.detail]. + */ public ClickOptions setClickCount(int clickCount) { this.clickCount = clickCount; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public ClickOptions setDelay(double delay) { this.delay = delay; return this; } + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public ClickOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ 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. + */ public ClickOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public ClickOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -258,37 +330,74 @@ public interface Locator { */ public Boolean trial; + /** + * Defaults to {@code left}. + */ public DblclickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public DblclickOptions setDelay(double delay) { this.delay = delay; return this; } + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public DblclickOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ 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. + */ public DblclickOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public DblclickOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -302,6 +411,11 @@ public interface Locator { */ 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. + */ public DispatchEventOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -315,6 +429,11 @@ public interface Locator { */ 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. + */ public ElementHandleOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -328,6 +447,11 @@ public interface Locator { */ 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. + */ public EvaluateOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -341,6 +465,11 @@ public interface Locator { */ 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. + */ public EvaluateHandleOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -365,14 +494,28 @@ public interface Locator { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public FillOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ public FillOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -386,6 +529,11 @@ public interface Locator { */ 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. + */ public FocusOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -399,6 +547,11 @@ public interface Locator { */ 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. + */ public GetAttributeOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -433,25 +586,51 @@ public interface Locator { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public HoverOptions setForce(boolean force) { this.force = 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. + */ public HoverOptions setModifiers(List modifiers) { this.modifiers = modifiers; 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. + */ 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. + */ 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. + */ public HoverOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public HoverOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -465,6 +644,11 @@ public interface Locator { */ 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. + */ public InnerHTMLOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -478,6 +662,11 @@ public interface Locator { */ 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. + */ public InnerTextOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -491,6 +680,11 @@ public interface Locator { */ 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. + */ public InputValueOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -504,6 +698,11 @@ public interface Locator { */ 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. + */ public IsCheckedOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -517,6 +716,11 @@ public interface Locator { */ 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. + */ public IsDisabledOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -530,6 +734,11 @@ public interface Locator { */ 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. + */ public IsEditableOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -543,6 +752,11 @@ public interface Locator { */ 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. + */ public IsEnabledOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -556,6 +770,11 @@ public interface Locator { */ 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. + */ public IsHiddenOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -569,6 +788,11 @@ public interface Locator { */ 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. + */ public IsVisibleOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -592,14 +816,27 @@ public interface Locator { */ public Double timeout; + /** + * Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0. + */ public PressOptions setDelay(double delay) { this.delay = 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}. + */ 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. + */ public PressOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -632,22 +869,42 @@ public interface Locator { */ public ScreenshotType type; + /** + * 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; return this; } + /** + * The file path to save the image to. The screenshot type will be inferred from file extension. If {@code path} is a relative + * path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to + * the disk. + */ public ScreenshotOptions setPath(Path path) { this.path = path; return this; } + /** + * The quality of the image, between 0-100. Not applicable to {@code png} images. + */ public ScreenshotOptions setQuality(int quality) { this.quality = quality; 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. + */ public ScreenshotOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * Specify screenshot type, defaults to {@code png}. + */ public ScreenshotOptions setType(ScreenshotType type) { this.type = type; return this; @@ -661,6 +918,11 @@ public interface Locator { */ 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. + */ public ScrollIntoViewIfNeededOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -685,14 +947,28 @@ public interface Locator { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public SelectOptionOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ public SelectOptionOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -711,10 +987,19 @@ public interface Locator { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public SelectTextOptions setForce(boolean force) { this.force = 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. + */ public SelectTextOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -734,10 +1019,20 @@ public interface Locator { */ 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}. + */ 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. + */ public SetInputFilesOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -778,29 +1073,60 @@ public interface Locator { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public TapOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ 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. + */ public TapOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public TapOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -814,6 +1140,11 @@ public interface Locator { */ 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. + */ public TextContentOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -837,14 +1168,27 @@ public interface Locator { */ public Double timeout; + /** + * Time to wait between key presses in milliseconds. Defaults to 0. + */ public TypeOptions setDelay(double delay) { this.delay = 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}. + */ 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. + */ public TypeOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -880,25 +1224,52 @@ public interface Locator { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public UncheckOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ 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. + */ 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. + */ public UncheckOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public UncheckOptions setTrial(boolean trial) { this.trial = trial; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Mouse.java b/playwright/src/main/java/com/microsoft/playwright/Mouse.java index 9e7774dd..b852792c 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Mouse.java +++ b/playwright/src/main/java/com/microsoft/playwright/Mouse.java @@ -49,14 +49,23 @@ public interface Mouse { */ public Double delay; + /** + * Defaults to {@code left}. + */ public ClickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * defaults to 1. See [UIEvent.detail]. + */ public ClickOptions setClickCount(int clickCount) { this.clickCount = clickCount; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public ClickOptions setDelay(double delay) { this.delay = delay; return this; @@ -72,10 +81,16 @@ public interface Mouse { */ public Double delay; + /** + * Defaults to {@code left}. + */ public DblclickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public DblclickOptions setDelay(double delay) { this.delay = delay; return this; @@ -91,10 +106,16 @@ public interface Mouse { */ public Integer clickCount; + /** + * Defaults to {@code left}. + */ public DownOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * defaults to 1. See [UIEvent.detail]. + */ public DownOptions setClickCount(int clickCount) { this.clickCount = clickCount; return this; @@ -106,6 +127,9 @@ public interface Mouse { */ public Integer steps; + /** + * defaults to 1. Sends intermediate {@code mousemove} events. + */ public MoveOptions setSteps(int steps) { this.steps = steps; return this; @@ -121,10 +145,16 @@ public interface Mouse { */ public Integer clickCount; + /** + * Defaults to {@code left}. + */ public UpOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * defaults to 1. See [UIEvent.detail]. + */ public UpOptions setClickCount(int clickCount) { this.clickCount = clickCount; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Page.java b/playwright/src/main/java/com/microsoft/playwright/Page.java index 950e02ea..f986f9d0 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Page.java +++ b/playwright/src/main/java/com/microsoft/playwright/Page.java @@ -326,18 +326,32 @@ public interface Page extends AutoCloseable { */ public String url; + /** + * Raw JavaScript content to be injected into frame. + */ public AddScriptTagOptions setContent(String content) { this.content = content; return this; } + /** + * Path to the JavaScript file to be injected into frame. If {@code path} is a relative path, then it is resolved relative to the + * current working directory. + */ public AddScriptTagOptions setPath(Path path) { this.path = path; return this; } + /** + * Script type. Use 'module' in order to load a Javascript ES6 module. See script for more details. + */ public AddScriptTagOptions setType(String type) { this.type = type; return this; } + /** + * URL of a script to be added. + */ public AddScriptTagOptions setUrl(String url) { this.url = url; return this; @@ -358,14 +372,24 @@ public interface Page extends AutoCloseable { */ public String url; + /** + * Raw CSS content to be injected into frame. + */ public AddStyleTagOptions setContent(String content) { this.content = content; return this; } + /** + * Path to the CSS file to be injected into frame. If {@code path} is a relative path, then it is resolved relative to the + * current working directory. + */ public AddStyleTagOptions setPath(Path path) { this.path = path; return this; } + /** + * URL of the {@code } tag. + */ public AddStyleTagOptions setUrl(String url) { this.url = url; return this; @@ -406,29 +430,60 @@ public interface Page extends AutoCloseable { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public CheckOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ 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. + */ public CheckOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public CheckOptions setStrict(boolean strict) { this.strict = 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. + */ public CheckOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public CheckOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -486,45 +541,89 @@ public interface Page extends AutoCloseable { */ public Boolean trial; + /** + * Defaults to {@code left}. + */ public ClickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * defaults to 1. See [UIEvent.detail]. + */ public ClickOptions setClickCount(int clickCount) { this.clickCount = clickCount; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public ClickOptions setDelay(double delay) { this.delay = delay; return this; } + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public ClickOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ public ClickOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public ClickOptions setStrict(boolean strict) { this.strict = 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. + */ public ClickOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public ClickOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -537,6 +636,10 @@ public interface Page extends AutoCloseable { */ public Boolean runBeforeUnload; + /** + * Defaults to {@code false}. Whether to run the before unload page handlers. + */ public CloseOptions setRunBeforeUnload(boolean runBeforeUnload) { this.runBeforeUnload = runBeforeUnload; return this; @@ -590,41 +693,82 @@ public interface Page extends AutoCloseable { */ public Boolean trial; + /** + * Defaults to {@code left}. + */ public DblclickOptions setButton(MouseButton button) { this.button = button; return this; } + /** + * Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0. + */ public DblclickOptions setDelay(double delay) { this.delay = delay; return this; } + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public DblclickOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ public DblclickOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public DblclickOptions setStrict(boolean strict) { this.strict = 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. + */ public DblclickOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public DblclickOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -643,10 +787,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public DispatchEventOptions setStrict(boolean strict) { this.strict = 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. + */ public DispatchEventOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -692,36 +845,75 @@ public interface Page extends AutoCloseable { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public DragAndDropOptions setForce(boolean force) { this.force = 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}. + */ public DragAndDropOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not + * specified, some visible point of the element is used. + */ public DragAndDropOptions setSourcePosition(double x, double y) { return setSourcePosition(new Position(x, y)); } + /** + * Clicks on the source element at this point relative to the top-left corner of the element's padding box. If not + * specified, some visible point of the element is used. + */ public DragAndDropOptions setSourcePosition(Position sourcePosition) { this.sourcePosition = sourcePosition; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public DragAndDropOptions setStrict(boolean strict) { this.strict = strict; return this; } + /** + * Drops on the target element at this point relative to the top-left corner of the element's padding box. If not + * specified, some visible point of the element is used. + */ public DragAndDropOptions setTargetPosition(double x, double y) { return setTargetPosition(new Position(x, y)); } + /** + * Drops on the target element at this point relative to the top-left corner of the element's padding box. If not + * specified, some visible point of the element is used. + */ public DragAndDropOptions setTargetPosition(Position targetPosition) { this.targetPosition = targetPosition; 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. + */ public DragAndDropOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public DragAndDropOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -744,14 +936,26 @@ public interface Page extends AutoCloseable { */ public Optional reducedMotion; + /** + * Emulates {@code "prefers-colors-scheme"} media feature, supported values are {@code "light"}, {@code "dark"}, {@code "no-preference"}. Passing + * {@code null} disables color scheme emulation. + */ public EmulateMediaOptions setColorScheme(ColorScheme colorScheme) { this.colorScheme = Optional.ofNullable(colorScheme); return this; } + /** + * Changes the CSS media type of the page. The only allowed values are {@code "screen"}, {@code "print"} and {@code null}. Passing {@code null} + * disables CSS media emulation. + */ public EmulateMediaOptions setMedia(Media media) { this.media = Optional.ofNullable(media); return this; } + /** + * Emulates {@code "prefers-reduced-motion"} media feature, supported values are {@code "reduce"}, {@code "no-preference"}. Passing {@code null} + * disables reduced motion emulation. + */ public EmulateMediaOptions setReducedMotion(ReducedMotion reducedMotion) { this.reducedMotion = Optional.ofNullable(reducedMotion); return this; @@ -764,6 +968,10 @@ public interface Page extends AutoCloseable { */ public Boolean strict; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public EvalOnSelectorOptions setStrict(boolean strict) { this.strict = strict; return this; @@ -776,6 +984,10 @@ public interface Page extends AutoCloseable { */ 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. + */ public ExposeBindingOptions setHandle(boolean handle) { this.handle = handle; return this; @@ -805,18 +1017,36 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public FillOptions setForce(boolean force) { this.force = 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}. + */ public FillOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public FillOptions setStrict(boolean strict) { this.strict = 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. + */ public FillOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -835,10 +1065,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public FocusOptions setStrict(boolean strict) { this.strict = 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. + */ public FocusOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -857,10 +1096,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public GetAttributeOptions setStrict(boolean strict) { this.strict = 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. + */ public GetAttributeOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -884,10 +1132,24 @@ public interface Page extends AutoCloseable { */ public WaitUntilState waitUntil; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public GoBackOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public GoBackOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -911,10 +1173,24 @@ public interface Page extends AutoCloseable { */ public WaitUntilState waitUntil; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public GoForwardOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public GoForwardOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -943,14 +1219,32 @@ public interface Page extends AutoCloseable { */ public WaitUntilState waitUntil; + /** + * Referer header value. If provided it will take preference over the referer header value set by {@link + * Page#setExtraHTTPHeaders Page.setExtraHTTPHeaders()}. + */ public NavigateOptions setReferer(String referer) { this.referer = referer; return this; } + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public NavigateOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public NavigateOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -990,29 +1284,59 @@ public interface Page extends AutoCloseable { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public HoverOptions setForce(boolean force) { this.force = 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. + */ public HoverOptions setModifiers(List modifiers) { this.modifiers = modifiers; 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. + */ 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. + */ public HoverOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public HoverOptions setStrict(boolean strict) { this.strict = 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. + */ public HoverOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public HoverOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -1031,10 +1355,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public InnerHTMLOptions setStrict(boolean strict) { this.strict = 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. + */ public InnerHTMLOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1053,10 +1386,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public InnerTextOptions setStrict(boolean strict) { this.strict = 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. + */ public InnerTextOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1075,10 +1417,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public InputValueOptions setStrict(boolean strict) { this.strict = 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. + */ public InputValueOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1097,10 +1448,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsCheckedOptions setStrict(boolean strict) { this.strict = 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. + */ public IsCheckedOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1119,10 +1479,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsDisabledOptions setStrict(boolean strict) { this.strict = 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. + */ public IsDisabledOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1141,10 +1510,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsEditableOptions setStrict(boolean strict) { this.strict = 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. + */ public IsEditableOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1163,10 +1541,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsEnabledOptions setStrict(boolean strict) { this.strict = 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. + */ public IsEnabledOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1185,10 +1572,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsHiddenOptions setStrict(boolean strict) { this.strict = 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. + */ public IsHiddenOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1207,10 +1603,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public IsVisibleOptions setStrict(boolean strict) { this.strict = 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. + */ public IsVisibleOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1280,54 +1685,103 @@ public interface Page extends AutoCloseable { */ public String width; + /** + * Display header and footer. Defaults to {@code false}. + */ public PdfOptions setDisplayHeaderFooter(boolean displayHeaderFooter) { this.displayHeaderFooter = displayHeaderFooter; return this; } + /** + * HTML template for the print footer. Should use the same format as the {@code headerTemplate}. + */ public PdfOptions setFooterTemplate(String footerTemplate) { this.footerTemplate = footerTemplate; return this; } + /** + * Paper format. If set, takes priority over {@code width} or {@code height} options. Defaults to 'Letter'. + */ public PdfOptions setFormat(String format) { this.format = format; return this; } + /** + * HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values + * into them: + *
    + *
  • {@code "date"} formatted print date
  • + *
  • {@code "title"} document title
  • + *
  • {@code "url"} document location
  • + *
  • {@code "pageNumber"} current page number
  • + *
  • {@code "totalPages"} total pages in the document
  • + *
+ */ public PdfOptions setHeaderTemplate(String headerTemplate) { this.headerTemplate = headerTemplate; return this; } + /** + * Paper height, accepts values labeled with units. + */ public PdfOptions setHeight(String height) { this.height = height; return this; } + /** + * Paper orientation. Defaults to {@code false}. + */ public PdfOptions setLandscape(boolean landscape) { this.landscape = landscape; return this; } + /** + * Paper margins, defaults to none. + */ public PdfOptions setMargin(Margin margin) { this.margin = margin; return this; } + /** + * Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. + */ public PdfOptions setPageRanges(String pageRanges) { this.pageRanges = pageRanges; return this; } + /** + * The file path to save the PDF to. If {@code path} is a relative path, then it is resolved relative to the current working + * directory. If no path is provided, the PDF won't be saved to the disk. + */ public PdfOptions setPath(Path path) { this.path = path; return this; } + /** + * Give any CSS {@code @page} size declared in the page priority over what is declared in {@code width} and {@code height} or {@code format} + * options. Defaults to {@code false}, which will scale the content to fit the paper size. + */ public PdfOptions setPreferCSSPageSize(boolean preferCSSPageSize) { this.preferCSSPageSize = preferCSSPageSize; return this; } + /** + * Print background graphics. Defaults to {@code false}. + */ public PdfOptions setPrintBackground(boolean printBackground) { this.printBackground = printBackground; return this; } + /** + * Scale of the webpage rendering. Defaults to {@code 1}. Scale amount must be between 0.1 and 2. + */ public PdfOptions setScale(double scale) { this.scale = scale; return this; } + /** + * Paper width, accepts values labeled with units. + */ public PdfOptions setWidth(String width) { this.width = width; return this; @@ -1356,18 +1810,35 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0. + */ public PressOptions setDelay(double delay) { this.delay = 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}. + */ public PressOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public PressOptions setStrict(boolean strict) { this.strict = 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. + */ public PressOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1380,6 +1851,10 @@ public interface Page extends AutoCloseable { */ public Boolean strict; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public QuerySelectorOptions setStrict(boolean strict) { this.strict = strict; return this; @@ -1403,10 +1878,24 @@ public interface Page extends AutoCloseable { */ public WaitUntilState waitUntil; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public ReloadOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public ReloadOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -1448,33 +1937,63 @@ public interface Page extends AutoCloseable { */ public ScreenshotType type; + /** + * An object which specifies clipping of the resulting image. Should have the following fields: + */ public ScreenshotOptions setClip(double x, double y, double width, double height) { return setClip(new Clip(x, y, width, height)); } + /** + * An object which specifies clipping of the resulting image. Should have the following fields: + */ public ScreenshotOptions setClip(Clip clip) { this.clip = clip; return this; } + /** + * When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to + * {@code false}. + */ public ScreenshotOptions setFullPage(boolean fullPage) { this.fullPage = fullPage; return this; } + /** + * 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; return this; } + /** + * The file path to save the image to. The screenshot type will be inferred from file extension. If {@code path} is a relative + * path, then it is resolved relative to the current working directory. If no path is provided, the image won't be saved to + * the disk. + */ public ScreenshotOptions setPath(Path path) { this.path = path; return this; } + /** + * The quality of the image, between 0-100. Not applicable to {@code png} images. + */ public ScreenshotOptions setQuality(int quality) { this.quality = quality; 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. + */ public ScreenshotOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * Specify screenshot type, defaults to {@code png}. + */ public ScreenshotOptions setType(ScreenshotType type) { this.type = type; return this; @@ -1504,18 +2023,36 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public SelectOptionOptions setForce(boolean force) { this.force = 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}. + */ public SelectOptionOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public SelectOptionOptions setStrict(boolean strict) { this.strict = 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. + */ public SelectOptionOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1539,10 +2076,24 @@ public interface Page extends AutoCloseable { */ public WaitUntilState waitUntil; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public SetContentOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public SetContentOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -1567,14 +2118,28 @@ public interface Page extends AutoCloseable { */ 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}. + */ public SetInputFilesOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public SetInputFilesOptions setStrict(boolean strict) { this.strict = 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. + */ public SetInputFilesOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1620,33 +2185,68 @@ public interface Page extends AutoCloseable { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public TapOptions setForce(boolean force) { this.force = 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. + */ 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}. + */ 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. + */ 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. + */ public TapOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public TapOptions setStrict(boolean strict) { this.strict = 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. + */ public TapOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public TapOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -1665,10 +2265,19 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public TextContentOptions setStrict(boolean strict) { this.strict = 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. + */ public TextContentOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1697,18 +2306,35 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Time to wait between key presses in milliseconds. Defaults to 0. + */ public TypeOptions setDelay(double delay) { this.delay = 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}. + */ public TypeOptions setNoWaitAfter(boolean noWaitAfter) { this.noWaitAfter = noWaitAfter; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public TypeOptions setStrict(boolean strict) { this.strict = 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. + */ public TypeOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1749,29 +2375,60 @@ public interface Page extends AutoCloseable { */ public Boolean trial; + /** + * Whether to bypass the actionability checks. Defaults to + * {@code false}. + */ public UncheckOptions setForce(boolean force) { this.force = 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}. + */ 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. + */ 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. + */ public UncheckOptions setPosition(Position position) { this.position = position; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public UncheckOptions setStrict(boolean strict) { this.strict = 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. + */ public UncheckOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When set, this method only performs the actionability + * checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without + * performing it. + */ public UncheckOptions setTrial(boolean trial) { this.trial = trial; return this; @@ -1784,6 +2441,10 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForCloseOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1800,10 +2461,17 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Receives the {@code ConsoleMessage} object and resolves to truthy value when the waiting should resolve. + */ public WaitForConsoleMessageOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForConsoleMessageOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1820,10 +2488,17 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Receives the {@code Download} object and resolves to truthy value when the waiting should resolve. + */ public WaitForDownloadOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForDownloadOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1840,10 +2515,17 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Receives the {@code FileChooser} object and resolves to truthy value when the waiting should resolve. + */ public WaitForFileChooserOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForFileChooserOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1861,10 +2543,18 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * If specified, then it is treated as an interval in milliseconds at which the function would be executed. By default if + * the option is not specified {@code expression} is executed in {@code requestAnimationFrame} callback. + */ public WaitForFunctionOptions setPollingInterval(double pollingInterval) { this.pollingInterval = pollingInterval; return this; } + /** + * maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForFunctionOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1879,6 +2569,12 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public WaitForLoadStateOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1906,22 +2602,45 @@ public interface Page extends AutoCloseable { */ public WaitUntilState waitUntil; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public WaitForNavigationOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + */ public WaitForNavigationOptions setUrl(String url) { this.url = url; return this; } + /** + * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + */ public WaitForNavigationOptions setUrl(Pattern url) { this.url = url; return this; } + /** + * A glob pattern, regex pattern or predicate receiving [URL] to match while waiting for the navigation. + */ public WaitForNavigationOptions setUrl(Predicate url) { this.url = url; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public WaitForNavigationOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -1938,10 +2657,17 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Receives the {@code Page} object and resolves to truthy value when the waiting should resolve. + */ public WaitForPopupOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForPopupOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1954,6 +2680,10 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Maximum wait time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable the timeout. The default value can be + * changed by using the {@link Page#setDefaultTimeout Page.setDefaultTimeout()} method. + */ public WaitForRequestOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1970,10 +2700,17 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Receives the {@code Request} object and resolves to truthy value when the waiting should resolve. + */ public WaitForRequestFinishedOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForRequestFinishedOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -1987,6 +2724,11 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Maximum wait time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable the timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()} or {@link + * Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public WaitForResponseOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -2017,14 +2759,34 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Defaults to {@code "visible"}. Can be either: + *
    + *
  • {@code "attached"} - wait for element to be present in DOM.
  • + *
  • {@code "detached"} - wait for element to not be present in DOM.
  • + *
  • {@code "visible"} - wait for element to have non-empty bounding box and no {@code visibility:hidden}. Note that element without any + * content or with {@code display:none} has an empty bounding box and is not considered visible.
  • + *
  • {@code "hidden"} - wait for element to be either detached from DOM, or have an empty bounding box or {@code visibility:hidden}. This + * is opposite to the {@code "visible"} option.
  • + *
+ */ public WaitForSelectorOptions setState(WaitForSelectorState state) { this.state = state; return this; } + /** + * When true, the call requires selector to resolve to a single element. If given selector resolves to more then one + * element, the call throws an exception. + */ public WaitForSelectorOptions setStrict(boolean strict) { this.strict = 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. + */ public WaitForSelectorOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -2048,10 +2810,24 @@ public interface Page extends AutoCloseable { */ public WaitUntilState waitUntil; + /** + * Maximum operation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be + * changed by using the {@link BrowserContext#setDefaultNavigationTimeout BrowserContext.setDefaultNavigationTimeout()}, + * {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}, {@link Page#setDefaultNavigationTimeout + * Page.setDefaultNavigationTimeout()} or {@link Page#setDefaultTimeout Page.setDefaultTimeout()} methods. + */ public WaitForURLOptions setTimeout(double timeout) { this.timeout = timeout; return this; } + /** + * When to consider operation succeeded, defaults to {@code load}. Events can be either: + *
    + *
  • {@code "domcontentloaded"} - consider operation to be finished when the {@code DOMContentLoaded} event is fired.
  • + *
  • {@code "load"} - consider operation to be finished when the {@code load} event is fired.
  • + *
  • {@code "networkidle"} - consider operation to be finished when there are no network connections for at least {@code 500} ms.
  • + *
+ */ public WaitForURLOptions setWaitUntil(WaitUntilState waitUntil) { this.waitUntil = waitUntil; return this; @@ -2068,10 +2844,17 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Receives the {@code WebSocket} object and resolves to truthy value when the waiting should resolve. + */ public WaitForWebSocketOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForWebSocketOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -2088,10 +2871,17 @@ public interface Page extends AutoCloseable { */ public Double timeout; + /** + * Receives the {@code Worker} object and resolves to truthy value when the waiting should resolve. + */ public WaitForWorkerOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForWorkerOptions setTimeout(double timeout) { this.timeout = timeout; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Playwright.java b/playwright/src/main/java/com/microsoft/playwright/Playwright.java index 0498e78c..0b7efa48 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Playwright.java +++ b/playwright/src/main/java/com/microsoft/playwright/Playwright.java @@ -47,6 +47,10 @@ public interface Playwright extends AutoCloseable { */ public Map env; + /** + * Additional environment variables that will be passed to the driver process. By default driver process inherits + * environment variables of the Playwright process. + */ public CreateOptions setEnv(Map env) { this.env = env; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Route.java b/playwright/src/main/java/com/microsoft/playwright/Route.java index b498ae6f..f21024c7 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Route.java +++ b/playwright/src/main/java/com/microsoft/playwright/Route.java @@ -43,22 +43,37 @@ public interface Route { */ public String url; + /** + * If set changes the request HTTP headers. Header values will be converted to a string. + */ public ResumeOptions setHeaders(Map headers) { this.headers = headers; return this; } + /** + * If set changes the request method (e.g. GET or POST) + */ public ResumeOptions setMethod(String method) { this.method = method; return this; } + /** + * If set changes the post data of request + */ public ResumeOptions setPostData(String postData) { this.postData = postData; return this; } + /** + * If set changes the post data of request + */ public ResumeOptions setPostData(byte[] postData) { this.postData = postData; return this; } + /** + * If set changes the request URL. New URL must have same protocol as original one. + */ public ResumeOptions setUrl(String url) { this.url = url; return this; @@ -91,26 +106,45 @@ public interface Route { */ public Integer status; + /** + * Optional response body as text. + */ public FulfillOptions setBody(String body) { this.body = body; return this; } + /** + * Optional response body as raw bytes. + */ public FulfillOptions setBodyBytes(byte[] bodyBytes) { this.bodyBytes = bodyBytes; return this; } + /** + * If set, equals to setting {@code Content-Type} response header. + */ public FulfillOptions setContentType(String contentType) { this.contentType = contentType; return this; } + /** + * Response headers. Header values will be converted to a string. + */ public FulfillOptions setHeaders(Map headers) { this.headers = headers; return this; } + /** + * File path to respond with. The content type will be inferred from file extension. If {@code path} is a relative path, then it + * is resolved relative to the current working directory. + */ public FulfillOptions setPath(Path path) { this.path = path; return this; } + /** + * Response status code, defaults to {@code 200}. + */ public FulfillOptions setStatus(int status) { this.status = status; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Selectors.java b/playwright/src/main/java/com/microsoft/playwright/Selectors.java index bad33ce1..c69b4e85 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Selectors.java +++ b/playwright/src/main/java/com/microsoft/playwright/Selectors.java @@ -32,6 +32,11 @@ public interface Selectors { */ public Boolean contentScript; + /** + * Whether to run this selector engine in isolated JavaScript environment. This environment has access to the same DOM, but + * not any JavaScript objects from the frame's scripts. Defaults to {@code false}. Note that running as a content script is not + * guaranteed when this engine is used together with other registered engines. + */ public RegisterOptions setContentScript(boolean contentScript) { this.contentScript = contentScript; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Tracing.java b/playwright/src/main/java/com/microsoft/playwright/Tracing.java index 8f622ce1..10d359fa 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Tracing.java +++ b/playwright/src/main/java/com/microsoft/playwright/Tracing.java @@ -52,14 +52,24 @@ public interface Tracing { */ public Boolean snapshots; + /** + * If specified, the trace is going to be saved into the file with the given name inside the {@code tracesDir} folder specified + * in {@link BrowserType#launch BrowserType.launch()}. + */ public StartOptions setName(String name) { this.name = name; return this; } + /** + * Whether to capture screenshots during tracing. Screenshots are used to build a timeline preview. + */ public StartOptions setScreenshots(boolean screenshots) { this.screenshots = screenshots; return this; } + /** + * Whether to capture DOM snapshot on every action. + */ public StartOptions setSnapshots(boolean snapshots) { this.snapshots = snapshots; return this; @@ -71,6 +81,9 @@ public interface Tracing { */ public Path path; + /** + * Export trace into the file with the given name. + */ public StopOptions setPath(Path path) { this.path = path; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/WebSocket.java b/playwright/src/main/java/com/microsoft/playwright/WebSocket.java index 12dd368d..86abf0c8 100644 --- a/playwright/src/main/java/com/microsoft/playwright/WebSocket.java +++ b/playwright/src/main/java/com/microsoft/playwright/WebSocket.java @@ -72,10 +72,17 @@ public interface WebSocket { */ public Double timeout; + /** + * Receives the {@code WebSocketFrame} object and resolves to truthy value when the waiting should resolve. + */ public WaitForFrameReceivedOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForFrameReceivedOptions setTimeout(double timeout) { this.timeout = timeout; return this; @@ -92,10 +99,17 @@ public interface WebSocket { */ public Double timeout; + /** + * Receives the {@code WebSocketFrame} object and resolves to truthy value when the waiting should resolve. + */ public WaitForFrameSentOptions setPredicate(Predicate predicate) { this.predicate = predicate; return this; } + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForFrameSentOptions setTimeout(double timeout) { this.timeout = timeout; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/Worker.java b/playwright/src/main/java/com/microsoft/playwright/Worker.java index e1614c6c..44a814d8 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Worker.java +++ b/playwright/src/main/java/com/microsoft/playwright/Worker.java @@ -52,6 +52,10 @@ public interface Worker { */ public Double timeout; + /** + * Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default + * value can be changed by using the {@link BrowserContext#setDefaultTimeout BrowserContext.setDefaultTimeout()}. + */ public WaitForCloseOptions setTimeout(double timeout) { this.timeout = timeout; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/options/Cookie.java b/playwright/src/main/java/com/microsoft/playwright/options/Cookie.java index c020be1b..d131a239 100644 --- a/playwright/src/main/java/com/microsoft/playwright/options/Cookie.java +++ b/playwright/src/main/java/com/microsoft/playwright/options/Cookie.java @@ -52,30 +52,51 @@ public class Cookie { this.name = name; this.value = value; } + /** + * either url or domain / path are required. Optional. + */ public Cookie setUrl(String url) { this.url = url; return this; } + /** + * either url or domain / path are required Optional. + */ public Cookie setDomain(String domain) { this.domain = domain; return this; } + /** + * either url or domain / path are required Optional. + */ public Cookie setPath(String path) { this.path = path; return this; } + /** + * Unix time in seconds. Optional. + */ public Cookie setExpires(double expires) { this.expires = expires; return this; } + /** + * Optional. + */ public Cookie setHttpOnly(boolean httpOnly) { this.httpOnly = httpOnly; return this; } + /** + * Optional. + */ public Cookie setSecure(boolean secure) { this.secure = secure; return this; } + /** + * Optional. + */ public Cookie setSameSite(SameSiteAttribute sameSite) { this.sameSite = sameSite; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/options/Geolocation.java b/playwright/src/main/java/com/microsoft/playwright/options/Geolocation.java index df132fc5..c1270333 100644 --- a/playwright/src/main/java/com/microsoft/playwright/options/Geolocation.java +++ b/playwright/src/main/java/com/microsoft/playwright/options/Geolocation.java @@ -34,6 +34,9 @@ public class Geolocation { this.latitude = latitude; this.longitude = longitude; } + /** + * Non-negative accuracy value. Defaults to {@code 0}. + */ public Geolocation setAccuracy(double accuracy) { this.accuracy = accuracy; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/options/Margin.java b/playwright/src/main/java/com/microsoft/playwright/options/Margin.java index 48904f04..4f887c9c 100644 --- a/playwright/src/main/java/com/microsoft/playwright/options/Margin.java +++ b/playwright/src/main/java/com/microsoft/playwright/options/Margin.java @@ -34,18 +34,30 @@ public class Margin { */ public String left; + /** + * Top margin, accepts values labeled with units. Defaults to {@code 0}. + */ public Margin setTop(String top) { this.top = top; return this; } + /** + * Right margin, accepts values labeled with units. Defaults to {@code 0}. + */ public Margin setRight(String right) { this.right = right; return this; } + /** + * Bottom margin, accepts values labeled with units. Defaults to {@code 0}. + */ public Margin setBottom(String bottom) { this.bottom = bottom; return this; } + /** + * Left margin, accepts values labeled with units. Defaults to {@code 0}. + */ public Margin setLeft(String left) { this.left = left; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/options/Proxy.java b/playwright/src/main/java/com/microsoft/playwright/options/Proxy.java index df4ca26d..2e376646 100644 --- a/playwright/src/main/java/com/microsoft/playwright/options/Proxy.java +++ b/playwright/src/main/java/com/microsoft/playwright/options/Proxy.java @@ -38,14 +38,23 @@ public class Proxy { public Proxy(String server) { this.server = server; } + /** + * Optional coma-separated domains to bypass proxy, for example {@code ".com, chromium.org, .domain.com"}. + */ public Proxy setBypass(String bypass) { this.bypass = bypass; return this; } + /** + * Optional username to use if HTTP proxy requires authentication. + */ public Proxy setUsername(String username) { this.username = username; return this; } + /** + * Optional password to use if HTTP proxy requires authentication. + */ public Proxy setPassword(String password) { this.password = password; return this; diff --git a/playwright/src/main/java/com/microsoft/playwright/options/SelectOption.java b/playwright/src/main/java/com/microsoft/playwright/options/SelectOption.java index b9525826..556e3699 100644 --- a/playwright/src/main/java/com/microsoft/playwright/options/SelectOption.java +++ b/playwright/src/main/java/com/microsoft/playwright/options/SelectOption.java @@ -30,14 +30,23 @@ public class SelectOption { */ public Integer index; + /** + * Matches by {@code option.value}. Optional. + */ public SelectOption setValue(String value) { this.value = value; return this; } + /** + * Matches by {@code option.label}. Optional. + */ public SelectOption setLabel(String label) { this.label = label; return this; } + /** + * Matches by the index. Optional. + */ public SelectOption setIndex(int index) { this.index = index; return this; diff --git a/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java b/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java index d4a12235..1fde1b0e 100644 --- a/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java +++ b/tools/api-generator/src/main/java/com/microsoft/playwright/tools/ApiGenerator.java @@ -793,6 +793,7 @@ class Field extends Element { args.add(f.name); } if (!params.isEmpty()) { + writeJavadoc(output, offset, comment()); output.add(offset + "public " + parentClass + " set" + toTitle(name) + "(" + String.join(", ", params) + ") {"); output.add(offset + " return set" + toTitle(name) + "(new " + type.toJava() + "(" + String.join(", ", args) + "));"); output.add(offset + "}"); @@ -809,6 +810,7 @@ class Field extends Element { } private void writeGenericBuilderMethod(List output, String offset, String parentClass, String paramType) { + writeJavadoc(output, offset, comment()); output.add(offset + "public " + parentClass + " set" + toTitle(name) + "(" + paramType + " " + name + ") {"); String rvalue = type.isNullable() ? "Optional.ofNullable(" + name + ")" : name; output.add(offset + " this." + name + " = " + rvalue + ";");