|
21 | 21 | MoveTargetOutOfBoundsException,
|
22 | 22 | )
|
23 | 23 |
|
24 |
| -from dash.testing.wait import text_to_equal, style_to_equal, contains_text, until |
| 24 | +from dash.testing.wait import ( |
| 25 | + text_to_equal, |
| 26 | + style_to_equal, |
| 27 | + class_to_equal, |
| 28 | + contains_text, |
| 29 | + until, |
| 30 | +) |
25 | 31 | from dash.testing.dash_page import DashPageMixin
|
26 | 32 | from dash.testing.errors import DashAppLoadingError, BrowserError, TestingTimeoutError
|
27 | 33 | from dash.testing.consts import SELENIUM_GRID_DEFAULT
|
@@ -301,6 +307,17 @@ def wait_for_element_by_id(self, element_id, timeout=None):
|
301 | 307 | f"timeout {timeout or self._wait_timeout}s => waiting for element id {element_id}",
|
302 | 308 | )
|
303 | 309 |
|
| 310 | + def wait_for_class_to_equal(self, selector, classname, timeout=None): |
| 311 | + """Explicit wait until the element's class has expected `value` timeout |
| 312 | + if not set, equals to the fixture's `wait_timeout` shortcut to |
| 313 | + `WebDriverWait` with customized `class_to_equal` condition.""" |
| 314 | + return self._wait_for( |
| 315 | + method=class_to_equal, |
| 316 | + args=(selector, classname), |
| 317 | + timeout=timeout, |
| 318 | + msg=f"classname => {classname} not found within {timeout or self._wait_timeout}s", |
| 319 | + ) |
| 320 | + |
304 | 321 | def wait_for_style_to_equal(self, selector, style, val, timeout=None):
|
305 | 322 | """Explicit wait until the element's style has expected `value` timeout
|
306 | 323 | if not set, equals to the fixture's `wait_timeout` shortcut to
|
|
0 commit comments