Skip to content

Commit d9fea34

Browse files
authored
feat: generate @SInCE tags for methods (#1145)
1 parent 45f81c0 commit d9fea34

37 files changed

+1303
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,16 @@ public NewContextOptions setUserAgent(String userAgent) {
176176
}
177177
/**
178178
* Creates new instances of {@code APIRequestContext}.
179+
*
180+
* @since v1.16
179181
*/
180182
default APIRequestContext newContext() {
181183
return newContext(null);
182184
}
183185
/**
184186
* Creates new instances of {@code APIRequestContext}.
187+
*
188+
* @since v1.16
185189
*/
186190
APIRequestContext newContext(NewContextOptions options);
187191
}

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public StorageStateOptions setPath(Path path) {
6363
* The method will automatically follow redirects.
6464
*
6565
* @param url Target URL.
66+
* @since v1.16
6667
*/
6768
default APIResponse delete(String url) {
6869
return delete(url, null);
@@ -74,12 +75,15 @@ default APIResponse delete(String url) {
7475
*
7576
* @param url Target URL.
7677
* @param params Optional request parameters.
78+
* @since v1.16
7779
*/
7880
APIResponse delete(String url, RequestOptions params);
7981
/**
8082
* All responses returned by {@link APIRequestContext#get APIRequestContext.get()} and similar methods are stored in the
8183
* memory, so that you can later call {@link APIResponse#body APIResponse.body()}. This method discards all stored
8284
* responses, and makes {@link APIResponse#body APIResponse.body()} throw "Response disposed" error.
85+
*
86+
* @since v1.16
8387
*/
8488
void dispose();
8589
/**
@@ -113,6 +117,7 @@ default APIResponse delete(String url) {
113117
* }</pre>
114118
*
115119
* @param urlOrRequest Target URL or Request to get all parameters from.
120+
* @since v1.16
116121
*/
117122
default APIResponse fetch(String urlOrRequest) {
118123
return fetch(urlOrRequest, null);
@@ -149,6 +154,7 @@ default APIResponse fetch(String urlOrRequest) {
149154
*
150155
* @param urlOrRequest Target URL or Request to get all parameters from.
151156
* @param params Optional request parameters.
157+
* @since v1.16
152158
*/
153159
APIResponse fetch(String urlOrRequest, RequestOptions params);
154160
/**
@@ -182,6 +188,7 @@ default APIResponse fetch(String urlOrRequest) {
182188
* }</pre>
183189
*
184190
* @param urlOrRequest Target URL or Request to get all parameters from.
191+
* @since v1.16
185192
*/
186193
default APIResponse fetch(Request urlOrRequest) {
187194
return fetch(urlOrRequest, null);
@@ -218,6 +225,7 @@ default APIResponse fetch(Request urlOrRequest) {
218225
*
219226
* @param urlOrRequest Target URL or Request to get all parameters from.
220227
* @param params Optional request parameters.
228+
* @since v1.16
221229
*/
222230
APIResponse fetch(Request urlOrRequest, RequestOptions params);
223231
/**
@@ -235,6 +243,7 @@ default APIResponse fetch(Request urlOrRequest) {
235243
* }</pre>
236244
*
237245
* @param url Target URL.
246+
* @since v1.16
238247
*/
239248
default APIResponse get(String url) {
240249
return get(url, null);
@@ -255,6 +264,7 @@ default APIResponse get(String url) {
255264
*
256265
* @param url Target URL.
257266
* @param params Optional request parameters.
267+
* @since v1.16
258268
*/
259269
APIResponse get(String url, RequestOptions params);
260270
/**
@@ -263,6 +273,7 @@ default APIResponse get(String url) {
263273
* method will automatically follow redirects.
264274
*
265275
* @param url Target URL.
276+
* @since v1.16
266277
*/
267278
default APIResponse head(String url) {
268279
return head(url, null);
@@ -274,6 +285,7 @@ default APIResponse head(String url) {
274285
*
275286
* @param url Target URL.
276287
* @param params Optional request parameters.
288+
* @since v1.16
277289
*/
278290
APIResponse head(String url, RequestOptions params);
279291
/**
@@ -282,6 +294,7 @@ default APIResponse head(String url) {
282294
* The method will automatically follow redirects.
283295
*
284296
* @param url Target URL.
297+
* @since v1.16
285298
*/
286299
default APIResponse patch(String url) {
287300
return patch(url, null);
@@ -293,6 +306,7 @@ default APIResponse patch(String url) {
293306
*
294307
* @param url Target URL.
295308
* @param params Optional request parameters.
309+
* @since v1.16
296310
*/
297311
APIResponse patch(String url, RequestOptions params);
298312
/**
@@ -337,6 +351,7 @@ default APIResponse patch(String url) {
337351
* }</pre>
338352
*
339353
* @param url Target URL.
354+
* @since v1.16
340355
*/
341356
default APIResponse post(String url) {
342357
return post(url, null);
@@ -384,6 +399,7 @@ default APIResponse post(String url) {
384399
*
385400
* @param url Target URL.
386401
* @param params Optional request parameters.
402+
* @since v1.16
387403
*/
388404
APIResponse post(String url, RequestOptions params);
389405
/**
@@ -392,6 +408,7 @@ default APIResponse post(String url) {
392408
* method will automatically follow redirects.
393409
*
394410
* @param url Target URL.
411+
* @since v1.16
395412
*/
396413
default APIResponse put(String url) {
397414
return put(url, null);
@@ -403,18 +420,23 @@ default APIResponse put(String url) {
403420
*
404421
* @param url Target URL.
405422
* @param params Optional request parameters.
423+
* @since v1.16
406424
*/
407425
APIResponse put(String url, RequestOptions params);
408426
/**
409427
* Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to
410428
* the constructor.
429+
*
430+
* @since v1.16
411431
*/
412432
default String storageState() {
413433
return storageState(null);
414434
}
415435
/**
416436
* Returns storage state for this request context, contains current cookies and local storage snapshot if it was passed to
417437
* the constructor.
438+
*
439+
* @since v1.16
418440
*/
419441
String storageState(StorageStateOptions options);
420442
}

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,39 +26,57 @@
2626
public interface APIResponse {
2727
/**
2828
* Returns the buffer with response body.
29+
*
30+
* @since v1.16
2931
*/
3032
byte[] body();
3133
/**
3234
* Disposes the body of this response. If not called then the body will stay in memory until the context closes.
35+
*
36+
* @since v1.16
3337
*/
3438
void dispose();
3539
/**
3640
* An object with all the response HTTP headers associated with this response.
41+
*
42+
* @since v1.16
3743
*/
3844
Map<String, String> headers();
3945
/**
4046
* An array with all the request HTTP headers associated with this response. Header names are not lower-cased. Headers with
4147
* multiple entries, such as {@code Set-Cookie}, appear in the array multiple times.
48+
*
49+
* @since v1.16
4250
*/
4351
List<HttpHeader> headersArray();
4452
/**
4553
* Contains a boolean stating whether the response was successful (status in the range 200-299) or not.
54+
*
55+
* @since v1.16
4656
*/
4757
boolean ok();
4858
/**
4959
* Contains the status code of the response (e.g., 200 for a success).
60+
*
61+
* @since v1.16
5062
*/
5163
int status();
5264
/**
5365
* Contains the status text of the response (e.g. usually an "OK" for a success).
66+
*
67+
* @since v1.16
5468
*/
5569
String statusText();
5670
/**
5771
* Returns the text representation of response body.
72+
*
73+
* @since v1.16
5874
*/
5975
String text();
6076
/**
6177
* Contains the URL of the response.
78+
*
79+
* @since v1.16
6280
*/
6381
String url();
6482
}

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,8 @@ public StartTracingOptions setScreenshots(boolean screenshots) {
10841084
}
10851085
/**
10861086
* Get the browser type (chromium, firefox or webkit) that the browser belongs to.
1087+
*
1088+
* @since v1.23
10871089
*/
10881090
BrowserType browserType();
10891091
/**
@@ -1098,6 +1100,8 @@ public StartTracingOptions setScreenshots(boolean screenshots) {
10981100
* Browser.newContext()} **before** calling {@link Browser#close Browser.close()}.
10991101
*
11001102
* <p> The {@code Browser} object itself is considered to be disposed and cannot be used anymore.
1103+
*
1104+
* @since v1.8
11011105
*/
11021106
void close();
11031107
/**
@@ -1110,10 +1114,14 @@ public StartTracingOptions setScreenshots(boolean screenshots) {
11101114
* BrowserContext context = browser.newContext();
11111115
* System.out.println(browser.contexts().size()); // prints "1"
11121116
* }</pre>
1117+
*
1118+
* @since v1.8
11131119
*/
11141120
List<BrowserContext> contexts();
11151121
/**
11161122
* Indicates that the browser is connected.
1123+
*
1124+
* @since v1.8
11171125
*/
11181126
boolean isConnected();
11191127
/**
@@ -1137,6 +1145,8 @@ public StartTracingOptions setScreenshots(boolean screenshots) {
11371145
* context.close();
11381146
* browser.close();
11391147
* }</pre>
1148+
*
1149+
* @since v1.8
11401150
*/
11411151
default BrowserContext newContext() {
11421152
return newContext(null);
@@ -1162,6 +1172,8 @@ default BrowserContext newContext() {
11621172
* context.close();
11631173
* browser.close();
11641174
* }</pre>
1175+
*
1176+
* @since v1.8
11651177
*/
11661178
BrowserContext newContext(NewContextOptions options);
11671179
/**
@@ -1170,6 +1182,8 @@ default BrowserContext newContext() {
11701182
* <p> This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and
11711183
* testing frameworks should explicitly create {@link Browser#newContext Browser.newContext()} followed by the {@link
11721184
* BrowserContext#newPage BrowserContext.newPage()} to control their exact life times.
1185+
*
1186+
* @since v1.8
11731187
*/
11741188
default Page newPage() {
11751189
return newPage(null);
@@ -1180,6 +1194,8 @@ default Page newPage() {
11801194
* <p> This is a convenience API that should only be used for the single-page scenarios and short snippets. Production code and
11811195
* testing frameworks should explicitly create {@link Browser#newContext Browser.newContext()} followed by the {@link
11821196
* BrowserContext#newPage BrowserContext.newPage()} to control their exact life times.
1197+
*
1198+
* @since v1.8
11831199
*/
11841200
Page newPage(NewPageOptions options);
11851201
/**
@@ -1200,6 +1216,7 @@ default Page newPage() {
12001216
* }</pre>
12011217
*
12021218
* @param page Optional, if specified, tracing includes screenshots of the given page.
1219+
* @since v1.11
12031220
*/
12041221
default void startTracing(Page page) {
12051222
startTracing(page, null);
@@ -1220,6 +1237,8 @@ default void startTracing(Page page) {
12201237
* page.goto('https://www.google.com');
12211238
* browser.stopTracing();
12221239
* }</pre>
1240+
*
1241+
* @since v1.11
12231242
*/
12241243
default void startTracing() {
12251244
startTracing(null);
@@ -1242,6 +1261,7 @@ default void startTracing() {
12421261
* }</pre>
12431262
*
12441263
* @param page Optional, if specified, tracing includes screenshots of the given page.
1264+
* @since v1.11
12451265
*/
12461266
void startTracing(Page page, StartTracingOptions options);
12471267
/**
@@ -1251,10 +1271,14 @@ default void startTracing() {
12511271
* href="https://playwright.dev/java/docs/api/class-tracing">here</a>.
12521272
*
12531273
* <p> Returns the buffer with trace data.
1274+
*
1275+
* @since v1.11
12541276
*/
12551277
byte[] stopTracing();
12561278
/**
12571279
* Returns the browser version.
1280+
*
1281+
* @since v1.8
12581282
*/
12591283
String version();
12601284
}

0 commit comments

Comments
 (0)