mirror of
https://github.com/microsoft/playwright-java.git
synced 2025-09-08 21:01:00 +00:00
docs: generate field comments (#72)
This commit is contained in:
parent
cbcc04d0f0
commit
c33e5fab03
@ -85,7 +85,6 @@ abstract class Element {
|
||||
.replaceAll("\\nSee ChromiumBrowser[^\\n]+", "\n")
|
||||
.replaceAll("\\n\\n", "\n")
|
||||
.replaceAll("\\n", "\n<p>\n");
|
||||
// .replaceAll("\\n\\n", "\n<p>\n");
|
||||
}
|
||||
|
||||
String comment() {
|
||||
@ -548,6 +547,7 @@ class Field extends Element {
|
||||
}
|
||||
|
||||
void writeTo(List<String> output, String offset, String access) {
|
||||
writeJavadoc(output, offset, comment());
|
||||
if (asList("Frame.waitForNavigation.options.url",
|
||||
"Page.waitForNavigation.options.url").contains(jsonPath)) {
|
||||
output.add(offset + "public String glob;");
|
||||
|
@ -31,7 +31,13 @@ import java.util.*;
|
||||
*/
|
||||
public interface Accessibility {
|
||||
class SnapshotOptions {
|
||||
/**
|
||||
* Prune uninteresting nodes from the tree. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean interestingOnly;
|
||||
/**
|
||||
* The root DOM element for the snapshot. Defaults to the whole page.
|
||||
*/
|
||||
public ElementHandle root;
|
||||
|
||||
public SnapshotOptions withInterestingOnly(Boolean interestingOnly) {
|
||||
|
@ -31,9 +31,21 @@ public interface Browser {
|
||||
void removeListener(EventType type, Listener<EventType> listener);
|
||||
class NewContextOptions {
|
||||
public class Proxy {
|
||||
/**
|
||||
* Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example {@code http://myproxy.com:3128} or {@code socks5://myproxy.com:3128}. Short form {@code myproxy.com:3128} is considered an HTTP proxy.
|
||||
*/
|
||||
public String server;
|
||||
/**
|
||||
* Optional coma-separated domains to bypass proxy, for example {@code ".com, chromium.org, .domain.com"}.
|
||||
*/
|
||||
public String bypass;
|
||||
/**
|
||||
* Optional username to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String username;
|
||||
/**
|
||||
* Optional password to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String password;
|
||||
|
||||
Proxy() {
|
||||
@ -60,7 +72,13 @@ public interface Browser {
|
||||
}
|
||||
}
|
||||
public class VideoSize {
|
||||
/**
|
||||
* Video frame width.
|
||||
*/
|
||||
public int width;
|
||||
/**
|
||||
* Video frame height.
|
||||
*/
|
||||
public int height;
|
||||
|
||||
VideoSize() {
|
||||
@ -79,7 +97,13 @@ public interface Browser {
|
||||
}
|
||||
}
|
||||
public class RecordHar {
|
||||
/**
|
||||
* Optional setting to control whether to omit request content from the HAR. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean omitContent;
|
||||
/**
|
||||
* Path on the filesystem to write the HAR file to.
|
||||
*/
|
||||
public String path;
|
||||
|
||||
RecordHar() {
|
||||
@ -97,27 +121,90 @@ public interface Browser {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Whether to automatically download all the attachments. Defaults to {@code false} where all the downloads are canceled.
|
||||
*/
|
||||
public Boolean acceptDownloads;
|
||||
/**
|
||||
* Whether to ignore HTTPS errors during navigation. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean ignoreHTTPSErrors;
|
||||
/**
|
||||
* Toggles bypassing page's Content-Security-Policy.
|
||||
*/
|
||||
public Boolean bypassCSP;
|
||||
/**
|
||||
* Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. {@code null} disables the default viewport.
|
||||
*/
|
||||
public Page.Viewport viewport;
|
||||
/**
|
||||
* Specific user agent to use in this context.
|
||||
*/
|
||||
public String userAgent;
|
||||
/**
|
||||
* Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}.
|
||||
*/
|
||||
public Integer deviceScaleFactor;
|
||||
/**
|
||||
* Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not supported in Firefox.
|
||||
*/
|
||||
public Boolean isMobile;
|
||||
/**
|
||||
* Specifies if viewport supports touch events. Defaults to false.
|
||||
*/
|
||||
public Boolean hasTouch;
|
||||
/**
|
||||
* Whether or not to enable JavaScript in the context. Defaults to true.
|
||||
*/
|
||||
public Boolean javaScriptEnabled;
|
||||
/**
|
||||
* Changes the timezone of the context. See ICU’s {@code metaZones.txt} for a list of supported timezone IDs.
|
||||
*/
|
||||
public String timezoneId;
|
||||
public Geolocation geolocation;
|
||||
/**
|
||||
* Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, {@code Accept-Language} request header value as well as number and date formatting rules.
|
||||
*/
|
||||
public String locale;
|
||||
/**
|
||||
* A list of permissions to grant to all pages in this context. See browserContext.grantPermissions for more details.
|
||||
*/
|
||||
public List<String> permissions;
|
||||
/**
|
||||
* An object containing additional HTTP headers to be sent with every request. All header values must be strings.
|
||||
*/
|
||||
public Map<String, String> extraHTTPHeaders;
|
||||
/**
|
||||
* Whether to emulate network being offline. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean offline;
|
||||
/**
|
||||
* Credentials for HTTP authentication.
|
||||
*/
|
||||
public BrowserContext.HTTPCredentials httpCredentials;
|
||||
/**
|
||||
* Emulates {@code 'prefers-colors-scheme'} media feature, supported values are {@code 'light'}, {@code 'dark'}, {@code 'no-preference'}. See page.emulateMedia(options) for more details. Defaults to '{@code light}'.
|
||||
*/
|
||||
public ColorScheme colorScheme;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* Network proxy settings to use with this context. Note that 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: 'per-context' } })}.
|
||||
*/
|
||||
public Proxy proxy;
|
||||
/**
|
||||
* Enables video recording for all pages to {@code videosPath} folder. If not specified, videos are not recorded. Make sure to await {@code browserContext.close} for videos to be saved.
|
||||
*/
|
||||
public String videosPath;
|
||||
/**
|
||||
* Specifies dimensions of the automatically recorded video. Can only be used if {@code videosPath} is set. If not specified the size will be equal to {@code viewport}. If {@code viewport} is not configured explicitly the video size defaults to 1280x720. Actual picture of the page will be scaled down if necessary to fit specified size.
|
||||
*/
|
||||
public VideoSize videoSize;
|
||||
/**
|
||||
* Enables HAR recording for all pages into {@code har.path} file. If not specified, the HAR is not recorded. Make sure to await {@code browserContext.close} for the HAR to be saved.
|
||||
*/
|
||||
public RecordHar recordHar;
|
||||
|
||||
public NewContextOptions withAcceptDownloads(Boolean acceptDownloads) {
|
||||
@ -211,9 +298,21 @@ public interface Browser {
|
||||
}
|
||||
class NewPageOptions {
|
||||
public class Proxy {
|
||||
/**
|
||||
* Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example {@code http://myproxy.com:3128} or {@code socks5://myproxy.com:3128}. Short form {@code myproxy.com:3128} is considered an HTTP proxy.
|
||||
*/
|
||||
public String server;
|
||||
/**
|
||||
* Optional coma-separated domains to bypass proxy, for example {@code ".com, chromium.org, .domain.com"}.
|
||||
*/
|
||||
public String bypass;
|
||||
/**
|
||||
* Optional username to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String username;
|
||||
/**
|
||||
* Optional password to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String password;
|
||||
|
||||
Proxy() {
|
||||
@ -240,7 +339,13 @@ public interface Browser {
|
||||
}
|
||||
}
|
||||
public class VideoSize {
|
||||
/**
|
||||
* Video frame width.
|
||||
*/
|
||||
public int width;
|
||||
/**
|
||||
* Video frame height.
|
||||
*/
|
||||
public int height;
|
||||
|
||||
VideoSize() {
|
||||
@ -259,7 +364,13 @@ public interface Browser {
|
||||
}
|
||||
}
|
||||
public class RecordHar {
|
||||
/**
|
||||
* Optional setting to control whether to omit request content from the HAR. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean omitContent;
|
||||
/**
|
||||
* Path on the filesystem to write the HAR file to.
|
||||
*/
|
||||
public String path;
|
||||
|
||||
RecordHar() {
|
||||
@ -277,27 +388,90 @@ public interface Browser {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Whether to automatically download all the attachments. Defaults to {@code false} where all the downloads are canceled.
|
||||
*/
|
||||
public Boolean acceptDownloads;
|
||||
/**
|
||||
* Whether to ignore HTTPS errors during navigation. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean ignoreHTTPSErrors;
|
||||
/**
|
||||
* Toggles bypassing page's Content-Security-Policy.
|
||||
*/
|
||||
public Boolean bypassCSP;
|
||||
/**
|
||||
* Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. {@code null} disables the default viewport.
|
||||
*/
|
||||
public Page.Viewport viewport;
|
||||
/**
|
||||
* Specific user agent to use in this context.
|
||||
*/
|
||||
public String userAgent;
|
||||
/**
|
||||
* Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}.
|
||||
*/
|
||||
public Integer deviceScaleFactor;
|
||||
/**
|
||||
* Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not supported in Firefox.
|
||||
*/
|
||||
public Boolean isMobile;
|
||||
/**
|
||||
* Specifies if viewport supports touch events. Defaults to false.
|
||||
*/
|
||||
public Boolean hasTouch;
|
||||
/**
|
||||
* Whether or not to enable JavaScript in the context. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean javaScriptEnabled;
|
||||
/**
|
||||
* Changes the timezone of the context. See ICU’s {@code metaZones.txt} for a list of supported timezone IDs.
|
||||
*/
|
||||
public String timezoneId;
|
||||
public Geolocation geolocation;
|
||||
/**
|
||||
* Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, {@code Accept-Language} request header value as well as number and date formatting rules.
|
||||
*/
|
||||
public String locale;
|
||||
/**
|
||||
* A list of permissions to grant to all pages in this context. See browserContext.grantPermissions for more details.
|
||||
*/
|
||||
public List<String> permissions;
|
||||
/**
|
||||
* An object containing additional HTTP headers to be sent with every request. All header values must be strings.
|
||||
*/
|
||||
public Map<String, String> extraHTTPHeaders;
|
||||
/**
|
||||
* Whether to emulate network being offline. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean offline;
|
||||
/**
|
||||
* Credentials for HTTP authentication.
|
||||
*/
|
||||
public BrowserContext.HTTPCredentials httpCredentials;
|
||||
/**
|
||||
* Emulates {@code 'prefers-colors-scheme'} media feature, supported values are {@code 'light'}, {@code 'dark'}, {@code 'no-preference'}. See page.emulateMedia(options) for more details. Defaults to '{@code light}'.
|
||||
*/
|
||||
public ColorScheme colorScheme;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* Network proxy settings to use with this context. Note that 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: 'per-context' } })}.
|
||||
*/
|
||||
public Proxy proxy;
|
||||
/**
|
||||
* Enables video recording for all pages to {@code videosPath} folder. If not specified, videos are not recorded. Make sure to await {@code page.close} for videos to be saved.
|
||||
*/
|
||||
public String videosPath;
|
||||
/**
|
||||
* Specifies dimensions of the automatically recorded video. Can only be used if {@code videosPath} is set. If not specified the size will be equal to {@code viewport}. If {@code viewport} is not configured explicitly the video size defaults to 1280x720. Actual picture of the page will be scaled down if necessary to fit specified size.
|
||||
*/
|
||||
public VideoSize videoSize;
|
||||
/**
|
||||
* Enables HAR recording for all pages into {@code har.path} file. If not specified, the HAR is not recorded. Make sure to await {@code page.close} for the HAR to be saved.
|
||||
*/
|
||||
public RecordHar recordHar;
|
||||
|
||||
public NewPageOptions withAcceptDownloads(Boolean acceptDownloads) {
|
||||
|
@ -75,11 +75,29 @@ public interface BrowserContext {
|
||||
void addListener(EventType type, Listener<EventType> listener);
|
||||
void removeListener(EventType type, Listener<EventType> listener);
|
||||
class AddCookie {
|
||||
/**
|
||||
* **required**
|
||||
*/
|
||||
public String name;
|
||||
/**
|
||||
* **required**
|
||||
*/
|
||||
public String value;
|
||||
/**
|
||||
* either url or domain / path are required
|
||||
*/
|
||||
public String url;
|
||||
/**
|
||||
* either url or domain / path are required
|
||||
*/
|
||||
public String domain;
|
||||
/**
|
||||
* either url or domain / path are required
|
||||
*/
|
||||
public String path;
|
||||
/**
|
||||
* Unix time in seconds.
|
||||
*/
|
||||
public Long expires;
|
||||
public Boolean httpOnly;
|
||||
public Boolean secure;
|
||||
@ -127,6 +145,9 @@ public interface BrowserContext {
|
||||
private String value;
|
||||
private String domain;
|
||||
private String path;
|
||||
/**
|
||||
* Unix time in seconds.
|
||||
*/
|
||||
private long expires;
|
||||
private boolean httpOnly;
|
||||
private boolean secure;
|
||||
@ -158,6 +179,9 @@ public interface BrowserContext {
|
||||
}
|
||||
}
|
||||
class ExposeBindingOptions {
|
||||
/**
|
||||
* Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is supported. When passing by value, multiple arguments are supported.
|
||||
*/
|
||||
public Boolean handle;
|
||||
|
||||
public ExposeBindingOptions withHandle(Boolean handle) {
|
||||
@ -166,6 +190,9 @@ public interface BrowserContext {
|
||||
}
|
||||
}
|
||||
class GrantPermissionsOptions {
|
||||
/**
|
||||
* The origin to grant permissions to, e.g. "https://example.com".
|
||||
*/
|
||||
public String origin;
|
||||
|
||||
public GrantPermissionsOptions withOrigin(String origin) {
|
||||
|
@ -26,9 +26,21 @@ import java.util.*;
|
||||
*/
|
||||
public interface BrowserType {
|
||||
class ConnectOptions {
|
||||
/**
|
||||
* A browser websocket endpoint to connect to. **required**
|
||||
*/
|
||||
public String wsEndpoint;
|
||||
/**
|
||||
* Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
|
||||
*/
|
||||
public Integer slowMo;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* 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 Integer timeout;
|
||||
|
||||
public ConnectOptions withWsEndpoint(String wsEndpoint) {
|
||||
@ -50,9 +62,21 @@ public interface BrowserType {
|
||||
}
|
||||
class LaunchOptions {
|
||||
public class Proxy {
|
||||
/**
|
||||
* Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example {@code http://myproxy.com:3128} or {@code socks5://myproxy.com:3128}. Short form {@code myproxy.com:3128} is considered an HTTP proxy.
|
||||
*/
|
||||
public String server;
|
||||
/**
|
||||
* Optional coma-separated domains to bypass proxy, for example {@code ".com, chromium.org, .domain.com"}.
|
||||
*/
|
||||
public String bypass;
|
||||
/**
|
||||
* Optional username to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String username;
|
||||
/**
|
||||
* Optional password to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String password;
|
||||
|
||||
Proxy() {
|
||||
@ -78,21 +102,69 @@ public interface BrowserType {
|
||||
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 Boolean headless;
|
||||
/**
|
||||
* 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 current working directory. Note that Playwright only works with the bundled Chromium, Firefox or WebKit, use at your own risk.
|
||||
*/
|
||||
public String executablePath;
|
||||
/**
|
||||
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.
|
||||
*/
|
||||
public List<String> args;
|
||||
/**
|
||||
* If {@code true}, Playwright does not pass its own configurations args and only uses the ones from {@code args}. If an array is given, then filters out the given default arguments. Dangerous option; use with care. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean ignoreDefaultArgs;
|
||||
/**
|
||||
* Network proxy settings.
|
||||
*/
|
||||
public Proxy proxy;
|
||||
/**
|
||||
* If specified, accepted downloads are downloaded into this folder. Otherwise, temporary folder is created and is deleted when browser is closed.
|
||||
*/
|
||||
public String downloadsPath;
|
||||
/**
|
||||
* Enable Chromium sandboxing. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean chromiumSandbox;
|
||||
/**
|
||||
* Firefox user preferences. Learn more about the Firefox user preferences at {@code about:config}.
|
||||
*/
|
||||
public String firefoxUserPrefs;
|
||||
/**
|
||||
* Close the browser process on Ctrl-C. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGINT;
|
||||
/**
|
||||
* Close the browser process on SIGTERM. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGTERM;
|
||||
/**
|
||||
* Close the browser process on SIGHUP. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGHUP;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* 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 Integer timeout;
|
||||
/**
|
||||
* Specify environment variables that will be visible to the browser. Defaults to {@code process.env}.
|
||||
*/
|
||||
public String env;
|
||||
/**
|
||||
* **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 Boolean devtools;
|
||||
/**
|
||||
* Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
|
||||
*/
|
||||
public Integer slowMo;
|
||||
|
||||
public LaunchOptions withHeadless(Boolean headless) {
|
||||
@ -162,9 +234,21 @@ public interface BrowserType {
|
||||
}
|
||||
class LaunchPersistentContextOptions {
|
||||
public class Proxy {
|
||||
/**
|
||||
* Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example {@code http://myproxy.com:3128} or {@code socks5://myproxy.com:3128}. Short form {@code myproxy.com:3128} is considered an HTTP proxy.
|
||||
*/
|
||||
public String server;
|
||||
/**
|
||||
* Optional coma-separated domains to bypass proxy, for example {@code ".com, chromium.org, .domain.com"}.
|
||||
*/
|
||||
public String bypass;
|
||||
/**
|
||||
* Optional username to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String username;
|
||||
/**
|
||||
* Optional password to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String password;
|
||||
|
||||
Proxy() {
|
||||
@ -191,7 +275,13 @@ public interface BrowserType {
|
||||
}
|
||||
}
|
||||
public class VideoSize {
|
||||
/**
|
||||
* Video frame width.
|
||||
*/
|
||||
public int width;
|
||||
/**
|
||||
* Video frame height.
|
||||
*/
|
||||
public int height;
|
||||
|
||||
VideoSize() {
|
||||
@ -210,7 +300,13 @@ public interface BrowserType {
|
||||
}
|
||||
}
|
||||
public class RecordHar {
|
||||
/**
|
||||
* Optional setting to control whether to omit request content from the HAR. Defaults to false.
|
||||
*/
|
||||
public Boolean omitContent;
|
||||
/**
|
||||
* Path on the filesystem to write the HAR file to.
|
||||
*/
|
||||
public String path;
|
||||
|
||||
RecordHar() {
|
||||
@ -228,40 +324,142 @@ public interface BrowserType {
|
||||
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 Boolean headless;
|
||||
/**
|
||||
* 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 current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
|
||||
*/
|
||||
public String executablePath;
|
||||
/**
|
||||
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.
|
||||
*/
|
||||
public List<String> args;
|
||||
/**
|
||||
* If {@code true}, then do not use any of the default arguments. If an array is given, then filter out the given default arguments. Dangerous option; use with care. Defaults to {@code false}.
|
||||
*/
|
||||
public String ignoreDefaultArgs;
|
||||
/**
|
||||
* Network proxy settings.
|
||||
*/
|
||||
public Proxy proxy;
|
||||
/**
|
||||
* Whether to automatically download all the attachments. Defaults to {@code false} where all the downloads are canceled.
|
||||
*/
|
||||
public Boolean acceptDownloads;
|
||||
/**
|
||||
* If specified, accepted downloads are downloaded into this folder. Otherwise, temporary folder is created and is deleted when browser is closed.
|
||||
*/
|
||||
public String downloadsPath;
|
||||
/**
|
||||
* Enable Chromium sandboxing. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean chromiumSandbox;
|
||||
/**
|
||||
* Close the browser process on Ctrl-C. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGINT;
|
||||
/**
|
||||
* Close the browser process on SIGTERM. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGTERM;
|
||||
/**
|
||||
* Close the browser process on SIGHUP. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGHUP;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* 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 Integer timeout;
|
||||
/**
|
||||
* Specify environment variables that will be visible to the browser. Defaults to {@code process.env}.
|
||||
*/
|
||||
public String env;
|
||||
/**
|
||||
* **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 Boolean devtools;
|
||||
/**
|
||||
* Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
|
||||
*/
|
||||
public Integer slowMo;
|
||||
/**
|
||||
* Whether to ignore HTTPS errors during navigation. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean ignoreHTTPSErrors;
|
||||
/**
|
||||
* Toggles bypassing page's Content-Security-Policy.
|
||||
*/
|
||||
public Boolean bypassCSP;
|
||||
/**
|
||||
* Sets a consistent viewport for each page. Defaults to an 1280x720 viewport. {@code null} disables the default viewport.
|
||||
*/
|
||||
public Page.Viewport viewport;
|
||||
/**
|
||||
* Specific user agent to use in this context.
|
||||
*/
|
||||
public String userAgent;
|
||||
/**
|
||||
* Specify device scale factor (can be thought of as dpr). Defaults to {@code 1}.
|
||||
*/
|
||||
public Integer deviceScaleFactor;
|
||||
/**
|
||||
* Whether the {@code meta viewport} tag is taken into account and touch events are enabled. Defaults to {@code false}. Not supported in Firefox.
|
||||
*/
|
||||
public Boolean isMobile;
|
||||
/**
|
||||
* Specifies if viewport supports touch events. Defaults to false.
|
||||
*/
|
||||
public Boolean hasTouch;
|
||||
/**
|
||||
* Whether or not to enable JavaScript in the context. Defaults to true.
|
||||
*/
|
||||
public Boolean javaScriptEnabled;
|
||||
/**
|
||||
* Changes the timezone of the context. See ICU’s {@code metaZones.txt} for a list of supported timezone IDs.
|
||||
*/
|
||||
public String timezoneId;
|
||||
public Geolocation geolocation;
|
||||
/**
|
||||
* Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value, {@code Accept-Language} request header value as well as number and date formatting rules.
|
||||
*/
|
||||
public String locale;
|
||||
/**
|
||||
* A list of permissions to grant to all pages in this context. See browserContext.grantPermissions for more details.
|
||||
*/
|
||||
public List<String> permissions;
|
||||
/**
|
||||
* An object containing additional HTTP headers to be sent with every request. All header values must be strings.
|
||||
*/
|
||||
public Map<String, String> extraHTTPHeaders;
|
||||
/**
|
||||
* Whether to emulate network being offline. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean offline;
|
||||
/**
|
||||
* Credentials for HTTP authentication.
|
||||
*/
|
||||
public BrowserContext.HTTPCredentials httpCredentials;
|
||||
/**
|
||||
* Emulates {@code 'prefers-colors-scheme'} media feature, supported values are {@code 'light'}, {@code 'dark'}, {@code 'no-preference'}. See page.emulateMedia(options) for more details. Defaults to '{@code light}'.
|
||||
*/
|
||||
public ColorScheme colorScheme;
|
||||
/**
|
||||
* Enables video recording for all pages to {@code videosPath} folder. If not specified, videos are not recorded. Make sure to await {@code browserContext.close} for videos to be saved.
|
||||
*/
|
||||
public String videosPath;
|
||||
/**
|
||||
* Specifies dimensions of the automatically recorded video. Can only be used if {@code videosPath} is set. If not specified the size will be equal to {@code viewport}. If {@code viewport} is not configured explicitly the video size defaults to 1280x720. Actual picture of the page will be scaled down if necessary to fit specified size.
|
||||
*/
|
||||
public VideoSize videoSize;
|
||||
/**
|
||||
* Enables HAR recording for all the pages into {@code har.path} file. If not specified, HAR is not recorded. Make sure to await {@code page.close} for HAR to be saved.
|
||||
*/
|
||||
public RecordHar recordHar;
|
||||
|
||||
public LaunchPersistentContextOptions withHeadless(Boolean headless) {
|
||||
@ -407,9 +605,21 @@ public interface BrowserType {
|
||||
}
|
||||
class LaunchServerOptions {
|
||||
public class Proxy {
|
||||
/**
|
||||
* Proxy to be used for all requests. HTTP and SOCKS proxies are supported, for example {@code http://myproxy.com:3128} or {@code socks5://myproxy.com:3128}. Short form {@code myproxy.com:3128} is considered an HTTP proxy.
|
||||
*/
|
||||
public String server;
|
||||
/**
|
||||
* Optional coma-separated domains to bypass proxy, for example {@code ".com, chromium.org, .domain.com"}.
|
||||
*/
|
||||
public String bypass;
|
||||
/**
|
||||
* Optional username to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String username;
|
||||
/**
|
||||
* Optional password to use if HTTP proxy requires authentication.
|
||||
*/
|
||||
public String password;
|
||||
|
||||
Proxy() {
|
||||
@ -435,21 +645,69 @@ public interface BrowserType {
|
||||
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 Boolean headless;
|
||||
/**
|
||||
* Port to use for the web socket. Defaults to 0 that picks any available port.
|
||||
*/
|
||||
public Integer port;
|
||||
/**
|
||||
* 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 current working directory. **BEWARE**: Playwright is only guaranteed to work with the bundled Chromium, Firefox or WebKit, use at your own risk.
|
||||
*/
|
||||
public String executablePath;
|
||||
/**
|
||||
* Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.
|
||||
*/
|
||||
public List<String> args;
|
||||
/**
|
||||
* If {@code true}, then do not use any of the default arguments. If an array is given, then filter out the given default arguments. Dangerous option; use with care. Defaults to {@code false}.
|
||||
*/
|
||||
public String ignoreDefaultArgs;
|
||||
/**
|
||||
* Network proxy settings.
|
||||
*/
|
||||
public Proxy proxy;
|
||||
/**
|
||||
* If specified, accepted downloads are downloaded into this folder. Otherwise, temporary folder is created and is deleted when browser is closed.
|
||||
*/
|
||||
public String downloadsPath;
|
||||
/**
|
||||
* Enable Chromium sandboxing. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean chromiumSandbox;
|
||||
/**
|
||||
* Firefox user preferences. Learn more about the Firefox user preferences at {@code about:config}.
|
||||
*/
|
||||
public String firefoxUserPrefs;
|
||||
/**
|
||||
* Close the browser process on Ctrl-C. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGINT;
|
||||
/**
|
||||
* Close the browser process on SIGTERM. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGTERM;
|
||||
/**
|
||||
* Close the browser process on SIGHUP. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean handleSIGHUP;
|
||||
/**
|
||||
* Logger sink for Playwright logging.
|
||||
*/
|
||||
public Logger logger;
|
||||
/**
|
||||
* 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 Integer timeout;
|
||||
/**
|
||||
* Specify environment variables that will be visible to the browser. Defaults to {@code process.env}.
|
||||
*/
|
||||
public String env;
|
||||
/**
|
||||
* **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 Boolean devtools;
|
||||
|
||||
public LaunchServerOptions withHeadless(Boolean headless) {
|
||||
|
@ -27,8 +27,17 @@ import java.util.*;
|
||||
*/
|
||||
public interface ChromiumBrowser extends Browser {
|
||||
class StartTracingOptions {
|
||||
/**
|
||||
* A path to write the trace file to.
|
||||
*/
|
||||
public Path path;
|
||||
/**
|
||||
* captures screenshots in the trace.
|
||||
*/
|
||||
public Boolean screenshots;
|
||||
/**
|
||||
* specify custom categories to use instead of default.
|
||||
*/
|
||||
public List<String> categories;
|
||||
|
||||
public StartTracingOptions withPath(Path path) {
|
||||
|
@ -23,6 +23,9 @@ import java.util.*;
|
||||
*/
|
||||
public interface ChromiumCoverage {
|
||||
class StartCSSCoverageOptions {
|
||||
/**
|
||||
* Whether to reset coverage on every navigation. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean resetOnNavigation;
|
||||
|
||||
public StartCSSCoverageOptions withResetOnNavigation(Boolean resetOnNavigation) {
|
||||
@ -31,7 +34,13 @@ public interface ChromiumCoverage {
|
||||
}
|
||||
}
|
||||
class StartJSCoverageOptions {
|
||||
/**
|
||||
* Whether to reset coverage on every navigation. Defaults to {@code true}.
|
||||
*/
|
||||
public Boolean resetOnNavigation;
|
||||
/**
|
||||
* Whether anonymous scripts generated by the page should be reported. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean reportAnonymousScripts;
|
||||
|
||||
public StartJSCoverageOptions withResetOnNavigation(Boolean resetOnNavigation) {
|
||||
@ -44,8 +53,17 @@ public interface ChromiumCoverage {
|
||||
}
|
||||
}
|
||||
class ChromiumCoverageStopCSSCoverage {
|
||||
/**
|
||||
* StyleSheet URL
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* StyleSheet content, if available.
|
||||
*/
|
||||
private String text;
|
||||
/**
|
||||
* StyleSheet ranges that were used. Ranges are sorted and non-overlapping.
|
||||
*/
|
||||
private List<Object> ranges;
|
||||
|
||||
public String url() {
|
||||
@ -59,9 +77,21 @@ public interface ChromiumCoverage {
|
||||
}
|
||||
}
|
||||
class ChromiumCoverageStopJSCoverage {
|
||||
/**
|
||||
* Script URL
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* Script ID
|
||||
*/
|
||||
private String scriptId;
|
||||
/**
|
||||
* Script content, if applicable.
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* V8-specific coverage format.
|
||||
*/
|
||||
private List<Object> functions;
|
||||
|
||||
public String url() {
|
||||
|
@ -23,8 +23,17 @@ import java.util.*;
|
||||
*/
|
||||
public interface ConsoleMessage {
|
||||
class Location {
|
||||
/**
|
||||
* URL of the resource if available, otherwise empty string.
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
* 0-based line number in the resource.
|
||||
*/
|
||||
private int lineNumber;
|
||||
/**
|
||||
* 0-based column number in the resource.
|
||||
*/
|
||||
private int columnNumber;
|
||||
|
||||
public String url() {
|
||||
|
@ -55,8 +55,17 @@ public interface ElementHandle extends JSHandle {
|
||||
|
||||
enum ElementState { DISABLED, ENABLED, HIDDEN, STABLE, VISIBLE }
|
||||
class CheckOptions {
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public CheckOptions withForce(Boolean force) {
|
||||
@ -73,13 +82,37 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class ClickOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Mouse.Button button;
|
||||
/**
|
||||
* defaults to 1. See UIEvent.detail.
|
||||
*/
|
||||
public Integer clickCount;
|
||||
/**
|
||||
* Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* A point to click relative to the top-left corner of element padding box. If not specified, clicks to some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public ClickOptions withButton(Mouse.Button button) {
|
||||
@ -119,12 +152,33 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class DblclickOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Mouse.Button button;
|
||||
/**
|
||||
* Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* A point to double click relative to the top-left corner of element padding box. If not specified, double clicks to some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public DblclickOptions withButton(Mouse.Button button) {
|
||||
@ -160,7 +214,13 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class FillOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public FillOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
@ -173,9 +233,21 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class HoverOptions {
|
||||
/**
|
||||
* A point to hover relative to the top-left corner of element padding box. If not specified, hovers over some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public HoverOptions withPosition(Position position) {
|
||||
@ -199,8 +271,17 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class PressOptions {
|
||||
/**
|
||||
* Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public PressOptions withDelay(Integer delay) {
|
||||
@ -218,10 +299,25 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
class ScreenshotOptions {
|
||||
public enum Type { JPEG, PNG }
|
||||
/**
|
||||
* 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 current working directory. If no path is provided, the image won't be saved to the disk.
|
||||
*/
|
||||
public Path path;
|
||||
/**
|
||||
* Specify screenshot type, defaults to {@code png}.
|
||||
*/
|
||||
public Type type;
|
||||
/**
|
||||
* The quality of the image, between 0-100. Not applicable to {@code png} images.
|
||||
*/
|
||||
public Integer quality;
|
||||
/**
|
||||
* Hides default white background and allows capturing screenshots with transparency. Not applicable to {@code jpeg} images. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean omitBackground;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public ScreenshotOptions withPath(Path path) {
|
||||
@ -246,6 +342,9 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class ScrollIntoViewIfNeededOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public ScrollIntoViewIfNeededOptions withTimeout(Integer timeout) {
|
||||
@ -254,7 +353,13 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class SelectOptionOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public SelectOptionOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
@ -267,6 +372,9 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class SelectTextOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public SelectTextOptions withTimeout(Integer timeout) {
|
||||
@ -275,7 +383,13 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class SetInputFilesOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public SetInputFilesOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
@ -307,10 +421,25 @@ public interface ElementHandle extends JSHandle {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A point to tap relative to the top-left corner of element padding box. If not specified, taps some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the tap, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public Position setPosition() {
|
||||
@ -335,8 +464,17 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class TypeOptions {
|
||||
/**
|
||||
* Time to wait between key presses in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public TypeOptions withDelay(Integer delay) {
|
||||
@ -353,8 +491,17 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class UncheckOptions {
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public UncheckOptions withForce(Boolean force) {
|
||||
@ -371,6 +518,9 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
}
|
||||
class WaitForElementStateOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForElementStateOptions withTimeout(Integer timeout) {
|
||||
@ -380,7 +530,17 @@ public interface ElementHandle extends JSHandle {
|
||||
}
|
||||
class WaitForSelectorOptions {
|
||||
public enum State { ATTACHED, DETACHED, HIDDEN, VISIBLE }
|
||||
/**
|
||||
* 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 State state;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForSelectorOptions withState(State state) {
|
||||
|
@ -37,7 +37,13 @@ public interface FileChooser {
|
||||
}
|
||||
|
||||
class SetFilesOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public SetFilesOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
|
@ -36,9 +36,21 @@ import java.util.regex.Pattern;
|
||||
public interface Frame {
|
||||
enum LoadState { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
class AddScriptTagOptions {
|
||||
/**
|
||||
* URL of a script to be added.
|
||||
*/
|
||||
public String url;
|
||||
/**
|
||||
* Path to the JavaScript file to be injected into frame. If {@code path} is a relative path, then it is resolved relative to current working directory.
|
||||
*/
|
||||
public Path path;
|
||||
/**
|
||||
* Raw JavaScript content to be injected into frame.
|
||||
*/
|
||||
public String content;
|
||||
/**
|
||||
* Script type. Use 'module' in order to load a Javascript ES6 module. See script for more details.
|
||||
*/
|
||||
public String type;
|
||||
|
||||
public AddScriptTagOptions withUrl(String url) {
|
||||
@ -59,8 +71,17 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class AddStyleTagOptions {
|
||||
/**
|
||||
* URL of the {@code <link>} tag.
|
||||
*/
|
||||
public String url;
|
||||
/**
|
||||
* Path to the CSS file to be injected into frame. If {@code path} is a relative path, then it is resolved relative to current working directory.
|
||||
*/
|
||||
public Path path;
|
||||
/**
|
||||
* Raw CSS content to be injected into frame.
|
||||
*/
|
||||
public String content;
|
||||
|
||||
public AddStyleTagOptions withUrl(String url) {
|
||||
@ -77,8 +98,17 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class CheckOptions {
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public CheckOptions withForce(Boolean force) {
|
||||
@ -95,13 +125,37 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class ClickOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Mouse.Button button;
|
||||
/**
|
||||
* defaults to 1. See UIEvent.detail.
|
||||
*/
|
||||
public Integer clickCount;
|
||||
/**
|
||||
* Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* A point to click relative to the top-left corner of element padding box. If not specified, clicks to some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public ClickOptions withButton(Mouse.Button button) {
|
||||
@ -141,12 +195,33 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class DblclickOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Mouse.Button button;
|
||||
/**
|
||||
* Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* A point to double click relative to the top-left corner of element padding box. If not specified, double clicks to some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public DblclickOptions withButton(Mouse.Button button) {
|
||||
@ -182,6 +257,9 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class DispatchEventOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public DispatchEventOptions withTimeout(Integer timeout) {
|
||||
@ -190,7 +268,13 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class FillOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public FillOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
@ -203,6 +287,9 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class FocusOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public FocusOptions withTimeout(Integer timeout) {
|
||||
@ -211,6 +298,9 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class GetAttributeOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public GetAttributeOptions withTimeout(Integer timeout) {
|
||||
@ -219,8 +309,20 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class NavigateOptions {
|
||||
/**
|
||||
* Maximum navigation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
/**
|
||||
* When to consider navigation succeeded, defaults to {@code load}. Events can be either:
|
||||
* - {@code 'domcontentloaded'} - consider navigation to be finished when the {@code DOMContentLoaded} event is fired.
|
||||
* - {@code 'load'} - consider navigation to be finished when the {@code load} event is fired.
|
||||
* - {@code 'networkidle'} - consider navigation to be finished when there are no network connections for at least {@code 500} ms.
|
||||
*/
|
||||
public LoadState waitUntil;
|
||||
/**
|
||||
* Referer header value. If provided it will take preference over the referer header value set by page.setExtraHTTPHeaders().
|
||||
*/
|
||||
public String referer;
|
||||
|
||||
public NavigateOptions withTimeout(Integer timeout) {
|
||||
@ -237,9 +339,21 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class HoverOptions {
|
||||
/**
|
||||
* A point to hover relative to the top-left corner of element padding box. If not specified, hovers over some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public HoverOptions withPosition(Position position) {
|
||||
@ -263,6 +377,9 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class InnerHTMLOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public InnerHTMLOptions withTimeout(Integer timeout) {
|
||||
@ -271,6 +388,9 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class InnerTextOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public InnerTextOptions withTimeout(Integer timeout) {
|
||||
@ -279,8 +399,17 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class PressOptions {
|
||||
/**
|
||||
* Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public PressOptions withDelay(Integer delay) {
|
||||
@ -297,7 +426,13 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class SelectOptionOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public SelectOptionOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
@ -310,7 +445,16 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class SetContentOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds for resources to load, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
/**
|
||||
* When to consider navigation succeeded, defaults to {@code load}. Events can be either:
|
||||
* - {@code 'domcontentloaded'} - consider setting content to be finished when the {@code DOMContentLoaded} event is fired.
|
||||
* - {@code 'load'} - consider setting content to be finished when the {@code load} event is fired.
|
||||
* - {@code 'networkidle'} - consider setting content to be finished when there are no network connections for at least {@code 500} ms.
|
||||
*/
|
||||
public LoadState waitUntil;
|
||||
|
||||
public SetContentOptions withTimeout(Integer timeout) {
|
||||
@ -323,7 +467,13 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class SetInputFilesOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public SetInputFilesOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
@ -355,10 +505,25 @@ public interface Frame {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A point to tap relative to the top-left corner of element padding box. If not specified, taps some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the tap, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public Position setPosition() {
|
||||
@ -383,6 +548,9 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class TextContentOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public TextContentOptions withTimeout(Integer timeout) {
|
||||
@ -391,8 +559,17 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class TypeOptions {
|
||||
/**
|
||||
* Time to wait between key presses in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public TypeOptions withDelay(Integer delay) {
|
||||
@ -409,8 +586,17 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class UncheckOptions {
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public UncheckOptions withForce(Boolean force) {
|
||||
@ -427,7 +613,13 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class WaitForFunctionOptions {
|
||||
/**
|
||||
* If {@code polling} is {@code 'raf'}, then {@code pageFunction} is constantly executed in {@code requestAnimationFrame} callback. If {@code polling} is a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to {@code raf}.
|
||||
*/
|
||||
public Integer pollingInterval;
|
||||
/**
|
||||
* 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 browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForFunctionOptions withRequestAnimationFrame() {
|
||||
@ -444,6 +636,9 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class WaitForLoadStateOptions {
|
||||
/**
|
||||
* Maximum waiting time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForLoadStateOptions withTimeout(Integer timeout) {
|
||||
@ -452,10 +647,22 @@ public interface Frame {
|
||||
}
|
||||
}
|
||||
class WaitForNavigationOptions {
|
||||
/**
|
||||
* Maximum navigation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
/**
|
||||
* URL string, URL regex pattern or predicate receiving URL to match while waiting for the navigation.
|
||||
*/
|
||||
public String glob;
|
||||
public Pattern pattern;
|
||||
public Predicate<String> predicate;
|
||||
/**
|
||||
* When to consider navigation succeeded, defaults to {@code load}. Events can be either:
|
||||
* - {@code 'domcontentloaded'} - consider navigation to be finished when the {@code DOMContentLoaded} event is fired.
|
||||
* - {@code 'load'} - consider navigation to be finished when the {@code load} event is fired.
|
||||
* - {@code 'networkidle'} - consider navigation to be finished when there are no network connections for at least {@code 500} ms.
|
||||
*/
|
||||
public LoadState waitUntil;
|
||||
|
||||
public WaitForNavigationOptions withTimeout(Integer timeout) {
|
||||
@ -481,7 +688,17 @@ public interface Frame {
|
||||
}
|
||||
class WaitForSelectorOptions {
|
||||
public enum State { ATTACHED, DETACHED, HIDDEN, VISIBLE }
|
||||
/**
|
||||
* 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 State state;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForSelectorOptions withState(State state) {
|
||||
|
@ -25,6 +25,9 @@ import java.util.*;
|
||||
public interface Logger {
|
||||
enum Severity { ERROR, INFO, VERBOSE, WARNING }
|
||||
class LogHints {
|
||||
/**
|
||||
* preferred logger color
|
||||
*/
|
||||
public String color;
|
||||
|
||||
public LogHints withColor(String color) {
|
||||
|
@ -28,8 +28,17 @@ public interface Mouse {
|
||||
enum Button { LEFT, MIDDLE, RIGHT }
|
||||
|
||||
class ClickOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Button button;
|
||||
/**
|
||||
* defaults to 1. See UIEvent.detail.
|
||||
*/
|
||||
public Integer clickCount;
|
||||
/**
|
||||
* Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
|
||||
public ClickOptions withButton(Button button) {
|
||||
@ -46,7 +55,13 @@ public interface Mouse {
|
||||
}
|
||||
}
|
||||
class DblclickOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Button button;
|
||||
/**
|
||||
* Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
|
||||
public DblclickOptions withButton(Button button) {
|
||||
@ -59,7 +74,13 @@ public interface Mouse {
|
||||
}
|
||||
}
|
||||
class DownOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Button button;
|
||||
/**
|
||||
* defaults to 1. See UIEvent.detail.
|
||||
*/
|
||||
public Integer clickCount;
|
||||
|
||||
public DownOptions withButton(Button button) {
|
||||
@ -72,6 +93,9 @@ public interface Mouse {
|
||||
}
|
||||
}
|
||||
class MoveOptions {
|
||||
/**
|
||||
* defaults to 1. Sends intermediate {@code mousemove} events.
|
||||
*/
|
||||
public Integer steps;
|
||||
|
||||
public MoveOptions withSteps(Integer steps) {
|
||||
@ -80,7 +104,13 @@ public interface Mouse {
|
||||
}
|
||||
}
|
||||
class UpOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Button button;
|
||||
/**
|
||||
* defaults to 1. See UIEvent.detail.
|
||||
*/
|
||||
public Integer clickCount;
|
||||
|
||||
public UpOptions withButton(Button button) {
|
||||
|
@ -108,9 +108,21 @@ public interface Page {
|
||||
void removeListener(EventType type, Listener<EventType> listener);
|
||||
enum LoadState { DOMCONTENTLOADED, LOAD, NETWORKIDLE }
|
||||
class AddScriptTagOptions {
|
||||
/**
|
||||
* URL of a script to be added.
|
||||
*/
|
||||
public String url;
|
||||
/**
|
||||
* Path to the JavaScript file to be injected into frame. If {@code path} is a relative path, then it is resolved relative to current working directory.
|
||||
*/
|
||||
public Path path;
|
||||
/**
|
||||
* Raw JavaScript content to be injected into frame.
|
||||
*/
|
||||
public String content;
|
||||
/**
|
||||
* Script type. Use 'module' in order to load a Javascript ES6 module. See script for more details.
|
||||
*/
|
||||
public String type;
|
||||
|
||||
public AddScriptTagOptions withUrl(String url) {
|
||||
@ -131,8 +143,17 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class AddStyleTagOptions {
|
||||
/**
|
||||
* URL of the {@code <link>} tag.
|
||||
*/
|
||||
public String url;
|
||||
/**
|
||||
* Path to the CSS file to be injected into frame. If {@code path} is a relative path, then it is resolved relative to current working directory.
|
||||
*/
|
||||
public Path path;
|
||||
/**
|
||||
* Raw CSS content to be injected into frame.
|
||||
*/
|
||||
public String content;
|
||||
|
||||
public AddStyleTagOptions withUrl(String url) {
|
||||
@ -149,8 +170,17 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class CheckOptions {
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public CheckOptions withForce(Boolean force) {
|
||||
@ -167,13 +197,37 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class ClickOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Mouse.Button button;
|
||||
/**
|
||||
* defaults to 1. See UIEvent.detail.
|
||||
*/
|
||||
public Integer clickCount;
|
||||
/**
|
||||
* Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* A point to click relative to the top-left corner of element padding box. If not specified, clicks to some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public ClickOptions withButton(Mouse.Button button) {
|
||||
@ -213,6 +267,11 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class CloseOptions {
|
||||
/**
|
||||
* Defaults to {@code false}. Whether to run the
|
||||
* before unload
|
||||
* page handlers.
|
||||
*/
|
||||
public Boolean runBeforeUnload;
|
||||
|
||||
public CloseOptions withRunBeforeUnload(Boolean runBeforeUnload) {
|
||||
@ -221,12 +280,33 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class DblclickOptions {
|
||||
/**
|
||||
* Defaults to {@code left}.
|
||||
*/
|
||||
public Mouse.Button button;
|
||||
/**
|
||||
* Time to wait between {@code mousedown} and {@code mouseup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* A point to double click relative to the top-left corner of element padding box. If not specified, double clicks to some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the double click, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public DblclickOptions withButton(Mouse.Button button) {
|
||||
@ -262,6 +342,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class DispatchEventOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public DispatchEventOptions withTimeout(Integer timeout) {
|
||||
@ -271,7 +354,13 @@ public interface Page {
|
||||
}
|
||||
class EmulateMediaOptions {
|
||||
public enum Media { PRINT, SCREEN }
|
||||
/**
|
||||
* 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. Omitting {@code media} or passing {@code undefined} does not change the emulated value.
|
||||
*/
|
||||
public Optional<Media> media;
|
||||
/**
|
||||
* Emulates {@code 'prefers-colors-scheme'} media feature, supported values are {@code 'light'}, {@code 'dark'}, {@code 'no-preference'}. Passing {@code null} disables color scheme emulation. Omitting {@code colorScheme} or passing {@code undefined} does not change the emulated value.
|
||||
*/
|
||||
public Optional<ColorScheme> colorScheme;
|
||||
|
||||
public EmulateMediaOptions withMedia(Media media) {
|
||||
@ -284,6 +373,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class ExposeBindingOptions {
|
||||
/**
|
||||
* Whether to pass the argument as a handle, instead of passing by value. When passing a handle, only one argument is supported. When passing by value, multiple arguments are supported.
|
||||
*/
|
||||
public Boolean handle;
|
||||
|
||||
public ExposeBindingOptions withHandle(Boolean handle) {
|
||||
@ -292,7 +384,13 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class FillOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public FillOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
@ -305,6 +403,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class FocusOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public FocusOptions withTimeout(Integer timeout) {
|
||||
@ -313,6 +414,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class GetAttributeOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public GetAttributeOptions withTimeout(Integer timeout) {
|
||||
@ -321,7 +425,16 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class GoBackOptions {
|
||||
/**
|
||||
* Maximum navigation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
/**
|
||||
* When to consider navigation succeeded, defaults to {@code load}. Events can be either:
|
||||
* - {@code 'domcontentloaded'} - consider navigation to be finished when the {@code DOMContentLoaded} event is fired.
|
||||
* - {@code 'load'} - consider navigation to be finished when the {@code load} event is fired.
|
||||
* - {@code 'networkidle'} - consider navigation to be finished when there are no network connections for at least {@code 500} ms.
|
||||
*/
|
||||
public Frame.LoadState waitUntil;
|
||||
|
||||
public GoBackOptions withTimeout(Integer timeout) {
|
||||
@ -334,7 +447,16 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class GoForwardOptions {
|
||||
/**
|
||||
* Maximum navigation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
/**
|
||||
* When to consider navigation succeeded, defaults to {@code load}. Events can be either:
|
||||
* - {@code 'domcontentloaded'} - consider navigation to be finished when the {@code DOMContentLoaded} event is fired.
|
||||
* - {@code 'load'} - consider navigation to be finished when the {@code load} event is fired.
|
||||
* - {@code 'networkidle'} - consider navigation to be finished when there are no network connections for at least {@code 500} ms.
|
||||
*/
|
||||
public Frame.LoadState waitUntil;
|
||||
|
||||
public GoForwardOptions withTimeout(Integer timeout) {
|
||||
@ -347,8 +469,20 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class NavigateOptions {
|
||||
/**
|
||||
* Maximum navigation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
/**
|
||||
* When to consider navigation succeeded, defaults to {@code load}. Events can be either:
|
||||
* - {@code 'domcontentloaded'} - consider navigation to be finished when the {@code DOMContentLoaded} event is fired.
|
||||
* - {@code 'load'} - consider navigation to be finished when the {@code load} event is fired.
|
||||
* - {@code 'networkidle'} - consider navigation to be finished when there are no network connections for at least {@code 500} ms.
|
||||
*/
|
||||
public Frame.LoadState waitUntil;
|
||||
/**
|
||||
* Referer header value. If provided it will take preference over the referer header value set by page.setExtraHTTPHeaders().
|
||||
*/
|
||||
public String referer;
|
||||
|
||||
public NavigateOptions withTimeout(Integer timeout) {
|
||||
@ -365,9 +499,21 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class HoverOptions {
|
||||
/**
|
||||
* A point to hover relative to the top-left corner of element padding box. If not specified, hovers over some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the hover, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public HoverOptions withPosition(Position position) {
|
||||
@ -391,6 +537,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class InnerHTMLOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public InnerHTMLOptions withTimeout(Integer timeout) {
|
||||
@ -399,6 +548,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class InnerTextOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public InnerTextOptions withTimeout(Integer timeout) {
|
||||
@ -408,9 +560,21 @@ public interface Page {
|
||||
}
|
||||
class PdfOptions {
|
||||
public class Margin {
|
||||
/**
|
||||
* Top margin, accepts values labeled with units. Defaults to {@code 0}.
|
||||
*/
|
||||
public String top;
|
||||
/**
|
||||
* Right margin, accepts values labeled with units. Defaults to {@code 0}.
|
||||
*/
|
||||
public String right;
|
||||
/**
|
||||
* Bottom margin, accepts values labeled with units. Defaults to {@code 0}.
|
||||
*/
|
||||
public String bottom;
|
||||
/**
|
||||
* Left margin, accepts values labeled with units. Defaults to {@code 0}.
|
||||
*/
|
||||
public String left;
|
||||
|
||||
Margin() {
|
||||
@ -436,18 +600,62 @@ public interface Page {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The file path to save the PDF to. If {@code path} is a relative path, then it is resolved relative to current working directory. If no path is provided, the PDF won't be saved to the disk.
|
||||
*/
|
||||
public Path path;
|
||||
/**
|
||||
* Scale of the webpage rendering. Defaults to {@code 1}. Scale amount must be between 0.1 and 2.
|
||||
*/
|
||||
public Integer scale;
|
||||
/**
|
||||
* Display header and footer. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean displayHeaderFooter;
|
||||
/**
|
||||
* 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 String headerTemplate;
|
||||
/**
|
||||
* HTML template for the print footer. Should use the same format as the {@code headerTemplate}.
|
||||
*/
|
||||
public String footerTemplate;
|
||||
/**
|
||||
* Print background graphics. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean printBackground;
|
||||
/**
|
||||
* Paper orientation. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean landscape;
|
||||
/**
|
||||
* Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages.
|
||||
*/
|
||||
public String pageRanges;
|
||||
/**
|
||||
* Paper format. If set, takes priority over {@code width} or {@code height} options. Defaults to 'Letter'.
|
||||
*/
|
||||
public String format;
|
||||
/**
|
||||
* Paper width, accepts values labeled with units.
|
||||
*/
|
||||
public String width;
|
||||
/**
|
||||
* Paper height, accepts values labeled with units.
|
||||
*/
|
||||
public String height;
|
||||
/**
|
||||
* Paper margins, defaults to none.
|
||||
*/
|
||||
public Margin margin;
|
||||
/**
|
||||
* 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 Boolean preferCSSPageSize;
|
||||
|
||||
public PdfOptions withPath(Path path) {
|
||||
@ -504,8 +712,17 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class PressOptions {
|
||||
/**
|
||||
* Time to wait between {@code keydown} and {@code keyup} in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public PressOptions withDelay(Integer delay) {
|
||||
@ -522,7 +739,16 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class ReloadOptions {
|
||||
/**
|
||||
* Maximum navigation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
/**
|
||||
* When to consider navigation succeeded, defaults to {@code load}. Events can be either:
|
||||
* - {@code 'domcontentloaded'} - consider navigation to be finished when the {@code DOMContentLoaded} event is fired.
|
||||
* - {@code 'load'} - consider navigation to be finished when the {@code load} event is fired.
|
||||
* - {@code 'networkidle'} - consider navigation to be finished when there are no network connections for at least {@code 500} ms.
|
||||
*/
|
||||
public Frame.LoadState waitUntil;
|
||||
|
||||
public ReloadOptions withTimeout(Integer timeout) {
|
||||
@ -537,9 +763,21 @@ public interface Page {
|
||||
class ScreenshotOptions {
|
||||
public enum Type { JPEG, PNG }
|
||||
public class Clip {
|
||||
/**
|
||||
* x-coordinate of top-left corner of clip area
|
||||
*/
|
||||
public int x;
|
||||
/**
|
||||
* y-coordinate of top-left corner of clip area
|
||||
*/
|
||||
public int y;
|
||||
/**
|
||||
* width of clipping area
|
||||
*/
|
||||
public int width;
|
||||
/**
|
||||
* height of clipping area
|
||||
*/
|
||||
public int height;
|
||||
|
||||
Clip() {
|
||||
@ -565,12 +803,33 @@ public interface Page {
|
||||
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 current working directory. If no path is provided, the image won't be saved to the disk.
|
||||
*/
|
||||
public Path path;
|
||||
/**
|
||||
* Specify screenshot type, defaults to {@code png}.
|
||||
*/
|
||||
public Type type;
|
||||
/**
|
||||
* The quality of the image, between 0-100. Not applicable to {@code png} images.
|
||||
*/
|
||||
public Integer quality;
|
||||
/**
|
||||
* When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean fullPage;
|
||||
/**
|
||||
* An object which specifies clipping of the resulting image. Should have the following fields:
|
||||
*/
|
||||
public Clip clip;
|
||||
/**
|
||||
* Hides default white background and allows capturing screenshots with transparency. Not applicable to {@code jpeg} images. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean omitBackground;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public ScreenshotOptions withPath(Path path) {
|
||||
@ -603,7 +862,13 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class SelectOptionOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public SelectOptionOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
@ -616,7 +881,16 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class SetContentOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds for resources to load, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
/**
|
||||
* When to consider setting markup succeeded, defaults to {@code load}. Given an array of event strings, setting content is considered to be successful after all events have been fired. Events can be either:
|
||||
* - {@code 'load'} - consider setting content to be finished when the {@code load} event is fired.
|
||||
* - {@code 'domcontentloaded'} - consider setting content to be finished when the {@code DOMContentLoaded} event is fired.
|
||||
* - {@code 'networkidle'} - consider setting content to be finished when there are no network connections for at least {@code 500} ms.
|
||||
*/
|
||||
public Frame.LoadState waitUntil;
|
||||
|
||||
public SetContentOptions withTimeout(Integer timeout) {
|
||||
@ -629,7 +903,13 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class SetInputFilesOptions {
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public SetInputFilesOptions withNoWaitAfter(Boolean noWaitAfter) {
|
||||
@ -661,10 +941,25 @@ public interface Page {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* A point to tap relative to the top-left corner of element padding box. If not specified, taps some visible point of the element.
|
||||
*/
|
||||
public Position position;
|
||||
/**
|
||||
* Modifier keys to press. Ensures that only these modifiers are pressed during the tap, and then restores current modifiers back. If not specified, currently pressed modifiers are used.
|
||||
*/
|
||||
public Set<Keyboard.Modifier> modifiers;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public Position setPosition() {
|
||||
@ -689,6 +984,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class TextContentOptions {
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public TextContentOptions withTimeout(Integer timeout) {
|
||||
@ -697,8 +995,17 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class TypeOptions {
|
||||
/**
|
||||
* Time to wait between key presses in milliseconds. Defaults to 0.
|
||||
*/
|
||||
public Integer delay;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public TypeOptions withDelay(Integer delay) {
|
||||
@ -715,8 +1022,17 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class UncheckOptions {
|
||||
/**
|
||||
* Whether to bypass the actionability checks. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean force;
|
||||
/**
|
||||
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as navigating to inaccessible pages. Defaults to {@code false}.
|
||||
*/
|
||||
public Boolean noWaitAfter;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public UncheckOptions withForce(Boolean force) {
|
||||
@ -733,7 +1049,13 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class WaitForFunctionOptions {
|
||||
/**
|
||||
* If {@code polling} is {@code 'raf'}, then {@code pageFunction} is constantly executed in {@code requestAnimationFrame} callback. If {@code polling} is a number, then it is treated as an interval in milliseconds at which the function would be executed. Defaults to {@code raf}.
|
||||
*/
|
||||
public Integer pollingInterval;
|
||||
/**
|
||||
* 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 page.setDefaultTimeout(timeout) method.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForFunctionOptions withRequestAnimationFrame() {
|
||||
@ -750,6 +1072,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class WaitForLoadStateOptions {
|
||||
/**
|
||||
* Maximum waiting time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForLoadStateOptions withTimeout(Integer timeout) {
|
||||
@ -758,10 +1083,22 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class WaitForNavigationOptions {
|
||||
/**
|
||||
* Maximum navigation time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultNavigationTimeout(timeout), browserContext.setDefaultTimeout(timeout), page.setDefaultNavigationTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
/**
|
||||
* A glob pattern, regex pattern or predicate receiving URL to match while waiting for the navigation.
|
||||
*/
|
||||
public String glob;
|
||||
public Pattern pattern;
|
||||
public Predicate<String> predicate;
|
||||
/**
|
||||
* When to consider navigation succeeded, defaults to {@code load}. Events can be either:
|
||||
* - {@code 'domcontentloaded'} - consider navigation to be finished when the {@code DOMContentLoaded} event is fired.
|
||||
* - {@code 'load'} - consider navigation to be finished when the {@code load} event is fired.
|
||||
* - {@code 'networkidle'} - consider navigation to be finished when there are no network connections for at least {@code 500} ms.
|
||||
*/
|
||||
public Frame.LoadState waitUntil;
|
||||
|
||||
public WaitForNavigationOptions withTimeout(Integer timeout) {
|
||||
@ -786,6 +1123,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class WaitForRequestOptions {
|
||||
/**
|
||||
* 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 page.setDefaultTimeout(timeout) method.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForRequestOptions withTimeout(Integer timeout) {
|
||||
@ -794,6 +1134,9 @@ public interface Page {
|
||||
}
|
||||
}
|
||||
class WaitForResponseOptions {
|
||||
/**
|
||||
* 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 browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForResponseOptions withTimeout(Integer timeout) {
|
||||
@ -803,7 +1146,17 @@ public interface Page {
|
||||
}
|
||||
class WaitForSelectorOptions {
|
||||
public enum State { ATTACHED, DETACHED, HIDDEN, VISIBLE }
|
||||
/**
|
||||
* 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 State state;
|
||||
/**
|
||||
* Maximum time in milliseconds, defaults to 30 seconds, pass {@code 0} to disable timeout. The default value can be changed by using the browserContext.setDefaultTimeout(timeout) or page.setDefaultTimeout(timeout) methods.
|
||||
*/
|
||||
public Integer timeout;
|
||||
|
||||
public WaitForSelectorOptions withState(State state) {
|
||||
|
@ -35,6 +35,9 @@ import java.util.*;
|
||||
*/
|
||||
public interface Request {
|
||||
class RequestFailure {
|
||||
/**
|
||||
* Human-readable error message, e.g. {@code 'net::ERR_FAILED'}.
|
||||
*/
|
||||
private String errorText;
|
||||
|
||||
public RequestFailure(String errorText) {
|
||||
@ -48,14 +51,42 @@ public interface Request {
|
||||
|
||||
}
|
||||
class RequestTiming {
|
||||
/**
|
||||
* Request start time in milliseconds elapsed since January 1, 1970 00:00:00 UTC
|
||||
*/
|
||||
private int startTime;
|
||||
/**
|
||||
* Time immediately before the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to {@code startTime}, -1 if not available.
|
||||
*/
|
||||
private int domainLookupStart;
|
||||
/**
|
||||
* Time immediately after the browser starts the domain name lookup for the resource. The value is given in milliseconds relative to {@code startTime}, -1 if not available.
|
||||
*/
|
||||
private int domainLookupEnd;
|
||||
/**
|
||||
* Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to {@code startTime}, -1 if not available.
|
||||
*/
|
||||
private int connectStart;
|
||||
/**
|
||||
* Time immediately before the browser starts the handshake process to secure the current connection. The value is given in milliseconds relative to {@code startTime}, -1 if not available.
|
||||
*/
|
||||
private int secureConnectionStart;
|
||||
/**
|
||||
* Time immediately before the user agent starts establishing the connection to the server to retrieve the resource. The value is given in milliseconds relative to {@code startTime}, -1 if not available.
|
||||
*/
|
||||
private int connectEnd;
|
||||
/**
|
||||
* Time immediately before the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to {@code startTime}, -1 if not available.
|
||||
*/
|
||||
private int requestStart;
|
||||
/**
|
||||
* Time immediately after the browser starts requesting the resource from the server, cache, or local resource. The value is given in milliseconds relative to {@code startTime}, -1 if not available.
|
||||
*/
|
||||
private int responseStart;
|
||||
/**
|
||||
* Time immediately after the browser receives the last byte of the resource or immediately before the transport connection is closed, whichever comes first. The value is given in milliseconds relative to {@code startTime}, -1 if not available.
|
||||
* };
|
||||
*/
|
||||
private int responseEnd;
|
||||
|
||||
public int startTime() {
|
||||
|
@ -25,8 +25,17 @@ import java.util.*;
|
||||
*/
|
||||
public interface Route {
|
||||
class ContinueOverrides {
|
||||
/**
|
||||
* If set changes the request method (e.g. GET or POST)
|
||||
*/
|
||||
public String method;
|
||||
/**
|
||||
* If set changes the post data of request
|
||||
*/
|
||||
public byte[] postData;
|
||||
/**
|
||||
* If set changes the request HTTP headers. Header values will be converted to a string.
|
||||
*/
|
||||
public Map<String, String> headers;
|
||||
|
||||
public ContinueOverrides withMethod(String method) {
|
||||
@ -47,11 +56,26 @@ public interface Route {
|
||||
}
|
||||
}
|
||||
class FulfillResponse {
|
||||
/**
|
||||
* Response status code, defaults to {@code 200}.
|
||||
*/
|
||||
public int status;
|
||||
/**
|
||||
* Optional response headers. Header values will be converted to a string.
|
||||
*/
|
||||
public Map<String, String> headers;
|
||||
/**
|
||||
* If set, equals to setting {@code Content-Type} response header.
|
||||
*/
|
||||
public String contentType;
|
||||
/**
|
||||
* Optional response body.
|
||||
*/
|
||||
public String body;
|
||||
public byte[] bodyBytes;
|
||||
/**
|
||||
* Optional 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 current working directory.
|
||||
*/
|
||||
public Path path;
|
||||
|
||||
public FulfillResponse withStatus(int status) {
|
||||
|
@ -24,6 +24,9 @@ import java.util.*;
|
||||
*/
|
||||
public interface Selectors {
|
||||
class RegisterOptions {
|
||||
/**
|
||||
* 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 Boolean contentScript;
|
||||
|
||||
public RegisterOptions withContentScript(Boolean contentScript) {
|
||||
|
@ -32,6 +32,9 @@ public interface WebSocket {
|
||||
void addListener(EventType type, Listener<EventType> listener);
|
||||
void removeListener(EventType type, Listener<EventType> listener);
|
||||
class WebSocketFramereceived {
|
||||
/**
|
||||
* frame payload
|
||||
*/
|
||||
public byte[] payload;
|
||||
|
||||
public WebSocketFramereceived withPayload(byte[] payload) {
|
||||
@ -40,6 +43,9 @@ public interface WebSocket {
|
||||
}
|
||||
}
|
||||
class WebSocketFramesent {
|
||||
/**
|
||||
* frame payload
|
||||
*/
|
||||
public byte[] payload;
|
||||
|
||||
public WebSocketFramesent withPayload(byte[] payload) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user