You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.
I wrote some testing utils on top of selenium to do things like "wait for an element to appear". they're kind of hacky and sometimes they seem unreliable. So, sometimes we end up putting time.sleep in our tests instead of some proper wait for statement.
Turns out that selenium has its own "wait for" methods. We should replace our utils with these new methods and start using these methods in our new tests.
element_to_be_clickable is the most useful wait for elements you want to interact with after they appear.
The dash loading state covers the entire screen when a callback is requested, and there is a bit of lag time between when the DOM updates and when the loading state disappears. This makes it difficult to wait for and then click on things in succession since the loading state will steal the clicks after the wait is released, a time.sleep is still useful here, haven't tried anything more complicated than that.
Action chains are important for more complex interactions (e.g. opening a dropdown then clicking a sub-element of the dropdown), just clicking both in succession might not work.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I wrote some testing utils on top of selenium to do things like "wait for an element to appear". they're kind of hacky and sometimes they seem unreliable. So, sometimes we end up putting
time.sleep
in our tests instead of some proper wait for statement.Turns out that selenium has its own "wait for" methods. We should replace our utils with these new methods and start using these methods in our new tests.
Here is an example of the official selenium "wait" API:
https://github.com/plotly/dash-component-boilerplate/blob/1d2ee1d9fc1b6fa834fda3dc38064297f8154085/tests/test_render.py#L4-L23
cc @plotly/dash
The text was updated successfully, but these errors were encountered: