From fc07c9127678e4e99170996f43ace9e4f354547f Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Wed, 23 Mar 2022 16:49:11 -0700 Subject: [PATCH] chore: roll driver, mark 1.20.1 (#862) --- driver-bundle/pom.xml | 2 +- driver/pom.xml | 2 +- examples/pom.xml | 2 +- playwright/pom.xml | 2 +- .../com/microsoft/playwright/APIRequest.java | 6 +++--- .../playwright/APIRequestContext.java | 21 ++++++++++++++++--- .../java/com/microsoft/playwright/Page.java | 4 +++- pom.xml | 2 +- scripts/CLI_VERSION | 2 +- tools/api-generator/pom.xml | 2 +- tools/test-cli-version/pom.xml | 2 +- tools/test-local-installation/pom.xml | 2 +- tools/test-spring-boot-starter/pom.xml | 2 +- tools/update-docs-version/pom.xml | 2 +- 14 files changed, 35 insertions(+), 18 deletions(-) diff --git a/driver-bundle/pom.xml b/driver-bundle/pom.xml index a5238b012..99c147395 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 456aa5265..70d9f4249 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 615d8e49d..dfb07e3e6 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 99fff1c91..10d502a1f 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 c3a3243f5..43f8f19dc 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.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 d08b97abd..8dd88c089 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 @@ /** * 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 0e8590eef..20cf8af5d 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 @@ default Response reload() { */ 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 c6485d675..ecf9dff10 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 398935591..0044d6cb9 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 a20ea65dc..468e5e959 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 f86097479..758dfe06b 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 ec352d1cf..4476b7c0d 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 e70dfed93..494117a76 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 4e86550a1..4dfe1dd0b 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