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

[Question]: Implement expect_selector context manager #1638

Open
kblok opened this issue Nov 9, 2022 · 1 comment
Open

[Question]: Implement expect_selector context manager #1638

kblok opened this issue Nov 9, 2022 · 1 comment

Comments

@kblok
Copy link

kblok commented Nov 9, 2022

Your question

I was taking a look at this question on Stack Overflow.
The issue there is that the user wants to test the loading action after clicking a button, but by the time it tries to assert, the loading element is gone.
This is their example:

button.click() # this triggers the API fetch
expect(page.locator("[id=loading-banner]")).to_be_visible()

I was wondering whether that might be solved with something like this:

with page.expect_selector("[id=loading-banner]"):
    button.click()

Note: You know I'm not quite proficient in python. I'm just building a bridge to that question :)

@HermanBide
Copy link

has this issue been resolved yet ? if no can i contribute to it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants