Skip to content

Commit 393c91d

Browse files
Marc-Andre-Rivetchriddyp
authored andcommitted
Fix test regressions related to dcc.Graph changes (#1066)
1 parent 4b83c52 commit 393c91d

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

tests/integration/callbacks/test_layout_paths_with_callbacks.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ def update_label(value):
148148
dash_duo.start_server(app)
149149

150150
def check_chapter(chapter):
151+
dash_duo.wait_for_element(
152+
'#{}-graph:not(.dash-graph--pending)'.format(chapter)
153+
)
154+
151155
for key in dash_duo.redux_state_paths:
152156
assert dash_duo.find_elements(
153157
"#{}".format(key)
@@ -158,13 +162,17 @@ def check_chapter(chapter):
158162
if chapter == "chapter3"
159163
else chapters[chapter]["{}-controls".format(chapter)].value
160164
)
165+
161166
# check the actual values
162167
dash_duo.wait_for_text_to_equal("#{}-label".format(chapter), value)
168+
163169
wait.until(
164170
lambda: (
165171
dash_duo.driver.execute_script(
166172
"return document."
167-
'getElementById("{}-graph").'.format(chapter)
173+
'querySelector("#{}-graph:not(.dash-graph--pending) .js-plotly-plot").'.format(
174+
chapter
175+
)
168176
+ "layout.title.text"
169177
)
170178
== value

tests/integration/test_render.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -965,10 +965,10 @@ def render_content(tab):
965965

966966
self.startServer(app)
967967

968-
self.wait_for_element_by_css_selector('#graph1')
968+
self.wait_for_element_by_css_selector('#graph1:not(.dash-graph--pending)')
969969

970970
self.driver.find_elements_by_css_selector(
971-
'#graph1'
971+
'#graph1:not(.dash-graph--pending)'
972972
)[0].click()
973973

974974
graph_1_expected_clickdata = {
@@ -985,10 +985,10 @@ def render_content(tab):
985985
'#tab2'
986986
)[0].click()
987987

988-
self.wait_for_element_by_css_selector('#graph2')
988+
self.wait_for_element_by_css_selector('#graph2:not(.dash-graph--pending)')
989989

990990
self.driver.find_elements_by_css_selector(
991-
'#graph2'
991+
'#graph2:not(.dash-graph--pending)'
992992
)[0].click()
993993

994994
self.wait_for_text_to_equal('#graph2_info', json.dumps(graph_2_expected_clickdata))

tests/integration/test_scripts.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
def findSyncPlotlyJs(scripts):
3232
for script in scripts:
33-
if "dash_core_components/plotly-" in script.get_attribute('src'):
33+
if "dash_core_components/plotly" in script.get_attribute('src'):
3434
return script
3535

3636

0 commit comments

Comments
 (0)