File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 33from dash_bootstrap_components import NavLink
44from dash_core_components import Location
55from dash_html_components import Div
6+ from selenium .webdriver .support .wait import WebDriverWait
67
78
89def test_dbnl001_auto_active (dash_duo ):
@@ -115,6 +116,12 @@ def set_active(pathname):
115116
116117 dash_duo .wait_for_element_by_id ("page-1-link" ).click ()
117118
119+ # wait for callback to update page
120+ WebDriverWait (dash_duo .driver , timeout = 10 ).until (
121+ lambda d : "active"
122+ in d .find_element_by_id ("page-1-link" ).get_attribute ("class" )
123+ )
124+
118125 assert "active" in dash_duo .wait_for_element_by_id (
119126 "page-1-link"
120127 ).get_attribute ("class" )
@@ -127,6 +134,12 @@ def set_active(pathname):
127134
128135 dash_duo .wait_for_element_by_id ("page-3-link" ).click ()
129136
137+ # wait for callback to update page
138+ WebDriverWait (dash_duo .driver , timeout = 10 ).until (
139+ lambda d : "active"
140+ not in d .find_element_by_id ("page-1-link" ).get_attribute ("class" )
141+ )
142+
130143 assert "active" not in dash_duo .wait_for_element_by_id (
131144 "page-1-link"
132145 ).get_attribute ("class" )
You can’t perform that action at this time.
0 commit comments