docs: waitForResponse method predicate example #37801
infra.yml
on: pull_request
docs & lint
3m 38s
Lint snippets
1m 1s
Annotations
1 error and 2 warnings
Lint snippets
Process completed with exit code 1.
|
Lint snippets
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/setup-python@v4, actions/setup-dotnet@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
|
js linting error:
docs/src/api/class-page.md#L1
Error: This line has a length of 112. Maximum allowed is 100.
6 | // Alternative way with a predicate. Note no await.
7 | const responsePromise = page.waitForResponse(response =>
> 8 | response.url() === 'https://example.com' && response.status() === 200 && response.request().method() === 'GET'
| ^
9 | );
10 | await page.getByText('trigger response').click();
11 | const response = await responsePromise;
Unable to lint:
// Start waiting for response before clicking. Note no await.
const responsePromise = page.waitForResponse('https://example.com/resource');
await page.getByText('trigger response').click();
const response = await responsePromise;
// Alternative way with a predicate. Note no await.
const responsePromise = page.waitForResponse(response =>
response.url() === 'https://example.com' && response.status() === 200 && response.request().method() === 'GET'
);
await page.getByText('trigger response').click();
const response = await responsePromise;
|