Skip to content

Commit 1a8f5f7

Browse files
authored
docs: fix broken class links, format details and usage (#1536)
1 parent a917f2e commit 1a8f5f7

36 files changed

+2556
-2037
lines changed

playwright/src/main/java/com/microsoft/playwright/APIRequest.java

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
/**
2424
* Exposes API that can be used for the Web API testing. This class is used for creating {@code APIRequestContext} instance
2525
* which in turn can be used for sending web requests. An instance of this class can be obtained via {@link
26-
* Playwright#request Playwright.request()}. For more information see {@code APIRequestContext}.
26+
* com.microsoft.playwright.Playwright#request Playwright.request()}. For more information see {@code APIRequestContext}.
2727
*/
2828
public interface APIRequest {
2929
class NewContextOptions {
3030
/**
31-
* Methods like {@link APIRequestContext#get APIRequestContext.get()} take the base URL into consideration by using the <a
32-
* href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code URL()}</a> constructor for building the
33-
* corresponding URL. Examples:
31+
* Methods like {@link com.microsoft.playwright.APIRequestContext#get APIRequestContext.get()} take the base URL into
32+
* consideration by using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code URL()}</a>
33+
* constructor for building the corresponding URL. Examples:
3434
* <ul>
3535
* <li> baseURL: {@code http://localhost:3000} and sending request to {@code /bar.html} results in {@code
3636
* http://localhost:3000/bar.html}</li>
@@ -60,16 +60,17 @@ class NewContextOptions {
6060
public Proxy proxy;
6161
/**
6262
* Populates context with given storage state. This option can be used to initialize context with logged-in information
63-
* obtained via {@link BrowserContext#storageState BrowserContext.storageState()} or {@link APIRequestContext#storageState
64-
* APIRequestContext.storageState()}. Either a path to the file with saved storage, or the value returned by one of {@link
65-
* BrowserContext#storageState BrowserContext.storageState()} or {@link APIRequestContext#storageState
63+
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()} or {@link
64+
* com.microsoft.playwright.APIRequestContext#storageState APIRequestContext.storageState()}. Either a path to the file
65+
* with saved storage, or the value returned by one of {@link com.microsoft.playwright.BrowserContext#storageState
66+
* BrowserContext.storageState()} or {@link com.microsoft.playwright.APIRequestContext#storageState
6667
* APIRequestContext.storageState()} methods.
6768
*/
6869
public String storageState;
6970
/**
7071
* Populates context with given storage state. This option can be used to initialize context with logged-in information
71-
* obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved storage
72-
* state.
72+
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()}. Path to the
73+
* file with saved storage state.
7374
*/
7475
public Path storageStatePath;
7576
/**
@@ -83,9 +84,9 @@ class NewContextOptions {
8384
public String userAgent;
8485

8586
/**
86-
* Methods like {@link APIRequestContext#get APIRequestContext.get()} take the base URL into consideration by using the <a
87-
* href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code URL()}</a> constructor for building the
88-
* corresponding URL. Examples:
87+
* Methods like {@link com.microsoft.playwright.APIRequestContext#get APIRequestContext.get()} take the base URL into
88+
* consideration by using the <a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL">{@code URL()}</a>
89+
* constructor for building the corresponding URL. Examples:
8990
* <ul>
9091
* <li> baseURL: {@code http://localhost:3000} and sending request to {@code /bar.html} results in {@code
9192
* http://localhost:3000/bar.html}</li>
@@ -143,9 +144,10 @@ public NewContextOptions setProxy(Proxy proxy) {
143144
}
144145
/**
145146
* Populates context with given storage state. This option can be used to initialize context with logged-in information
146-
* obtained via {@link BrowserContext#storageState BrowserContext.storageState()} or {@link APIRequestContext#storageState
147-
* APIRequestContext.storageState()}. Either a path to the file with saved storage, or the value returned by one of {@link
148-
* BrowserContext#storageState BrowserContext.storageState()} or {@link APIRequestContext#storageState
147+
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()} or {@link
148+
* com.microsoft.playwright.APIRequestContext#storageState APIRequestContext.storageState()}. Either a path to the file
149+
* with saved storage, or the value returned by one of {@link com.microsoft.playwright.BrowserContext#storageState
150+
* BrowserContext.storageState()} or {@link com.microsoft.playwright.APIRequestContext#storageState
149151
* APIRequestContext.storageState()} methods.
150152
*/
151153
public NewContextOptions setStorageState(String storageState) {
@@ -154,8 +156,8 @@ public NewContextOptions setStorageState(String storageState) {
154156
}
155157
/**
156158
* Populates context with given storage state. This option can be used to initialize context with logged-in information
157-
* obtained via {@link BrowserContext#storageState BrowserContext.storageState()}. Path to the file with saved storage
158-
* state.
159+
* obtained via {@link com.microsoft.playwright.BrowserContext#storageState BrowserContext.storageState()}. Path to the
160+
* file with saved storage state.
159161
*/
160162
public NewContextOptions setStorageStatePath(Path storageStatePath) {
161163
this.storageStatePath = storageStatePath;

playwright/src/main/java/com/microsoft/playwright/APIRequestContext.java

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,23 @@
2424
* environment or the service to your e2e test.
2525
*
2626
* <p> Each Playwright browser context has associated with it {@code APIRequestContext} instance which shares cookie storage
27-
* with the browser context and can be accessed via {@link BrowserContext#request BrowserContext.request()} or {@link
28-
* Page#request Page.request()}. It is also possible to create a new APIRequestContext instance manually by calling {@link
29-
* APIRequest#newContext APIRequest.newContext()}.
27+
* with the browser context and can be accessed via {@link com.microsoft.playwright.BrowserContext#request
28+
* BrowserContext.request()} or {@link com.microsoft.playwright.Page#request Page.request()}. It is also possible to create
29+
* a new APIRequestContext instance manually by calling {@link com.microsoft.playwright.APIRequest#newContext
30+
* APIRequest.newContext()}.
3031
*
31-
* <p> **Cookie management**
32+
* <p> <strong>Cookie management</strong>
3233
*
33-
* <p> {@code APIRequestContext} returned by {@link BrowserContext#request BrowserContext.request()} and {@link Page#request
34-
* Page.request()} shares cookie storage with the corresponding {@code BrowserContext}. Each API request will have {@code
35-
* Cookie} header populated with the values from the browser context. If the API response contains {@code Set-Cookie}
36-
* header it will automatically update {@code BrowserContext} cookies and requests made from the page will pick them up.
37-
* This means that if you log in using this API, your e2e test will be logged in and vice versa.
34+
* <p> {@code APIRequestContext} returned by {@link com.microsoft.playwright.BrowserContext#request BrowserContext.request()}
35+
* and {@link com.microsoft.playwright.Page#request Page.request()} shares cookie storage with the corresponding {@code
36+
* BrowserContext}. Each API request will have {@code Cookie} header populated with the values from the browser context. If
37+
* the API response contains {@code Set-Cookie} header it will automatically update {@code BrowserContext} cookies and
38+
* requests made from the page will pick them up. This means that if you log in using this API, your e2e test will be
39+
* logged in and vice versa.
3840
*
3941
* <p> If you want API requests to not interfere with the browser cookies you should create a new {@code APIRequestContext} by
40-
* calling {@link APIRequest#newContext APIRequest.newContext()}. Such {@code APIRequestContext} object will have its own
41-
* isolated cookie storage.
42+
* calling {@link com.microsoft.playwright.APIRequest#newContext APIRequest.newContext()}. Such {@code APIRequestContext}
43+
* object will have its own isolated cookie storage.
4244
*/
4345
public interface APIRequestContext {
4446
class StorageStateOptions {
@@ -79,9 +81,10 @@ default APIResponse delete(String url) {
7981
*/
8082
APIResponse delete(String url, RequestOptions params);
8183
/**
82-
* All responses returned by {@link APIRequestContext#get APIRequestContext.get()} and similar methods are stored in the
83-
* memory, so that you can later call {@link APIResponse#body APIResponse.body()}.This method discards all its resources,
84-
* calling any method on disposed {@code APIRequestContext} will throw an exception.
84+
* All responses returned by {@link com.microsoft.playwright.APIRequestContext#get APIRequestContext.get()} and similar
85+
* methods are stored in the memory, so that you can later call {@link com.microsoft.playwright.APIResponse#body
86+
* APIResponse.body()}.This method discards all its resources, calling any method on disposed {@code APIRequestContext}
87+
* will throw an exception.
8588
*
8689
* @since v1.16
8790
*/
@@ -91,7 +94,7 @@ default APIResponse delete(String url) {
9194
* context cookies from the response. The method will automatically follow redirects. JSON objects can be passed directly
9295
* to the request.
9396
*
94-
* <p> **Usage**
97+
* <p> <strong>Usage</strong>
9598
* <pre>{@code
9699
* Map<String, Object> data = new HashMap();
97100
* data.put("title", "Book Title");
@@ -127,7 +130,7 @@ default APIResponse fetch(String urlOrRequest) {
127130
* context cookies from the response. The method will automatically follow redirects. JSON objects can be passed directly
128131
* to the request.
129132
*
130-
* <p> **Usage**
133+
* <p> <strong>Usage</strong>
131134
* <pre>{@code
132135
* Map<String, Object> data = new HashMap();
133136
* data.put("title", "Book Title");
@@ -162,7 +165,7 @@ default APIResponse fetch(String urlOrRequest) {
162165
* context cookies from the response. The method will automatically follow redirects. JSON objects can be passed directly
163166
* to the request.
164167
*
165-
* <p> **Usage**
168+
* <p> <strong>Usage</strong>
166169
* <pre>{@code
167170
* Map<String, Object> data = new HashMap();
168171
* data.put("title", "Book Title");
@@ -198,7 +201,7 @@ default APIResponse fetch(Request urlOrRequest) {
198201
* context cookies from the response. The method will automatically follow redirects. JSON objects can be passed directly
199202
* to the request.
200203
*
201-
* <p> **Usage**
204+
* <p> <strong>Usage</strong>
202205
* <pre>{@code
203206
* Map<String, Object> data = new HashMap();
204207
* data.put("title", "Book Title");
@@ -233,7 +236,7 @@ default APIResponse fetch(Request urlOrRequest) {
233236
* response. The method will populate request cookies from the context and update context cookies from the response. The
234237
* method will automatically follow redirects.
235238
*
236-
* <p> **Usage**
239+
* <p> <strong>Usage</strong>
237240
*
238241
* <p> Request parameters can be configured with {@code params} option, they will be serialized into the URL search parameters:
239242
* <pre>{@code
@@ -253,7 +256,7 @@ default APIResponse get(String url) {
253256
* response. The method will populate request cookies from the context and update context cookies from the response. The
254257
* method will automatically follow redirects.
255258
*
256-
* <p> **Usage**
259+
* <p> <strong>Usage</strong>
257260
*
258261
* <p> Request parameters can be configured with {@code params} option, they will be serialized into the URL search parameters:
259262
* <pre>{@code
@@ -314,7 +317,7 @@ default APIResponse patch(String url) {
314317
* response. The method will populate request cookies from the context and update context cookies from the response. The
315318
* method will automatically follow redirects.
316319
*
317-
* <p> **Usage**
320+
* <p> <strong>Usage</strong>
318321
*
319322
* <p> JSON objects can be passed directly to the request:
320323
* <pre>{@code
@@ -361,7 +364,7 @@ default APIResponse post(String url) {
361364
* response. The method will populate request cookies from the context and update context cookies from the response. The
362365
* method will automatically follow redirects.
363366
*
364-
* <p> **Usage**
367+
* <p> <strong>Usage</strong>
365368
*
366369
* <p> JSON objects can be passed directly to the request:
367370
* <pre>{@code

playwright/src/main/java/com/microsoft/playwright/APIResponse.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import java.util.*;
2121

2222
/**
23-
* {@code APIResponse} class represents responses returned by {@link APIRequestContext#get APIRequestContext.get()} and
24-
* similar methods.
23+
* {@code APIResponse} class represents responses returned by {@link com.microsoft.playwright.APIRequestContext#get
24+
* APIRequestContext.get()} and similar methods.
2525
*/
2626
public interface APIResponse {
2727
/**

0 commit comments

Comments
 (0)