Open
Description
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 :)