From bc4d2d80f966342faf0e6100938495a2e0a0b392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 6 Jan 2020 11:19:42 -0500 Subject: [PATCH 1/3] wait for graph not to be pending --- tests/integration/test_render.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_render.py b/tests/integration/test_render.py index 04e4bbc3c2..a230edf903 100644 --- a/tests/integration/test_render.py +++ b/tests/integration/test_render.py @@ -965,10 +965,10 @@ def render_content(tab): self.startServer(app) - self.wait_for_element_by_css_selector('#graph1') + self.wait_for_element_by_css_selector('#graph1:not(.dash-graph--pending)') self.driver.find_elements_by_css_selector( - '#graph1' + '#graph1:not(.dash-graph--pending)' )[0].click() graph_1_expected_clickdata = { @@ -985,10 +985,10 @@ def render_content(tab): '#tab2' )[0].click() - self.wait_for_element_by_css_selector('#graph2') + self.wait_for_element_by_css_selector('#graph2:not(.dash-graph--pending)') self.driver.find_elements_by_css_selector( - '#graph2' + '#graph2:not(.dash-graph--pending)' )[0].click() self.wait_for_text_to_equal('#graph2_info', json.dumps(graph_2_expected_clickdata)) From f4ed9e4e5d75717d75a2f7a0a1212dd6b99d8a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 6 Jan 2020 11:51:32 -0500 Subject: [PATCH 2/3] fix test with graph / pending --- .../callbacks/test_layout_paths_with_callbacks.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/integration/callbacks/test_layout_paths_with_callbacks.py b/tests/integration/callbacks/test_layout_paths_with_callbacks.py index 5f6d396f8b..3f4f5219fa 100644 --- a/tests/integration/callbacks/test_layout_paths_with_callbacks.py +++ b/tests/integration/callbacks/test_layout_paths_with_callbacks.py @@ -148,6 +148,10 @@ def update_label(value): dash_duo.start_server(app) def check_chapter(chapter): + dash_duo.wait_for_element( + '#{}-graph:not(.dash-graph--pending)'.format(chapter) + ) + for key in dash_duo.redux_state_paths: assert dash_duo.find_elements( "#{}".format(key) @@ -158,13 +162,17 @@ def check_chapter(chapter): if chapter == "chapter3" else chapters[chapter]["{}-controls".format(chapter)].value ) + # check the actual values dash_duo.wait_for_text_to_equal("#{}-label".format(chapter), value) + wait.until( lambda: ( dash_duo.driver.execute_script( "return document." - 'getElementById("{}-graph").'.format(chapter) + 'querySelector("#{}-graph:not(.dash-graph--pending) .js-plotly-plot").'.format( + chapter + ) + "layout.title.text" ) == value From 78924c9e44f2127a8541f38e60bafb89d55f38df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andre=CC=81=20Rivet?= Date: Mon, 6 Jan 2020 12:15:51 -0500 Subject: [PATCH 3/3] update sync plotlyjs resource --- tests/integration/test_scripts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_scripts.py b/tests/integration/test_scripts.py index 6f86afc1d4..3900ea6979 100644 --- a/tests/integration/test_scripts.py +++ b/tests/integration/test_scripts.py @@ -30,7 +30,7 @@ def findSyncPlotlyJs(scripts): for script in scripts: - if "dash_core_components/plotly-" in script.get_attribute('src'): + if "dash_core_components/plotly" in script.get_attribute('src'): return script