I need to wait for API request to finish, which is indicated by loading
class in one of the elements.
I can get the current class value with the following code:
page.locator("selector").first.evaluate("node => node.className")
I know I can write code that would call that every 0.1s to in order to wait for the change, but I was thinking that playwright has some better mechanisms to do that.
Is it possible to wait for class to have a certain value? Something like that:
page.locator("selector").first.wait_for_value("node => node.className", "desired_value")
Can it be done or do I need to write my own such functions?
Another possible solution is waiting for the final selector.
page.locator(".desiredClassName").wait_for()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With