Skip to content

Commit 447056c

Browse files
committed
Merge pull request plotly#364 from plotly/improve-test-time
Improve test time
1 parent 0bfbf8f commit 447056c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/dash-core-components/test/IntegrationTests.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,12 @@ def setUp(self):
3939
pass
4040

4141
def tearDown(self):
42-
time.sleep(3)
4342
if platform.system() == 'Windows':
4443
requests.get('http://localhost:8050/stop')
4544
else:
4645
self.server_process.terminate()
4746
self.driver.back()
48-
time.sleep(3)
47+
time.sleep(1)
4948

5049
def startServer(self, app):
5150
"""
@@ -95,11 +94,10 @@ def _stop_server_windows():
9594
else:
9695
self.server_process = multiprocessing.Process(target=run)
9796
self.server_process.start()
98-
time.sleep(5)
97+
time.sleep(2)
9998

10099
# Visit the dash page
101100
self.driver.get('http://localhost:8050')
102-
self.driver.implicitly_wait(2)
103101

104102
# Inject an error and warning logger
105103
logger = '''

packages/dash-core-components/test/test_integration.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def render_content(tab):
442442

443443
selected_tab = self.wait_for_element_by_css_selector('#tab-1')
444444
selected_tab.click()
445-
time.sleep(2)
445+
time.sleep(1)
446446
self.wait_for_text_to_equal('#tabs-content', 'Test content 1')
447447

448448
def test_tabs_with_children_undefined(self):
@@ -531,6 +531,7 @@ def on_click(n_clicks):
531531
EC.visibility_of_element_located((By.CSS_SELECTOR, "#graph-one .main-svg"))
532532
)
533533

534+
time.sleep(1)
534535
self.snapshot("Tabs 1 rendered ")
535536

536537
button_two.click()
@@ -540,6 +541,7 @@ def on_click(n_clicks):
540541
EC.visibility_of_element_located((By.CSS_SELECTOR, "#graph-two .main-svg"))
541542
)
542543

544+
time.sleep(1)
543545
self.snapshot("Tabs 2 rendered ")
544546

545547
def test_tabs_without_value(self):
@@ -853,11 +855,11 @@ def update_graph(n_clicks):
853855
button = self.wait_for_element_by_css_selector('#button')
854856
self.snapshot('candlestick - initial')
855857
button.click()
856-
time.sleep(2)
858+
time.sleep(1)
857859
self.snapshot('candlestick - 1 click')
858860

859861
button.click()
860-
time.sleep(2)
862+
time.sleep(1)
861863
self.snapshot('candlestick - 2 click')
862864

863865
def test_graphs_with_different_figures(self):
@@ -1251,7 +1253,7 @@ def init_output(ts, data):
12511253
ts = int(time.time() * 1000)
12521254
time.sleep(1)
12531255
self.driver.refresh()
1254-
time.sleep(3)
1256+
time.sleep(2)
12551257
init = self.wait_for_element_by_css_selector('#init-output')
12561258
init = json.loads(init.text)
12571259
self.assertAlmostEqual(ts, init.get('ts'), delta=1000)
@@ -1297,10 +1299,10 @@ def on_ts(ts, data):
12971299
list_btn = self.wait_for_element_by_css_selector('#list-btn')
12981300

12991301
obj_btn.click()
1300-
time.sleep(3)
1302+
time.sleep(1)
13011303
self.wait_for_text_to_equal('#output', json.dumps(nested))
13021304
# it would of crashed the app before adding the recursive check.
13031305

13041306
list_btn.click()
1305-
time.sleep(3)
1307+
time.sleep(1)
13061308
self.wait_for_text_to_equal('#output', json.dumps(nested_list))

0 commit comments

Comments
 (0)