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

Add more expressiveness to E2E helpers expectJson and waitForJson #1239

Open
nvie opened this issue Oct 18, 2023 · 0 comments
Open

Add more expressiveness to E2E helpers expectJson and waitForJson #1239

nvie opened this issue Oct 18, 2023 · 0 comments
Assignees

Comments

@nvie
Copy link
Collaborator

nvie commented Oct 18, 2023

Extend E2E expressiveness by allowing to pass a predicate function to expectJson and waitForJson. Imagine:

await expectJson(page, "#connectionId", (value) => value > connId);
await waitForJson(page, "#connectionId", (value) => value > connId);

Maybe also nice to allow these predicates to be async functions, so we can more easily write those conditions as expressions that compare multiple selectors on the same page:

await waitForJson(page, "#someId", async (value) => value > (await getJson(page, "#otherId")));

Originates from #1195 (comment).

@nvie nvie self-assigned this Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant