diff --git a/playwright/pom.xml b/playwright/pom.xml
index 2c927d88c..05c3a6a5b 100644
--- a/playwright/pom.xml
+++ b/playwright/pom.xml
@@ -65,6 +65,10 @@
NOTE: When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
* replacing {@code localhost} with {@code local.playwright}.
*/
- public List Pass an array to use different credentials for different origins. The first entry that matches the request origin is
* used, and entries with no origin match any request.
*/
- public Object httpCredentials;
+ public @Nullable Object httpCredentials;
/**
* Whether to ignore HTTPS errors when sending network requests. Defaults to {@code false}.
*/
- public Boolean ignoreHTTPSErrors;
+ public @Nullable Boolean ignoreHTTPSErrors;
/**
* Maximum number of request redirects that will be followed automatically. An error will be thrown if the number is
* exceeded. Defaults to {@code 20}. Pass {@code 0} to not follow redirects. This can be overwritten for each request
* individually.
*/
- public Integer maxRedirects;
+ public @Nullable Integer maxRedirects;
/**
* Network proxy settings.
*/
- public Proxy proxy;
+ public @Nullable Proxy proxy;
/**
* Populates context with given storage state. This option can be used to initialize context with logged-in information
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()} or {@link
@@ -97,22 +98,22 @@ class NewContextOptions {
* BrowserContext.storageState()} or {@link com.microsoft.playwright.APIRequestContext#storageState
* APIRequestContext.storageState()} methods.
*/
- public String storageState;
+ public @Nullable String storageState;
/**
* Populates context with given storage state. This option can be used to initialize context with logged-in information
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()}. Path to the
* file with saved storage state.
*/
- public Path storageStatePath;
+ public @Nullable Path storageStatePath;
/**
* Maximum time in milliseconds to wait for the response. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable
* timeout.
*/
- public Double timeout;
+ public @Nullable Double timeout;
/**
* Specific user agent to use in this context.
*/
- public String userAgent;
+ public @Nullable String userAgent;
/**
* Methods like {@link com.microsoft.playwright.APIRequestContext#get APIRequestContext.get()} take the base URL into
@@ -277,6 +278,6 @@ default APIRequestContext newContext() {
*
* @since v1.16
*/
- APIRequestContext newContext(NewContextOptions options);
+ APIRequestContext newContext(@Nullable NewContextOptions options);
}
diff --git a/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java b/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java
index 32d8fae6e..1372d5265 100644
--- a/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java
+++ b/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java
@@ -16,6 +16,7 @@
package com.microsoft.playwright;
+import org.jspecify.annotations.Nullable;
import com.microsoft.playwright.options.*;
import java.nio.file.Path;
@@ -46,7 +47,7 @@ class DisposeOptions {
/**
* The reason to be reported to the operations interrupted by the context disposal.
*/
- public String reason;
+ public @Nullable String reason;
/**
* The reason to be reported to the operations interrupted by the context disposal.
@@ -60,16 +61,16 @@ class StorageStateOptions {
/**
* Set to {@code true} to include IndexedDB in the storage state snapshot.
*/
- public Boolean indexedDB;
+ public @Nullable Boolean indexedDB;
/**
* Set to {@code true} to include the origin private file system in the storage state snapshot.
*/
- public Boolean opfs;
+ public @Nullable Boolean opfs;
/**
* The file path to save the storage state to. If {@code path} is a relative path, then it is resolved relative to current
* working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
*/
- public Path path;
+ public @Nullable Path path;
/**
* Set to {@code true} to include IndexedDB in the storage state snapshot.
@@ -114,7 +115,7 @@ default APIResponse delete(String url) {
* @param params Optional request parameters.
* @since v1.16
*/
- APIResponse delete(String url, RequestOptions params);
+ APIResponse delete(String url, @Nullable RequestOptions params);
/**
* All responses returned by {@link com.microsoft.playwright.APIRequestContext#get APIRequestContext.get()} and similar
* methods are stored in the memory, so that you can later call {@link com.microsoft.playwright.APIResponse#body
@@ -134,7 +135,7 @@ default void dispose() {
*
* @since v1.16
*/
- void dispose(DisposeOptions options);
+ void dispose(@Nullable DisposeOptions options);
/**
* Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update
* context cookies from the response. The method will automatically follow redirects.
@@ -207,7 +208,7 @@ default APIResponse fetch(String urlOrRequest) {
* @param params Optional request parameters.
* @since v1.16
*/
- APIResponse fetch(String urlOrRequest, RequestOptions params);
+ APIResponse fetch(String urlOrRequest, @Nullable RequestOptions params);
/**
* Sends HTTP(S) request and returns its response. The method will populate request cookies from the context and update
* context cookies from the response. The method will automatically follow redirects.
@@ -280,7 +281,7 @@ default APIResponse fetch(Request urlOrRequest) {
* @param params Optional request parameters.
* @since v1.16
*/
- APIResponse fetch(Request urlOrRequest, RequestOptions params);
+ APIResponse fetch(Request urlOrRequest, @Nullable RequestOptions params);
/**
* Sends HTTP(S) GET request and returns its
* response. The method will populate request cookies from the context and update context cookies from the response. The
@@ -319,7 +320,7 @@ default APIResponse get(String url) {
* @param params Optional request parameters.
* @since v1.16
*/
- APIResponse get(String url, RequestOptions params);
+ APIResponse get(String url, @Nullable RequestOptions params);
/**
* Sends HTTP(S) HEAD request and returns its
* response. The method will populate request cookies from the context and update context cookies from the response. The
@@ -340,7 +341,7 @@ default APIResponse head(String url) {
* @param params Optional request parameters.
* @since v1.16
*/
- APIResponse head(String url, RequestOptions params);
+ APIResponse head(String url, @Nullable RequestOptions params);
/**
* Sends HTTP(S) PATCH request and returns
* its response. The method will populate request cookies from the context and update context cookies from the response.
@@ -361,7 +362,7 @@ default APIResponse patch(String url) {
* @param params Optional request parameters.
* @since v1.16
*/
- APIResponse patch(String url, RequestOptions params);
+ APIResponse patch(String url, @Nullable RequestOptions params);
/**
* Sends HTTP(S) POST request and returns its
* response. The method will populate request cookies from the context and update context cookies from the response. The
@@ -456,7 +457,7 @@ default APIResponse post(String url) {
* @param params Optional request parameters.
* @since v1.16
*/
- APIResponse post(String url, RequestOptions params);
+ APIResponse post(String url, @Nullable RequestOptions params);
/**
* Sends HTTP(S) PUT request and returns its
* response. The method will populate request cookies from the context and update context cookies from the response. The
@@ -477,7 +478,7 @@ default APIResponse put(String url) {
* @param params Optional request parameters.
* @since v1.16
*/
- APIResponse put(String url, RequestOptions params);
+ APIResponse put(String url, @Nullable RequestOptions params);
/**
* Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to
* the constructor.
@@ -493,7 +494,7 @@ default String storageState() {
*
* @since v1.16
*/
- String storageState(StorageStateOptions options);
+ String storageState(@Nullable StorageStateOptions options);
/**
* Tracing recorder for requests made through this API request context.
*
diff --git a/playwright/src/main/java/com/microsoft/playwright/APIResponse.java b/playwright/src/main/java/com/microsoft/playwright/APIResponse.java
index c52f1d31e..e72069b6a 100644
--- a/playwright/src/main/java/com/microsoft/playwright/APIResponse.java
+++ b/playwright/src/main/java/com/microsoft/playwright/APIResponse.java
@@ -16,6 +16,7 @@
package com.microsoft.playwright;
+import org.jspecify.annotations.Nullable;
import com.microsoft.playwright.options.*;
import java.util.*;
@@ -61,14 +62,14 @@ public interface APIResponse {
*
* @since v1.61
*/
- SecurityDetails securityDetails();
+ @Nullable SecurityDetails securityDetails();
/**
* Returns the IP address and port of the server. Resolves to {@code null} if the server address is not available. For
* redirected requests, returns the information for the last request in the redirect chain.
*
* @since v1.61
*/
- ServerAddr serverAddr();
+ @Nullable ServerAddr serverAddr();
/**
* Contains the status code of the response (e.g., 200 for a success).
*
diff --git a/playwright/src/main/java/com/microsoft/playwright/Browser.java b/playwright/src/main/java/com/microsoft/playwright/Browser.java
index 06bd96f8a..6c7f1178a 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Browser.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Browser.java
@@ -16,6 +16,7 @@
package com.microsoft.playwright;
+import org.jspecify.annotations.Nullable;
import com.microsoft.playwright.options.*;
import java.nio.file.Path;
import java.util.*;
@@ -69,7 +70,7 @@ class CloseOptions {
/**
* The reason to be reported to the operations interrupted by the browser closure.
*/
- public String reason;
+ public @Nullable String reason;
/**
* The reason to be reported to the operations interrupted by the browser closure.
@@ -83,7 +84,7 @@ class NewContextOptions {
/**
* Whether to automatically download all the attachments. Defaults to {@code true} where all the downloads are accepted.
*/
- public Boolean acceptDownloads;
+ public @Nullable Boolean acceptDownloads;
/**
* When using {@link com.microsoft.playwright.Page#navigate Page.navigate()}, {@link com.microsoft.playwright.Page#route
* Page.route()}, {@link com.microsoft.playwright.Page#waitForURL Page.waitForURL()}, {@link
@@ -100,11 +101,11 @@ class NewContextOptions {
* {@code http://localhost:3000/bar.html}
*
*/
- public String baseURL;
+ public @Nullable String baseURL;
/**
* Toggles bypassing page's Content-Security-Policy. Defaults to {@code false}.
*/
- public Boolean bypassCSP;
+ public @Nullable Boolean bypassCSP;
/**
* TLS Client Authentication allows the server to request a client certificate and verify it.
*
@@ -122,7 +123,7 @@ class NewContextOptions {
* NOTE: When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
* replacing {@code localhost} with {@code local.playwright}.
*/
- public List Pass an array to use different credentials for different origins. The first entry that matches the request origin is
* used, and entries with no origin match any request.
*/
- public Object httpCredentials;
+ public @Nullable Object httpCredentials;
/**
* Whether to ignore HTTPS errors when sending network requests. Defaults to {@code false}.
*/
- public Boolean ignoreHTTPSErrors;
+ public @Nullable Boolean ignoreHTTPSErrors;
/**
* Whether the {@code meta viewport} tag is taken into account and touch events are enabled. isMobile is a part of device,
* so you don't actually need to set it manually. Defaults to {@code false} and is not supported in Firefox. Learn more
* about mobile emulation.
*/
- public Boolean isMobile;
+ public @Nullable Boolean isMobile;
/**
* Whether or not to enable JavaScript in the context. Defaults to {@code true}. Learn more about disabling JavaScript.
*/
- public Boolean javaScriptEnabled;
+ public @Nullable Boolean javaScriptEnabled;
/**
* Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value,
* {@code Accept-Language} request header value as well as number and date formatting rules. Defaults to the system default
* locale. Learn more about emulation in our emulation guide.
*/
- public String locale;
+ public @Nullable String locale;
/**
* Whether to emulate network being offline. Defaults to {@code false}. Learn more about network emulation.
*/
- public Boolean offline;
+ public @Nullable Boolean offline;
/**
* A list of permissions to grant to all pages in this context. See {@link
* com.microsoft.playwright.BrowserContext#grantPermissions BrowserContext.grantPermissions()} for more details. Defaults
* to none.
*/
- public List NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the
* operating system. It makes the execution of the tests non-deterministic.
*/
- public Optional NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the
* operating system. It makes the execution of the tests non-deterministic.
*/
- public NewContextOptions setViewportSize(ViewportSize viewportSize) {
+ public NewContextOptions setViewportSize(@Nullable ViewportSize viewportSize) {
this.viewportSize = Optional.ofNullable(viewportSize);
return this;
}
@@ -679,7 +680,7 @@ class NewPageOptions {
/**
* Whether to automatically download all the attachments. Defaults to {@code true} where all the downloads are accepted.
*/
- public Boolean acceptDownloads;
+ public @Nullable Boolean acceptDownloads;
/**
* When using {@link com.microsoft.playwright.Page#navigate Page.navigate()}, {@link com.microsoft.playwright.Page#route
* Page.route()}, {@link com.microsoft.playwright.Page#waitForURL Page.waitForURL()}, {@link
@@ -696,11 +697,11 @@ class NewPageOptions {
* {@code http://localhost:3000/bar.html}
*
*/
- public String baseURL;
+ public @Nullable String baseURL;
/**
* Toggles bypassing page's Content-Security-Policy. Defaults to {@code false}.
*/
- public Boolean bypassCSP;
+ public @Nullable Boolean bypassCSP;
/**
* TLS Client Authentication allows the server to request a client certificate and verify it.
*
@@ -718,7 +719,7 @@ class NewPageOptions {
* NOTE: When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
* replacing {@code localhost} with {@code local.playwright}.
*/
- public List Pass an array to use different credentials for different origins. The first entry that matches the request origin is
* used, and entries with no origin match any request.
*/
- public Object httpCredentials;
+ public @Nullable Object httpCredentials;
/**
* Whether to ignore HTTPS errors when sending network requests. Defaults to {@code false}.
*/
- public Boolean ignoreHTTPSErrors;
+ public @Nullable Boolean ignoreHTTPSErrors;
/**
* Whether the {@code meta viewport} tag is taken into account and touch events are enabled. isMobile is a part of device,
* so you don't actually need to set it manually. Defaults to {@code false} and is not supported in Firefox. Learn more
* about mobile emulation.
*/
- public Boolean isMobile;
+ public @Nullable Boolean isMobile;
/**
* Whether or not to enable JavaScript in the context. Defaults to {@code true}. Learn more about disabling JavaScript.
*/
- public Boolean javaScriptEnabled;
+ public @Nullable Boolean javaScriptEnabled;
/**
* Specify user locale, for example {@code en-GB}, {@code de-DE}, etc. Locale will affect {@code navigator.language} value,
* {@code Accept-Language} request header value as well as number and date formatting rules. Defaults to the system default
* locale. Learn more about emulation in our emulation guide.
*/
- public String locale;
+ public @Nullable String locale;
/**
* Whether to emulate network being offline. Defaults to {@code false}. Learn more about network emulation.
*/
- public Boolean offline;
+ public @Nullable Boolean offline;
/**
* A list of permissions to grant to all pages in this context. See {@link
* com.microsoft.playwright.BrowserContext#grantPermissions BrowserContext.grantPermissions()} for more details. Defaults
* to none.
*/
- public List NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the
* operating system. It makes the execution of the tests non-deterministic.
*/
- public Optional NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the
* operating system. It makes the execution of the tests non-deterministic.
*/
- public NewPageOptions setViewportSize(ViewportSize viewportSize) {
+ public NewPageOptions setViewportSize(@Nullable ViewportSize viewportSize) {
this.viewportSize = Optional.ofNullable(viewportSize);
return this;
}
@@ -1275,16 +1276,16 @@ class BindOptions {
/**
* Host to bind the web socket server to. When specified, a web socket server is created instead of a named pipe.
*/
- public String host;
+ public @Nullable String host;
/**
* Port to bind the web socket server to. When specified, a web socket server is created instead of a named pipe. Use
* {@code 0} to let the OS pick an available port.
*/
- public Integer port;
+ public @Nullable Integer port;
/**
* Working directory associated with this browser server.
*/
- public String workspaceDir;
+ public @Nullable String workspaceDir;
/**
* Host to bind the web socket server to. When specified, a web socket server is created instead of a named pipe.
@@ -1313,15 +1314,15 @@ class StartTracingOptions {
/**
* specify custom categories to use instead of default.
*/
- public List NOTE: OPFS is currently not supported in ephemeral WebKit contexts.
*/
- public Boolean opfs;
+ public @Nullable Boolean opfs;
/**
* The file path to save the storage state to. If {@code path} is a relative path, then it is resolved relative to current
* working directory. If no path is provided, storage state is still returned, but won't be saved to the disk.
*/
- public Path path;
+ public @Nullable Path path;
/**
* Set to {@code true} to include the context's virtual WebAuthn {@link com.microsoft.playwright.BrowserContext#credentials
@@ -539,7 +540,7 @@ class WaitForConditionOptions {
* BrowserContext.setDefaultTimeout()} or {@link com.microsoft.playwright.Page#setDefaultTimeout Page.setDefaultTimeout()}
* methods.
*/
- public Double timeout;
+ public @Nullable Double timeout;
/**
* Maximum time to wait for in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The
@@ -556,13 +557,13 @@ class WaitForConsoleMessageOptions {
/**
* Receives the {@code ConsoleMessage} object and resolves to truthy value when the waiting should resolve.
*/
- public Predicate Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.
*/
- public List You can also provide a path to a custom {@code policies.json}
* file via {@code PLAYWRIGHT_FIREFOX_POLICIES_JSON} environment variable.
*/
- public Map Additional arguments to pass to the browser instance. The list of Chromium flags can be found here.
*/
- public List NOTE: When using WebKit on macOS, accessing {@code localhost} will not pick up client certificates. You can make it work by
* replacing {@code localhost} with {@code local.playwright}.
*/
- public List You can also provide a path to a custom {@code policies.json}
* file via {@code PLAYWRIGHT_FIREFOX_POLICIES_JSON} environment variable.
*/
- public Map Pass an array to use different credentials for different origins. The first entry that matches the request origin is
* used, and entries with no origin match any request.
*/
- public Object httpCredentials;
+ public @Nullable Object httpCredentials;
/**
* If {@code true}, Playwright does not pass its own configurations args and only uses the ones from {@code args}.
* Dangerous option; use with care. Defaults to {@code false}.
*/
- public Boolean ignoreAllDefaultArgs;
+ public @Nullable Boolean ignoreAllDefaultArgs;
/**
* If {@code true}, Playwright does not pass its own configurations args and only uses the ones from {@code args}.
* Dangerous option; use with care.
*/
- public List NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the
* operating system. It makes the execution of the tests non-deterministic.
*/
- public Optional NOTE: The {@code null} value opts out from the default presets, makes viewport depend on the host window size defined by the
* operating system. It makes the execution of the tests non-deterministic.
*/
- public LaunchPersistentContextOptions setViewportSize(ViewportSize viewportSize) {
+ public LaunchPersistentContextOptions setViewportSize(@Nullable ViewportSize viewportSize) {
this.viewportSize = Optional.ofNullable(viewportSize);
return this;
}
@@ -1321,7 +1322,7 @@ default Browser connect(String endpoint) {
* @param endpoint A Playwright browser websocket endpoint to connect to. You obtain this endpoint via {@code BrowserServer.wsEndpoint}.
* @since v1.8
*/
- Browser connect(String endpoint, ConnectOptions options);
+ Browser connect(String endpoint, @Nullable ConnectOptions options);
/**
* This method attaches Playwright to an existing browser instance using the Chrome DevTools Protocol.
*
@@ -1377,7 +1378,7 @@ default Browser connectOverCDP(String endpointURL) {
* ws://127.0.0.1:9222/devtools/browser/387adf4c-243f-4051-a181-46798f4a46f4}.
* @since v1.9
*/
- Browser connectOverCDP(String endpointURL, ConnectOverCDPOptions options);
+ Browser connectOverCDP(String endpointURL, @Nullable ConnectOverCDPOptions options);
/**
* A path where Playwright expects to find a bundled browser executable.
*
@@ -1453,7 +1454,7 @@ default Browser launch() {
*
* @since v1.8
*/
- Browser launch(LaunchOptions options);
+ Browser launch(@Nullable LaunchOptions options);
/**
* Returns the persistent browser context instance.
*
@@ -1501,7 +1502,7 @@ default BrowserContext launchPersistentContext(Path userDataDir) {
* as your automation profile instead. See https://developer.chrome.com/blog/remote-debugging-port for details.
* @since v1.8
*/
- BrowserContext launchPersistentContext(Path userDataDir, LaunchPersistentContextOptions options);
+ BrowserContext launchPersistentContext(Path userDataDir, @Nullable LaunchPersistentContextOptions options);
/**
* Returns browser name. For example: {@code "chromium"}, {@code "webkit"} or {@code "firefox"}.
*
diff --git a/playwright/src/main/java/com/microsoft/playwright/CDPSession.java b/playwright/src/main/java/com/microsoft/playwright/CDPSession.java
index 1c137a4a2..7760ca63d 100644
--- a/playwright/src/main/java/com/microsoft/playwright/CDPSession.java
+++ b/playwright/src/main/java/com/microsoft/playwright/CDPSession.java
@@ -16,6 +16,7 @@
package com.microsoft.playwright;
+import org.jspecify.annotations.Nullable;
import java.util.function.Consumer;
import com.google.gson.JsonObject;
@@ -81,7 +82,7 @@ default JsonObject send(String method) {
* @param args Optional method parameters.
* @since v1.8
*/
- JsonObject send(String method, JsonObject args);
+ JsonObject send(String method, @Nullable JsonObject args);
/**
* Register an event handler for events with the specified event name. The given handler will be called for every event
* with the given name.
diff --git a/playwright/src/main/java/com/microsoft/playwright/Clock.java b/playwright/src/main/java/com/microsoft/playwright/Clock.java
index bab0a7f65..c70004e6c 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Clock.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Clock.java
@@ -16,6 +16,7 @@
package com.microsoft.playwright;
+import org.jspecify.annotations.Nullable;
import java.util.Date;
/**
@@ -30,7 +31,7 @@ class InstallOptions {
/**
* Time to initialize with, current system time by default.
*/
- public Object time;
+ public @Nullable Object time;
/**
* Time to initialize with, current system time by default.
@@ -129,7 +130,7 @@ default void install() {
*
* @since v1.45
*/
- void install(InstallOptions options);
+ void install(@Nullable InstallOptions options);
/**
* Advance the clock, firing all the time-related callbacks.
*
diff --git a/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java b/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java
index db548f8be..8d88ddd71 100644
--- a/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java
+++ b/playwright/src/main/java/com/microsoft/playwright/ConsoleMessage.java
@@ -16,6 +16,7 @@
package com.microsoft.playwright;
+import org.jspecify.annotations.Nullable;
import java.util.*;
/**
@@ -62,7 +63,7 @@ public interface ConsoleMessage {
*
* @since v1.34
*/
- Page page();
+ @Nullable Page page();
/**
* The text of the console message.
*
@@ -90,6 +91,6 @@ public interface ConsoleMessage {
*
* @since v1.57
*/
- Worker worker();
+ @Nullable Worker worker();
}
diff --git a/playwright/src/main/java/com/microsoft/playwright/Credentials.java b/playwright/src/main/java/com/microsoft/playwright/Credentials.java
index 5c3eb6d40..15d2cf098 100644
--- a/playwright/src/main/java/com/microsoft/playwright/Credentials.java
+++ b/playwright/src/main/java/com/microsoft/playwright/Credentials.java
@@ -16,6 +16,7 @@
package com.microsoft.playwright;
+import org.jspecify.annotations.Nullable;
import com.microsoft.playwright.options.*;
import java.util.*;
@@ -87,19 +88,19 @@ class CreateOptions {
/**
* Base64url-encoded credential id. Auto-generated if omitted.
*/
- public String id;
+ public @Nullable String id;
/**
* Base64url-encoded PKCS#8 (DER) private key. Auto-generated if omitted.
*/
- public String privateKey;
+ public @Nullable String privateKey;
/**
* Base64url-encoded SPKI (DER) public key. Auto-generated if omitted.
*/
- public String publicKey;
+ public @Nullable String publicKey;
/**
* Base64url-encoded user handle. Auto-generated if omitted.
*/
- public String userHandle;
+ public @Nullable String userHandle;
/**
* Base64url-encoded credential id. Auto-generated if omitted.
@@ -134,11 +135,11 @@ class GetOptions {
/**
* Only return the credential with this base64url-encoded id.
*/
- public String id;
+ public @Nullable String id;
/**
* Only return credentials for this relying party id.
*/
- public String rpId;
+ public @Nullable String rpId;
/**
* Only return the credential with this base64url-encoded id.
@@ -203,7 +204,7 @@ default VirtualCredential create(String rpId) {
* @param rpId Relying party id (typically the site's effective domain).
* @since v1.61
*/
- VirtualCredential create(String rpId, CreateOptions options);
+ VirtualCredential create(String rpId, @Nullable CreateOptions options);
/**
* Removes a credential from the authenticator by its id. Works for any credential currently held — both those seeded with
* {@link com.microsoft.playwright.Credentials#create Credentials.create()} and those the page registered itself by calling
@@ -238,6 +239,6 @@ default List Defaults to {@code "allow"} that leaves animations untouched.
*/
- public ScreenshotAnimations animations;
+ public @Nullable ScreenshotAnimations animations;
/**
* When set to {@code "hide"}, screenshot will hide text caret. When set to {@code "initial"}, text caret behavior will not
* be changed. Defaults to {@code "hide"}.
*/
- public ScreenshotCaret caret;
+ public @Nullable ScreenshotCaret caret;
/**
* Specify locators that should be masked when the screenshot is taken. Masked elements will be overlaid with a pink box
* {@code #FF00FF} (customized by {@code maskColor}) that completely covers its bounding box. The mask is also applied to
* invisible elements, see Matching only
* visible elements to disable that.
*/
- public List Defaults to {@code "device"}.
*/
- public ScreenshotScale scale;
+ public @Nullable ScreenshotScale scale;
/**
* Text of the stylesheet to apply while making the screenshot. This is where you can hide dynamic elements, make elements
* invisible or change their properties to help you creating repeatable screenshots. This stylesheet pierces the Shadow DOM
* and applies to the inner frames.
*/
- public String style;
+ public @Nullable String style;
/**
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
* BrowserContext.setDefaultTimeout()} or {@link com.microsoft.playwright.Page#setDefaultTimeout Page.setDefaultTimeout()}
* methods.
*/
- public Double timeout;
+ public @Nullable Double timeout;
/**
* Specify screenshot type, defaults to {@code png}.
*/
- public ScreenshotType type;
+ public @Nullable ScreenshotType type;
/**
* When set to {@code "disabled"}, stops CSS animations, CSS transitions and Web Animations. Animations get different
@@ -857,7 +858,7 @@ class ScrollIntoViewIfNeededOptions {
* BrowserContext.setDefaultTimeout()} or {@link com.microsoft.playwright.Page#setDefaultTimeout Page.setDefaultTimeout()}
* methods.
*/
- public Double timeout;
+ public @Nullable Double timeout;
/**
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
@@ -875,18 +876,18 @@ class SelectOptionOptions {
* Whether to bypass the actionability checks. Defaults to
* {@code false}.
*/
- public Boolean force;
+ public @Nullable Boolean force;
/**
* @deprecated This option has no effect.
*/
- public Boolean noWaitAfter;
+ public @Nullable Boolean noWaitAfter;
/**
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
* BrowserContext.setDefaultTimeout()} or {@link com.microsoft.playwright.Page#setDefaultTimeout Page.setDefaultTimeout()}
* methods.
*/
- public Double timeout;
+ public @Nullable Double timeout;
/**
* Whether to bypass the actionability checks. Defaults to
@@ -919,14 +920,14 @@ class SelectTextOptions {
* Whether to bypass the actionability checks. Defaults to
* {@code false}.
*/
- public Boolean force;
+ public @Nullable Boolean force;
/**
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
* BrowserContext.setDefaultTimeout()} or {@link com.microsoft.playwright.Page#setDefaultTimeout Page.setDefaultTimeout()}
* methods.
*/
- public Double timeout;
+ public @Nullable Double timeout;
/**
* Whether to bypass the actionability checks. Defaults to
@@ -952,36 +953,36 @@ class SetCheckedOptions {
* Whether to bypass the actionability checks. Defaults to
* {@code false}.
*/
- public Boolean force;
+ public @Nullable Boolean force;
/**
* @deprecated This option has no effect.
*/
- public Boolean noWaitAfter;
+ public @Nullable Boolean noWaitAfter;
/**
* A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the
* element.
*/
- public Position position;
+ public @Nullable Position position;
/**
* Controls whether Playwright scrolls the element into view before performing the action. Defaults to {@code "auto"},
* which scrolls the element into view when necessary, including scrolling nested scrollable containers. When set to {@code
* "none"}, Playwright does not scroll the element and the action fails if the element is not already in the viewport. This
* is useful to assert that an element is reachable by the user without additional scrolling.
*/
- public ScrollMode scroll;
+ public @Nullable ScrollMode scroll;
/**
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
* BrowserContext.setDefaultTimeout()} or {@link com.microsoft.playwright.Page#setDefaultTimeout Page.setDefaultTimeout()}
* methods.
*/
- public Double timeout;
+ public @Nullable Double timeout;
/**
* When set, this method only performs the actionability
* checks and skips the action. Defaults to {@code false}. Useful to wait until the element is ready for the action without
* performing it.
*/
- public Boolean trial;
+ public @Nullable Boolean trial;
/**
* Whether to bypass the actionability checks. Defaults to
@@ -1047,14 +1048,14 @@ class SetInputFilesOptions {
/**
* @deprecated This option has no effect.
*/
- public Boolean noWaitAfter;
+ public @Nullable Boolean noWaitAfter;
/**
* Maximum time in milliseconds. Defaults to {@code 30000} (30 seconds). Pass {@code 0} to disable timeout. The default
* value can be changed by using the {@link com.microsoft.playwright.BrowserContext#setDefaultTimeout
* BrowserContext.setDefaultTimeout()} or {@link com.microsoft.playwright.Page#setDefaultTimeout Page.setDefaultTimeout()}
* methods.
*/
- public Double timeout;
+ public @Nullable Double timeout;
/**
* @deprecated This option has no effect.
@@ -1079,42 +1080,42 @@ class TapOptions {
* Whether to bypass the actionability checks. Defaults to
* {@code false}.
*/
- public Boolean force;
+ public @Nullable Boolean force;
/**
* Modifier keys to press. Ensures that only these modifiers are pressed during the operation, and then restores current
* modifiers back. If not specified, currently pressed modifiers are used. "ControlOrMeta" resolves to "Control" on Windows
* and Linux and to "Meta" on macOS.
*/
- public List
@@ -256,35 +257,35 @@ class NewContextOptions {
*
*/
- public ServiceWorkerPolicy serviceWorkers;
+ public @Nullable ServiceWorkerPolicy serviceWorkers;
/**
* Populates context with given storage state. This option can be used to initialize context with logged-in information
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()}.
*/
- public String storageState;
+ public @Nullable String storageState;
/**
* Populates context with given storage state. This option can be used to initialize context with logged-in information
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()}. Path to the
* file with saved storage state.
*/
- public Path storageStatePath;
+ public @Nullable Path storageStatePath;
/**
* If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors
* that imply single target DOM element will throw when more than one element matches the selector. This option does not
* affect any Locator APIs (Locators are always strict). Defaults to {@code false}. See {@code Locator} to learn more about
* the strict mode.
*/
- public Boolean strictSelectors;
+ public @Nullable Boolean strictSelectors;
/**
* Changes the timezone of the context. See ICU's
* metaZones.txt for a list of supported timezone IDs. Defaults to the system timezone.
*/
- public String timezoneId;
+ public @Nullable String timezoneId;
/**
* Specific user agent to use in this context.
*/
- public String userAgent;
+ public @Nullable String userAgent;
/**
* Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent
* viewport emulation. Learn more about viewport
@@ -293,7 +294,7 @@ class NewContextOptions {
*
@@ -852,35 +853,35 @@ class NewPageOptions {
*
*/
- public ServiceWorkerPolicy serviceWorkers;
+ public @Nullable ServiceWorkerPolicy serviceWorkers;
/**
* Populates context with given storage state. This option can be used to initialize context with logged-in information
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()}.
*/
- public String storageState;
+ public @Nullable String storageState;
/**
* Populates context with given storage state. This option can be used to initialize context with logged-in information
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()}. Path to the
* file with saved storage state.
*/
- public Path storageStatePath;
+ public @Nullable Path storageStatePath;
/**
* If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors
* that imply single target DOM element will throw when more than one element matches the selector. This option does not
* affect any Locator APIs (Locators are always strict). Defaults to {@code false}. See {@code Locator} to learn more about
* the strict mode.
*/
- public Boolean strictSelectors;
+ public @Nullable Boolean strictSelectors;
/**
* Changes the timezone of the context. See ICU's
* metaZones.txt for a list of supported timezone IDs. Defaults to the system timezone.
*/
- public String timezoneId;
+ public @Nullable String timezoneId;
/**
* Specific user agent to use in this context.
*/
- public String userAgent;
+ public @Nullable String userAgent;
/**
* Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent
* viewport emulation. Learn more about viewport
@@ -889,7 +890,7 @@ class NewPageOptions {
*
@@ -469,13 +470,13 @@ class StorageStateOptions {
* com.microsoft.playwright.Credentials#install Credentials.install()}), and prevent all real authenticators from working
* in this context.
*/
- public Boolean credentials;
+ public @Nullable Boolean credentials;
/**
* Set to {@code true} to include IndexedDB in
* the storage state snapshot. If your application uses IndexedDB to store authentication tokens, like Firebase
* Authentication, enable this.
*/
- public Boolean indexedDB;
+ public @Nullable Boolean indexedDB;
/**
* Set to {@code true} to include the origin private file
@@ -483,12 +484,12 @@ class StorageStateOptions {
*
*
* @since v1.8
*/
- void grantPermissions(List
@@ -737,37 +738,37 @@ class LaunchPersistentContextOptions {
*
*/
- public ServiceWorkerPolicy serviceWorkers;
+ public @Nullable ServiceWorkerPolicy serviceWorkers;
/**
* Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on.
*/
- public Double slowMo;
+ public @Nullable Double slowMo;
/**
* If set to true, enables strict selectors mode for this context. In the strict selectors mode all operations on selectors
* that imply single target DOM element will throw when more than one element matches the selector. This option does not
* affect any Locator APIs (Locators are always strict). Defaults to {@code false}. See {@code Locator} to learn more about
* the strict mode.
*/
- public Boolean strictSelectors;
+ public @Nullable Boolean strictSelectors;
/**
* Maximum time in milliseconds to wait for the browser instance to start. Defaults to {@code 30000} (30 seconds). Pass
* {@code 0} to disable timeout.
*/
- public Double timeout;
+ public @Nullable Double timeout;
/**
* Changes the timezone of the context. See ICU's
* metaZones.txt for a list of supported timezone IDs. Defaults to the system timezone.
*/
- public String timezoneId;
+ public @Nullable String timezoneId;
/**
* If specified, traces are saved into this directory.
*/
- public Path tracesDir;
+ public @Nullable Path tracesDir;
/**
* Specific user agent to use in this context.
*/
- public String userAgent;
+ public @Nullable String userAgent;
/**
* Emulates consistent viewport for each page. Defaults to an 1280x720 viewport. Use {@code null} to disable the consistent
* viewport emulation. Learn more about viewport
@@ -776,7 +777,7 @@ class LaunchPersistentContextOptions {
*
@@ -1467,7 +1468,7 @@ default void check() {
*
* @since v1.8
*/
- void check(CheckOptions options);
+ void check(@Nullable CheckOptions options);
/**
* This method clicks the element by performing the following steps:
*
@@ -1507,13 +1508,13 @@ default void click() {
*
* @since v1.8
*/
- void click(ClickOptions options);
+ void click(@Nullable ClickOptions options);
/**
* Returns the content frame for element handles referencing iframe nodes, or {@code null} otherwise
*
* @since v1.8
*/
- Frame contentFrame();
+ @Nullable Frame contentFrame();
/**
* This method double clicks the element by performing the following steps:
*
@@ -1555,7 +1556,7 @@ default void dblclick() {
*
* @since v1.8
*/
- void dblclick(DblclickOptions options);
+ void dblclick(@Nullable DblclickOptions options);
/**
* The snippet below dispatches the {@code click} event on the element. Regardless of the visibility state of the element,
* {@code click} is dispatched. This is equivalent to calling actionability checks, focuses the
* element, fills it and triggers an {@code input} event after filling. Note that you can pass an empty string to clear the
@@ -1778,7 +1779,7 @@ default void fill(String value) {
* @param value Value to set for the {@code }, {@code