Skip to content
New issue

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

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

Already on GitHub? # to your account

Docs: Replace sync check usage with async check #1725

Closed
2 tasks done
Tracked by #125
andrewslotin opened this issue Sep 18, 2024 · 1 comment · Fixed by #1746
Closed
2 tasks done
Tracked by #125

Docs: Replace sync check usage with async check #1725

andrewslotin opened this issue Sep 18, 2024 · 1 comment · Fixed by #1746
Assignees
Labels
Area: browser The browser module

Comments

@andrewslotin
Copy link
Contributor

andrewslotin commented Sep 18, 2024

Change all, from:

const headerText = await page.locator('h2').textContent();
check(headerText, {
  'header': headerText === 'Welcome, admin!'
});

To:

import { check } from 'https://jslib.k6.io/k6-utils/1.5.0/index.js';

// ...

check(page.locator('h2'), {
  'header': async lo => await lo.textContent() === 'Welcome, admin!'
});

Tasks

Preview Give feedback
  1. Area: browser
    inancgumus
  2. ci documentation
    inancgumus
@andrewslotin andrewslotin changed the title k6-docs: Add documentation Add documentation for the async-compatible check() Sep 18, 2024
@andrewslotin andrewslotin transferred this issue from grafana/jslib.k6.io Sep 18, 2024
@inancgumus inancgumus changed the title Add documentation for the async-compatible check() Docs: Replace sync check usage with async check Sep 19, 2024
@inancgumus inancgumus self-assigned this Sep 25, 2024
@inancgumus inancgumus added the Area: browser The browser module label Sep 25, 2024
@inancgumus
Copy link
Member

inancgumus commented Sep 27, 2024

We'll also update the xk6-browser examples/.

Done: grafana/xk6-browser#1448

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Area: browser The browser module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants