docs: auto generate evaluate usage docs (#34458)
This commit is contained in:
parent
04c03b998a
commit
039f513744
|
|
@ -864,31 +864,6 @@ If [`param: expression`] throws or rejects, this method throws.
|
||||||
|
|
||||||
**Usage**
|
**Usage**
|
||||||
|
|
||||||
```js
|
|
||||||
const tweets = page.locator('.tweet .retweets');
|
|
||||||
expect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets');
|
|
||||||
```
|
|
||||||
|
|
||||||
```java
|
|
||||||
Locator tweets = page.locator(".tweet .retweets");
|
|
||||||
assertEquals("10 retweets", tweets.evaluate("node => node.innerText"));
|
|
||||||
```
|
|
||||||
|
|
||||||
```python async
|
|
||||||
tweets = page.locator(".tweet .retweets")
|
|
||||||
assert await tweets.evaluate("node => node.innerText") == "10 retweets"
|
|
||||||
```
|
|
||||||
|
|
||||||
```python sync
|
|
||||||
tweets = page.locator(".tweet .retweets")
|
|
||||||
assert tweets.evaluate("node => node.innerText") == "10 retweets"
|
|
||||||
```
|
|
||||||
|
|
||||||
```csharp
|
|
||||||
var tweets = page.Locator(".tweet .retweets");
|
|
||||||
Assert.AreEqual("10 retweets", await tweets.EvaluateAsync("node => node.innerText"));
|
|
||||||
```
|
|
||||||
|
|
||||||
### param: Locator.evaluate.expression = %%-evaluate-expression-%%
|
### param: Locator.evaluate.expression = %%-evaluate-expression-%%
|
||||||
* since: v1.14
|
* since: v1.14
|
||||||
|
|
||||||
|
|
|
||||||
12
packages/playwright-core/types/types.d.ts
vendored
12
packages/playwright-core/types/types.d.ts
vendored
|
|
@ -12176,12 +12176,6 @@ export interface Locator {
|
||||||
* rejects, this method throws.
|
* rejects, this method throws.
|
||||||
*
|
*
|
||||||
* **Usage**
|
* **Usage**
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* const tweets = page.locator('.tweet .retweets');
|
|
||||||
* expect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets');
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param pageFunction Function to be evaluated in the page context.
|
* @param pageFunction Function to be evaluated in the page context.
|
||||||
* @param arg Optional argument to pass to
|
* @param arg Optional argument to pass to
|
||||||
* [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-option-expression).
|
* [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-option-expression).
|
||||||
|
|
@ -12207,12 +12201,6 @@ export interface Locator {
|
||||||
* rejects, this method throws.
|
* rejects, this method throws.
|
||||||
*
|
*
|
||||||
* **Usage**
|
* **Usage**
|
||||||
*
|
|
||||||
* ```js
|
|
||||||
* const tweets = page.locator('.tweet .retweets');
|
|
||||||
* expect(await tweets.evaluate(node => node.innerText)).toBe('10 retweets');
|
|
||||||
* ```
|
|
||||||
*
|
|
||||||
* @param pageFunction Function to be evaluated in the page context.
|
* @param pageFunction Function to be evaluated in the page context.
|
||||||
* @param arg Optional argument to pass to
|
* @param arg Optional argument to pass to
|
||||||
* [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-option-expression).
|
* [`pageFunction`](https://playwright.dev/docs/api/class-locator#locator-evaluate-option-expression).
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue