diff --git a/driver-bundle/pom.xml b/driver-bundle/pom.xml index a5238b01..99c14739 100644 --- a/driver-bundle/pom.xml +++ b/driver-bundle/pom.xml @@ -6,7 +6,7 @@ com.microsoft.playwright parent-pom - 1.20.0 + 1.20.1 driver-bundle diff --git a/driver/pom.xml b/driver/pom.xml index 456aa526..70d9f424 100644 --- a/driver/pom.xml +++ b/driver/pom.xml @@ -6,7 +6,7 @@ com.microsoft.playwright parent-pom - 1.20.0 + 1.20.1 driver diff --git a/examples/pom.xml b/examples/pom.xml index 615d8e49..dfb07e3e 100644 --- a/examples/pom.xml +++ b/examples/pom.xml @@ -6,7 +6,7 @@ org.example examples - 1.20.0 + 1.20.1 Playwright Client Examples UTF-8 diff --git a/playwright/pom.xml b/playwright/pom.xml index 99fff1c9..10d502a1 100644 --- a/playwright/pom.xml +++ b/playwright/pom.xml @@ -7,7 +7,7 @@ com.microsoft.playwright parent-pom - 1.20.0 + 1.20.1 playwright diff --git a/playwright/src/main/java/com/microsoft/playwright/APIRequest.java b/playwright/src/main/java/com/microsoft/playwright/APIRequest.java index c3a3243f..43f8f19d 100644 --- a/playwright/src/main/java/com/microsoft/playwright/APIRequest.java +++ b/playwright/src/main/java/com/microsoft/playwright/APIRequest.java @@ -21,9 +21,9 @@ import java.nio.file.Path; import java.util.*; /** - * Exposes API that can be used for the Web API testing. Each Playwright browser context has a APIRequestContext instance - * attached which shares cookies with the page context. Its also possible to create a new APIRequestContext instance - * manually. For more information see here. + * Exposes API that can be used for the Web API testing. This class is used for creating {@code APIRequestContext} instance which + * in turn can be used for sending web requests. An instance of this class can be obtained via {@link Playwright#request + * Playwright.request()}. For more information see {@code APIRequestContext}. */ public interface APIRequest { class NewContextOptions { diff --git a/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java b/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java index d08b97ab..8dd88c08 100644 --- a/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java +++ b/playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java @@ -21,9 +21,24 @@ import java.nio.file.Path; /** * This API is used for the Web API testing. You can use it to trigger API endpoints, configure micro-services, prepare - * environment or the service to your e2e test. When used on {@code Page} or a {@code BrowserContext}, this API will automatically use - * the cookies from the corresponding {@code BrowserContext}. This means that if you log in using this API, your e2e test will be - * logged in and vice versa. + * environment or the service to your e2e test. + * + *

Each Playwright browser context has associated with it {@code APIRequestContext} instance which shares cookie storage with the + * browser context and can be accessed via {@link BrowserContext#request BrowserContext.request()} or {@link Page#request + * Page.request()}. It is also possible to create a new APIRequestContext instance manually by calling {@link + * APIRequest#newContext APIRequest.newContext()}. + * + *

**Cookie management** + * + *

{@code APIRequestContext} retuned by {@link BrowserContext#request BrowserContext.request()} and {@link Page#request + * Page.request()} shares cookie storage with the corresponding {@code BrowserContext}. Each API request will have {@code Cookie} + * header populated with the values from the browser context. If the API response contains {@code Set-Cookie} header it will + * automatically update {@code BrowserContext} cookies and requests made from the page will pick them up. This means that if you + * log in using this API, your e2e test will be logged in and vice versa. + * + *

If you want API requests to not interfere with the browser cookies you shoud create a new {@code APIRequestContext} by calling + * {@link APIRequest#newContext APIRequest.newContext()}. Such {@code APIRequestContext} object will have its own isolated cookie + * storage. */ public interface APIRequestContext { class StorageStateOptions { diff --git a/playwright/src/main/java/com/microsoft/playwright/Page.java b/playwright/src/main/java/com/microsoft/playwright/Page.java index 0e8590ee..20cf8af5 100644 --- a/playwright/src/main/java/com/microsoft/playwright/Page.java +++ b/playwright/src/main/java/com/microsoft/playwright/Page.java @@ -4684,7 +4684,9 @@ public interface Page extends AutoCloseable { */ Response reload(ReloadOptions options); /** - * API testing helper associated with this page. Requests made with this API will use page cookies. + * API testing helper associated with this page. This method returns the same instance as {@link BrowserContext#request + * BrowserContext.request()} on the page's context. See {@link BrowserContext#request BrowserContext.request()} for more + * details. */ APIRequestContext request(); /** diff --git a/pom.xml b/pom.xml index c6485d67..ecf9dff1 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.microsoft.playwright parent-pom - 1.20.0 + 1.20.1 pom Playwright Parent Project Java library to automate Chromium, Firefox and WebKit with a single API. diff --git a/scripts/CLI_VERSION b/scripts/CLI_VERSION index 39893559..0044d6cb 100644 --- a/scripts/CLI_VERSION +++ b/scripts/CLI_VERSION @@ -1 +1 @@ -1.20.0 +1.20.1 diff --git a/tools/api-generator/pom.xml b/tools/api-generator/pom.xml index a20ea65d..468e5e95 100644 --- a/tools/api-generator/pom.xml +++ b/tools/api-generator/pom.xml @@ -6,7 +6,7 @@ com.microsoft.playwright api-generator - 1.20.0 + 1.20.1 Playwright - API Generator This is an internal module used to generate Java API from the upstream Playwright diff --git a/tools/test-cli-version/pom.xml b/tools/test-cli-version/pom.xml index f8609747..758dfe06 100644 --- a/tools/test-cli-version/pom.xml +++ b/tools/test-cli-version/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.microsoft.playwright test-cli-version - 1.20.0 + 1.20.1 Test Playwright Command Line Version 1.8 diff --git a/tools/test-local-installation/pom.xml b/tools/test-local-installation/pom.xml index ec352d1c..4476b7c0 100644 --- a/tools/test-local-installation/pom.xml +++ b/tools/test-local-installation/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.microsoft.playwright test-local-installation - 1.20.0 + 1.20.1 Test local installation Runs Playwright test suite (copied from playwright module) against locally cached Playwright diff --git a/tools/test-spring-boot-starter/pom.xml b/tools/test-spring-boot-starter/pom.xml index e70dfed9..494117a7 100644 --- a/tools/test-spring-boot-starter/pom.xml +++ b/tools/test-spring-boot-starter/pom.xml @@ -9,7 +9,7 @@ com.microsoft.playwright test-spring-boot-starter - 1.20.0 + 1.20.1 Test Playwright With Spring Boot 2.4.3 diff --git a/tools/update-docs-version/pom.xml b/tools/update-docs-version/pom.xml index 4e86550a..4dfe1dd0 100644 --- a/tools/update-docs-version/pom.xml +++ b/tools/update-docs-version/pom.xml @@ -6,7 +6,7 @@ com.microsoft.playwright update-version - 1.20.0 + 1.20.1 Playwright - Update Version in Documentation This is an internal module used to update versions in the documentation based on