Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): aliases for dotnet/chsarp docs. #5162

Merged
merged 9 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/src/api/class-browsertype.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ Maximum time in milliseconds to wait for the browser instance to start. Defaults
disable timeout.

### option: BrowserType.launch.env
* 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
- `env` <[Object]<[string], [string]|[float]|[boolean]>>

Specify environment variables that will be visible to the browser. Defaults to `process.env`.
Expand Down
44 changes: 28 additions & 16 deletions docs/src/api/class-elementhandle.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# class: ElementHandle
* extends: [JSHandle]

ElementHandle represents an in-page DOM element. ElementHandles can be created with the [`method: Page.$`] method.
ElementHandle represents an in-page DOM element. ElementHandles can be created with the [`method: Page.querySelector`] method.

```js
const { chromium } = require('playwright'); // Or 'firefox' or 'webkit'.
Expand Down Expand Up @@ -54,33 +54,36 @@ with sync_playwright() as playwright:
ElementHandle prevents DOM element from garbage collection unless the handle is disposed with
[`method: JSHandle.dispose`]. ElementHandles are auto-disposed when their origin frame gets navigated.

ElementHandle instances can be used as an argument in [`method: Page.$eval`] and [`method: Page.evaluate`] methods.
ElementHandle instances can be used as an argument in [`method: Page.evalOnSelector`] and [`method: Page.evaluate`] methods.

## async method: ElementHandle.$
## async method: ElementHandle.querySelector
* langs:
- alias-python: query_selector
- alias-js: $
- returns: <[null]|[ElementHandle]>

The method finds an element matching the specified selector in the `ElementHandle`'s subtree. See
[Working with selectors](./selectors.md) for more details. If no elements match the selector,
returns `null`.

### param: ElementHandle.$.selector = %%-query-selector-%%
### param: ElementHandle.querySelector.selector = %%-query-selector-%%

## async method: ElementHandle.$$
## async method: ElementHandle.querySelectorAll
* langs:
- alias-python: query_selector_all
- alias-js: $$
- returns: <[Array]<[ElementHandle]>>

The method finds all elements matching the specified selector in the `ElementHandle`s subtree. See
[Working with selectors](./selectors.md) for more details. If no elements match the selector,
returns empty array.

### param: ElementHandle.$$.selector = %%-query-selector-%%
### param: ElementHandle.querySelectorAll.selector = %%-query-selector-%%

## async method: ElementHandle.$eval
## async method: ElementHandle.evalOnSelector
* langs:
- alias-python: eval_on_selector
- alias-js: $eval
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Expand All @@ -89,7 +92,7 @@ The method finds an element matching the specified selector in the `ElementHandl
argument to [`param: pageFunction`]. See [Working with selectors](./selectors.md) for more
details. If no elements match the selector, the method throws an error.

If [`param: pageFunction`] returns a [Promise], then `frame.$eval` would wait for the promise to resolve and return its
If [`param: pageFunction`] returns a [Promise], then [`method: ElementHandle.evalOnSelector`] would wait for the promise to resolve and return its
value.

Examples:
Expand All @@ -112,18 +115,23 @@ assert tweet_handle.eval_on_selector(".like", "node => node.innerText") == "100"
assert tweet_handle.eval_on_selector(".retweets", "node => node.innerText") = "10"
```

### param: ElementHandle.$eval.selector = %%-query-selector-%%
### param: ElementHandle.evalOnSelector.selector = %%-query-selector-%%

### param: ElementHandle.$eval.expression = %%-evaluate-expression-%%
### param: ElementHandle.evalOnSelector.pageFunction
yury-s marked this conversation as resolved.
Show resolved Hide resolved
* langs: js
- `pageFunction` <[function]\([Element]\)>

### param: ElementHandle.$eval.arg
Function to be evaluated in browser context

### param: ElementHandle.evalOnSelector.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]

## async method: ElementHandle.$$eval
## async method: ElementHandle.evalOnSelectorAll
* langs:
- alias-python: eval_on_selector_all
- alias-js: $$eval
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Expand All @@ -132,7 +140,7 @@ The method finds all elements matching the specified selector in the `ElementHan
matched elements as a first argument to [`param: pageFunction`]. See
[Working with selectors](./selectors.md) for more details.

If [`param: pageFunction`] returns a [Promise], then `frame.$$eval` would wait for the promise to resolve and return its
If [`param: pageFunction`] returns a [Promise], then [`method: ElementHandle.evalOnSelectorAll`] would wait for the promise to resolve and return its
value.

Examples:
Expand All @@ -159,11 +167,15 @@ feed_handle = page.query_selector(".feed")
assert feed_handle.eval_on_selector_all(".tweet", "nodes => nodes.map(n => n.innerText)") == ["hello!", "hi!"]
```

### param: ElementHandle.$$eval.selector = %%-query-selector-%%
### param: ElementHandle.evalOnSelectorAll.selector = %%-query-selector-%%

### param: ElementHandle.evalOnSelectorAll.pageFunction
yury-s marked this conversation as resolved.
Show resolved Hide resolved
* langs: js
- `pageFunction` <[function]\([Array]<[Element]>\)>

### param: ElementHandle.$$eval.expression = %%-evaluate-expression-%%
Function to be evaluated in browser context

### param: ElementHandle.$$eval.arg
### param: ElementHandle.evalOnSelectorAll.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Expand Down
40 changes: 26 additions & 14 deletions docs/src/api/class-frame.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ with sync_playwright() as playwright:
run(playwright)
```

## async method: Frame.$
## async method: Frame.querySelector
* langs:
- alias-python: query_selector
- alias-js: $
- returns: <[null]|[ElementHandle]>

Returns the ElementHandle pointing to the frame element.
Expand All @@ -85,11 +86,12 @@ The method finds an element matching the specified selector within the frame. Se
[Working with selectors](./selectors.md) for more details. If no elements match the selector,
returns `null`.

### param: Frame.$.selector = %%-query-selector-%%
### param: Frame.querySelector.selector = %%-query-selector-%%

## async method: Frame.$$
## async method: Frame.querySelectorAll
* langs:
- alias-python: query_selector_all
- alias-js: $$
- returns: <[Array]<[ElementHandle]>>

Returns the ElementHandles pointing to the frame elements.
Expand All @@ -98,11 +100,12 @@ The method finds all elements matching the specified selector within the frame.
[Working with selectors](./selectors.md) for more details. If no elements match the selector,
returns empty array.

### param: Frame.$$.selector = %%-query-selector-%%
### param: Frame.querySelectorAll.selector = %%-query-selector-%%

## async method: Frame.$eval
## async method: Frame.evalOnSelector
* langs:
- alias-python: eval_on_selector
- alias-js: $eval
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Expand All @@ -111,7 +114,7 @@ The method finds an element matching the specified selector within the frame and
[`param: pageFunction`]. See [Working with selectors](./selectors.md) for more details. If no
elements match the selector, the method throws an error.

If [`param: pageFunction`] returns a [Promise], then `frame.$eval` would wait for the promise to resolve and return its
If [`param: pageFunction`] returns a [Promise], then [`method: Frame.evalOnSelector`] would wait for the promise to resolve and return its
value.

Examples:
Expand All @@ -134,18 +137,23 @@ preload_href = frame.eval_on_selector("link[rel=preload]", "el => el.href")
html = frame.eval_on_selector(".main-container", "(e, suffix) => e.outerHTML + suffix", "hello")
```

### param: Frame.$eval.selector = %%-query-selector-%%
### param: Frame.evalOnSelector.selector = %%-query-selector-%%

### param: Frame.$eval.expression = %%-evaluate-expression-%%
### param: Frame.evalOnSelector.pageFunction
* langs: js
- `pageFunction` <[function]\([Element]\)>

### param: Frame.$eval.arg
Function to be evaluated in browser context

### param: Frame.evalOnSelector.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]

## async method: Frame.$$eval
## async method: Frame.evalOnSelectorAll
* langs:
- alias-python: eval_on_selector_all
- alias-js: $$eval
- returns: <[Serializable]>

Returns the return value of [`param: pageFunction`]
Expand All @@ -154,7 +162,7 @@ The method finds all elements matching the specified selector within the frame a
as a first argument to [`param: pageFunction`]. See [Working with selectors](./selectors.md) for
more details.

If [`param: pageFunction`] returns a [Promise], then `frame.$$eval` would wait for the promise to resolve and return its
If [`param: pageFunction`] returns a [Promise], then [`method: Frame.evalOnSelectorAll`] would wait for the promise to resolve and return its
value.

Examples:
Expand All @@ -171,11 +179,15 @@ divs_counts = await frame.eval_on_selector_all("div", "(divs, min) => divs.lengt
divs_counts = frame.eval_on_selector_all("div", "(divs, min) => divs.length >= min", 10)
```

### param: Frame.$$eval.selector = %%-query-selector-%%
### param: Frame.evalOnSelectorAll.selector = %%-query-selector-%%

### param: Frame.evalOnSelectorAll.pageFunction
* langs: js
- `pageFunction` <[function]\([Array]<[Element]>\)>

### param: Frame.$$eval.expression = %%-evaluate-expression-%%
Function to be evaluated in browser context

### param: Frame.$$eval.arg
### param: Frame.evalOnSelectorAll.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/api/class-jshandle.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ JSHandle prevents the referenced JavaScript object being garbage collected unles
[`method: JSHandle.dispose`]. JSHandles are auto-disposed when their origin frame gets navigated or the parent context
gets destroyed.

JSHandle instances can be used as an argument in [`method: Page.$eval`], [`method: Page.evaluate`] and
JSHandle instances can be used as an argument in [`method: Page.evalOnSelector`], [`method: Page.evaluate`] and
[`method: Page.evaluateHandle`] methods.

## method: JSHandle.asElement
Expand Down
46 changes: 29 additions & 17 deletions docs/src/api/class-page.md
Original file line number Diff line number Diff line change
Expand Up @@ -309,40 +309,43 @@ Emitted when <[WebSocket]> request is sent.
Emitted when a dedicated [WebWorker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API) is spawned by the
page.

## async method: Page.$
## async method: Page.querySelector
* langs:
- alias-python: query_selector
- alias-js: $
- returns: <[null]|[ElementHandle]>

The method finds an element matching the specified selector within the page. If no elements match the selector, the
return value resolves to `null`.

Shortcut for main frame's [`method: Frame.$`].
Shortcut for main frame's [`method: Frame.querySelector`].

### param: Page.$.selector = %%-query-selector-%%
### param: Page.querySelector.selector = %%-query-selector-%%

## async method: Page.$$
## async method: Page.querySelectorAll
* langs:
- alias-python: query_selector_all
- alias-js: $$
- returns: <[Array]<[ElementHandle]>>

The method finds all elements matching the specified selector within the page. If no elements match the selector, the
return value resolves to `[]`.

Shortcut for main frame's [`method: Frame.$$`].
Shortcut for main frame's [`method: Frame.querySelectorAll`].

### param: Page.$$.selector = %%-query-selector-%%
### param: Page.querySelectorAll.selector = %%-query-selector-%%

## async method: Page.$eval
## async method: Page.evalOnSelector
* langs:
- alias-python: eval_on_selector
- alias-js: $eval
- returns: <[Serializable]>

The method finds an element matching the specified selector within the page and passes it as a first argument to
[`param: pageFunction`]. If no elements match the selector, the method throws an error. Returns the value of
[`param: pageFunction`].

If [`param: pageFunction`] returns a [Promise], then [`method: Page.$eval`] would wait for the promise to resolve and
If [`param: pageFunction`] returns a [Promise], then [`method: Page.evalOnSelector`] would wait for the promise to resolve and
return its value.

Examples:
Expand All @@ -365,26 +368,31 @@ preload_href = page.eval_on_selector("link[rel=preload]", "el => el.href")
html = page.eval_on_selector(".main-container", "(e, suffix) => e.outer_html + suffix", "hello")
```

Shortcut for main frame's [`method: Frame.$eval`].
Shortcut for main frame's [`method: Frame.evalOnSelector`].

### param: Page.$eval.selector = %%-query-selector-%%
### param: Page.evalOnSelector.selector = %%-query-selector-%%

### param: Page.$eval.expression = %%-evaluate-expression-%%
### param: Page.evalOnSelector.pageFunction
* langs: js
- `pageFunction` <[function]\([Element]\)>

Function to be evaluated in browser context

### param: Page.$eval.arg
### param: Page.evalOnSelector.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]

## async method: Page.$$eval
## async method: Page.evalOnSelectorAll
* langs:
- alias-python: eval_on_selector_all
- alias-js: $$eval
- returns: <[Serializable]>

The method finds all elements matching the specified selector within the page and passes an array of matched elements as
a first argument to [`param: pageFunction`]. Returns the result of [`param: pageFunction`] invocation.

If [`param: pageFunction`] returns a [Promise], then [`method: Page.$$eval`] would wait for the promise to resolve and
If [`param: pageFunction`] returns a [Promise], then [`method: Page.evalOnSelectorAll`] would wait for the promise to resolve and
return its value.

Examples:
Expand All @@ -401,11 +409,15 @@ div_counts = await page.eval_on_selector_all("div", "(divs, min) => divs.length
div_counts = page.eval_on_selector_all("div", "(divs, min) => divs.length >= min", 10)
```

### param: Page.$$eval.selector = %%-query-selector-%%
### param: Page.evalOnSelectorAll.selector = %%-query-selector-%%

### param: Page.evalOnSelectorAll.pageFunction
* langs: js
- `pageFunction` <[function]\([Array]<[Element]>\)>

### param: Page.$$eval.expression = %%-evaluate-expression-%%
Function to be evaluated in browser context

### param: Page.$$eval.arg
### param: Page.evalOnSelectorAll.arg
- `arg` <[EvaluationArgument]>

Optional argument to pass to [`param: pageFunction`]
Expand Down
12 changes: 6 additions & 6 deletions docs/src/api/javascript.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
### param: ElementHandle.$eval.expression = %%-js-evalonselector-pagefunction-%%
### param: ElementHandle.$$eval.expression = %%-js-evalonselectorall-pagefunction-%%
### param: Frame.$eval.expression = %%-js-evalonselector-pagefunction-%%
### param: Frame.$$eval.expression = %%-js-evalonselectorall-pagefunction-%%
### param: ElementHandle.evalOnSelector.expression = %%-js-evalonselector-pagefunction-%%
### param: ElementHandle.evalOnSelectorAll.expression = %%-js-evalonselectorall-pagefunction-%%
### param: Frame.evalOnSelector.expression = %%-js-evalonselector-pagefunction-%%
### param: Frame.evalOnSelectorAll.expression = %%-js-evalonselectorall-pagefunction-%%
### param: Frame.evaluate.expression = %%-js-evaluate-pagefunction-%%
### param: Frame.evaluateHandle.expression = %%-js-evaluate-pagefunction-%%
### param: Frame.waitForFunction.expression = %%-js-evaluate-pagefunction-%%
### param: JSHandle.evaluate.expression = %%-js-evaluate-pagefunction-%%
### param: JSHandle.evaluateHandle.expression = %%-js-evaluate-pagefunction-%%
### param: Page.$eval.expression = %%-js-evalonselector-pagefunction-%%
### param: Page.$$eval.expression = %%-js-evalonselectorall-pagefunction-%%
### param: Page.evalOnSelector.expression = %%-js-evalonselector-pagefunction-%%
### param: Page.evalOnSelectorAll.expression = %%-js-evalonselectorall-pagefunction-%%
### param: Page.evaluate.expression = %%-js-evaluate-pagefunction-%%
### param: Page.evaluateHandle.expression = %%-js-evaluate-pagefunction-%%
### param: Page.waitForFunction.expression = %%-js-evaluate-pagefunction-%%
Expand Down