chore: refactor JSHandle and ExecutionContext (#8773)

This commit is contained in:
jrandolf
2022-08-11 11:45:35 +02:00
committed by GitHub
parent ee2540baef
commit a238f5758d
24 changed files with 298 additions and 333 deletions

View File

@@ -4,7 +4,7 @@ sidebar_label: JSHandle.evaluate
# JSHandle.evaluate() method
This method passes this handle as the first argument to `pageFunction`. If `pageFunction` returns a Promise, then `handle.evaluate` would wait for the promise to resolve and return its value.
Evaluates the given function with the current handle as its first argument.
**Signature:**
@@ -32,10 +32,3 @@ class JSHandle {
**Returns:**
Promise<Awaited<ReturnType<Func>>>
## Example
```ts
const tweetHandle = await page.$('.tweet .retweets');
expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10');
```