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 3
3
from dash_bootstrap_components import NavLink
4
4
from dash_core_components import Location
5
5
from dash_html_components import Div
6
+ from selenium .webdriver .support .wait import WebDriverWait
6
7
7
8
8
9
def test_dbnl001_auto_active (dash_duo ):
@@ -115,6 +116,12 @@ def set_active(pathname):
115
116
116
117
dash_duo .wait_for_element_by_id ("page-1-link" ).click ()
117
118
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
+
118
125
assert "active" in dash_duo .wait_for_element_by_id (
119
126
"page-1-link"
120
127
).get_attribute ("class" )
@@ -127,6 +134,12 @@ def set_active(pathname):
127
134
128
135
dash_duo .wait_for_element_by_id ("page-3-link" ).click ()
129
136
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
+
130
143
assert "active" not in dash_duo .wait_for_element_by_id (
131
144
"page-1-link"
132
145
).get_attribute ("class" )
You can’t perform that action at this time.
0 commit comments