From e71ef7949b1cb4f1de21c7eed02c1eb870a5141a Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Mon, 1 Feb 2021 11:13:13 -0800 Subject: [PATCH] docs: add java traits to some methods (#5222) (#5243) --- docs/src/api/class-browsercontext.md | 2 +- docs/src/api/class-browsertype.md | 4 ++-- docs/src/api/class-cdpsession.md | 2 +- docs/src/api/class-download.md | 2 +- docs/src/api/class-frame.md | 2 ++ docs/src/api/class-page.md | 6 ++++-- docs/src/api/class-route.md | 1 + docs/src/api/class-selectors.md | 2 +- docs/src/api/class-websocket.md | 2 +- docs/src/api/params.md | 8 ++++---- utils/doclint/api_parser.js | 2 +- 11 files changed, 19 insertions(+), 14 deletions(-) diff --git a/docs/src/api/class-browsercontext.md b/docs/src/api/class-browsercontext.md index e599498ea0..08787c7484 100644 --- a/docs/src/api/class-browsercontext.md +++ b/docs/src/api/class-browsercontext.md @@ -736,7 +736,7 @@ A glob pattern, regex pattern or predicate receiving [URL] used to register a ro Optional handler function used to register a routing with [`method: BrowserContext.route`]. ## async method: BrowserContext.waitForEvent -* langs: +* langs: csharp, js, python - alias-python: expect_event - returns: <[any]> diff --git a/docs/src/api/class-browsertype.md b/docs/src/api/class-browsertype.md index 66cfeea97b..b782aa17db 100644 --- a/docs/src/api/class-browsertype.md +++ b/docs/src/api/class-browsertype.md @@ -182,13 +182,13 @@ Maximum time in milliseconds to wait for the browser instance to start. Defaults disable timeout. ### option: BrowserType.launch.env -* langs: csharp,java +* langs: csharp, java - `env` <[Object]<[string], [string]>> Specify environment variables that will be visible to the browser. Defaults to `process.env`. ### option: BrowserType.launch.env -* langs: js,python +* langs: js, python - `env` <[Object]<[string], [string]|[float]|[boolean]>> Specify environment variables that will be visible to the browser. Defaults to `process.env`. diff --git a/docs/src/api/class-cdpsession.md b/docs/src/api/class-cdpsession.md index 60e8eba815..cb06d2607b 100644 --- a/docs/src/api/class-cdpsession.md +++ b/docs/src/api/class-cdpsession.md @@ -1,5 +1,5 @@ # class: CDPSession -* langs: js,python +* langs: js, python * extends: [EventEmitter] The `CDPSession` instances are used to talk raw Chrome Devtools Protocol: diff --git a/docs/src/api/class-download.md b/docs/src/api/class-download.md index 984f769ff3..c7e45ac292 100644 --- a/docs/src/api/class-download.md +++ b/docs/src/api/class-download.md @@ -39,7 +39,7 @@ not performed and user has no access to the downloaded files. ::: ## async method: Download.createReadStream -* langs: js +* langs: java, js - returns: <[null]|[Readable]> Returns readable stream for current download or `null` if download failed. diff --git a/docs/src/api/class-frame.md b/docs/src/api/class-frame.md index bbcbf24658..a7ea739aec 100644 --- a/docs/src/api/class-frame.md +++ b/docs/src/api/class-frame.md @@ -594,6 +594,8 @@ Attribute name to get the value for. ### option: Frame.getAttribute.timeout = %%-input-timeout-%% ## async method: Frame.goto +* langs: + - alias-java: navigate - returns: <[null]|[Response]> Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the diff --git a/docs/src/api/class-page.md b/docs/src/api/class-page.md index 26ef9dbe3e..8020d8e06b 100644 --- a/docs/src/api/class-page.md +++ b/docs/src/api/class-page.md @@ -1261,7 +1261,7 @@ frame = page.frame(url=r".*domain.*") ``` ### param: Page.frame.frameSelector -* langs: js +* langs: java, js - `frameSelector` <[string]|[Object]> - `name` <[string]> Frame name specified in the `iframe`'s `name` attribute. Optional. - `url` <[string]|[RegExp]|[function]\([URL]\):[boolean]> A glob pattern, regex pattern or predicate receiving @@ -1313,6 +1313,8 @@ Navigate to the next page in history. ### option: Page.goForward.waitUntil = %%-navigation-wait-until-%% ## async method: Page.goto +* langs: + - alias-java: navigate - returns: <[null]|[Response]> Returns the main resource response. In case of multiple redirects, the navigation will resolve with the response of the @@ -2157,7 +2159,7 @@ Video object associated with this page. - `height` <[int]> page height in pixels. ## async method: Page.waitForEvent -* langs: +* langs: csharp, js, python - alias-python: expect_event - returns: <[any]> diff --git a/docs/src/api/class-route.md b/docs/src/api/class-route.md index a03442af88..38e7787b95 100644 --- a/docs/src/api/class-route.md +++ b/docs/src/api/class-route.md @@ -30,6 +30,7 @@ Optional error code. Defaults to `failed`, could be one of the following: ## async method: Route.continue * langs: + - alias-java: continue_ - alias-python: continue_ Continues route's request with optional overrides. diff --git a/docs/src/api/class-selectors.md b/docs/src/api/class-selectors.md index a9f7f1fff2..8a95522a9d 100644 --- a/docs/src/api/class-selectors.md +++ b/docs/src/api/class-selectors.md @@ -57,7 +57,7 @@ Name that is used in selectors as a prefix, e.g. `{name: 'foo'}` enables `foo=my contain `[a-zA-Z0-9_]` characters. ### param: Selectors.register.script -* langs: js +* langs: java, js - `script` <[function]|[string]|[Object]> - `path` <[path]> Path to the JavaScript file. If `path` is a relative path, then it is resolved relative to the current working directory. Optional. diff --git a/docs/src/api/class-websocket.md b/docs/src/api/class-websocket.md index e09a46d9b3..f19e7a8224 100644 --- a/docs/src/api/class-websocket.md +++ b/docs/src/api/class-websocket.md @@ -35,7 +35,7 @@ Indicates that the web socket has been closed. Contains the URL of the WebSocket. ## async method: WebSocket.waitForEvent -* langs: +* langs: csharp, js, python - alias-python: expect_event - returns: <[any]> diff --git a/docs/src/api/params.md b/docs/src/api/params.md index 99175c3ef3..c5abedd419 100644 --- a/docs/src/api/params.md +++ b/docs/src/api/params.md @@ -147,7 +147,7 @@ Whether to ignore HTTPS errors during navigation. Defaults to `false`. Toggles bypassing page's Content-Security-Policy. ## context-option-viewport -* langs: js +* langs: java, js - `viewport` <[null]|[Object]> - `width` <[int]> page width in pixels. - `height` <[int]> page height in pixels. @@ -292,7 +292,7 @@ Logger sink for Playwright logging. **DEPRECATED** Use [`option: recordVideo`] instead. ## context-option-recordhar -* langs: js +* langs: java, js - `recordHar` <[Object]> - `omitContent` <[boolean]> Optional setting to control whether to omit request content from the HAR. Defaults to `false`. @@ -315,7 +315,7 @@ Optional setting to control whether to omit request content from the HAR. Defaul Path on the filesystem to write the HAR file to. ## context-option-recordvideo -* langs: js +* langs: java, js - `recordVideo` <[Object]> - `dir` <[path]> Path to the directory to put videos into. - `size` <[Object]> Optional dimensions of the recorded videos. If not specified the size will be equal to `viewport`. @@ -356,7 +356,7 @@ option to work. If all contexts override the proxy, global proxy will be never u `launch({ proxy: { server: 'per-context' } })`. ## select-options-values -* langs: js +* langs: java, js - `values` <[null]|[string]|[ElementHandle]|[Array]<[string]>|[Object]|[Array]<[ElementHandle]>|[Array]<[Object]>> - `value` <[string]> Matches by `option.value`. Optional. - `label` <[string]> Matches by `option.label`. Optional. diff --git a/utils/doclint/api_parser.js b/utils/doclint/api_parser.js index 6effc1664a..f4521fbc66 100644 --- a/utils/doclint/api_parser.js +++ b/utils/doclint/api_parser.js @@ -315,7 +315,7 @@ function extractLangs(spec) { aliases[match[1].trim()] = match[2].trim(); } return { - only: only ? only.split(',') : undefined, + only: only ? only.split(',').map(l => l.trim()) : undefined, aliases, types: {}, overrides: {}