Skip to content

Commit 4ac2669

Browse files
committed
increase wildcards test timeouts
1 parent 4ed6d47 commit 4ac2669

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

test/integration/callbacks/test_wildcards.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def css_escape(s):
1818
@pytest.mark.parametrize("content_callback", (False, True))
1919
def test_jlcbwc001_todo_app(content_callback, dashjl):
2020
jl_file = "jlcbwc001_todo_app_true.jl" if content_callback else "jlcbwc001_todo_app_false.jl"
21-
fp = jl_test_file_path(jl_file)
21+
fp = jl_test_file_path(jl_file)
2222
dashjl.start_server(fp)
2323
dashjl.wait_for_text_to_equal("#totals", "0 of 0 items completed", timeout = 10)
2424

@@ -34,7 +34,7 @@ def get_done_item(item):
3434
return dashjl.find_element(selector)
3535

3636
def assert_item(item, text, done, prefix="", suffix=""):
37-
dashjl.wait_for_text_to_equal(css_escape('#{"item":%d}' % item), text, timeout=4)
37+
dashjl.wait_for_text_to_equal(css_escape('#{"item":%d}' % item), text, timeout=10)
3838

3939
expected_note = "" if done else (prefix + " preceding items are done" + suffix)
4040
dashjl.wait_for_text_to_equal(
@@ -45,143 +45,143 @@ def assert_item(item, text, done, prefix="", suffix=""):
4545

4646
new_item.send_keys("apples")
4747
add_item.click()
48-
dashjl.wait_for_text_to_equal("#totals", "0 of 1 items completed - 0%")
48+
dashjl.wait_for_text_to_equal("#totals", "0 of 1 items completed - 0%", timeout = 10)
4949
assert_count(1)
5050

5151
new_item.send_keys("bananas")
5252
add_item.click()
53-
dashjl.wait_for_text_to_equal("#totals", "0 of 2 items completed - 0%")
53+
dashjl.wait_for_text_to_equal("#totals", "0 of 2 items completed - 0%", timeout = 10)
5454
assert_count(2)
5555

5656
new_item.send_keys("carrots")
5757
add_item.click()
58-
dashjl.wait_for_text_to_equal("#totals", "0 of 3 items completed - 0%")
58+
dashjl.wait_for_text_to_equal("#totals", "0 of 3 items completed - 0%", timeout = 10)
5959
assert_count(3)
6060

6161
new_item.send_keys("dates")
6262
add_item.click()
63-
dashjl.wait_for_text_to_equal("#totals", "0 of 4 items completed - 0%")
63+
dashjl.wait_for_text_to_equal("#totals", "0 of 4 items completed - 0%", timeout = 10)
6464
assert_count(4)
6565
assert_item(1, "apples", False, "0 of 0", " DO THIS NEXT!")
6666
assert_item(2, "bananas", False, "0 of 1")
6767
assert_item(3, "carrots", False, "0 of 2")
6868
assert_item(4, "dates", False, "0 of 3")
6969

7070
get_done_item(3).click()
71-
dashjl.wait_for_text_to_equal("#totals", "1 of 4 items completed - 25%")
71+
dashjl.wait_for_text_to_equal("#totals", "1 of 4 items completed - 25%", timeout = 10)
7272
assert_item(1, "apples", False, "0 of 0", " DO THIS NEXT!")
7373
assert_item(2, "bananas", False, "0 of 1")
7474
assert_item(3, "carrots", True)
7575
assert_item(4, "dates", False, "1 of 3")
7676

7777
get_done_item(1).click()
78-
dashjl.wait_for_text_to_equal("#totals", "2 of 4 items completed - 50%")
78+
dashjl.wait_for_text_to_equal("#totals", "2 of 4 items completed - 50%", timeout = 10)
7979
assert_item(1, "apples", True)
8080
assert_item(2, "bananas", False, "1 of 1", " DO THIS NEXT!")
8181
assert_item(3, "carrots", True)
8282
assert_item(4, "dates", False, "2 of 3")
8383

8484
clear_done.click()
85-
dashjl.wait_for_text_to_equal("#totals", "0 of 2 items completed - 0%")
85+
dashjl.wait_for_text_to_equal("#totals", "0 of 2 items completed - 0%", timeout = 10)
8686
assert_count(2)
8787
assert_item(1, "bananas", False, "0 of 0", " DO THIS NEXT!")
8888
assert_item(2, "dates", False, "0 of 1")
8989

9090
get_done_item(1).click()
91-
dashjl.wait_for_text_to_equal("#totals", "1 of 2 items completed - 50%")
91+
dashjl.wait_for_text_to_equal("#totals", "1 of 2 items completed - 50%", timeout = 10)
9292
assert_item(1, "bananas", True)
9393
assert_item(2, "dates", False, "1 of 1", " DO THIS NEXT!")
9494

9595
get_done_item(2).click()
96-
dashjl.wait_for_text_to_equal("#totals", "2 of 2 items completed - 100%")
96+
dashjl.wait_for_text_to_equal("#totals", "2 of 2 items completed - 100%", timeout = 10)
9797
assert_item(1, "bananas", True)
9898
assert_item(2, "dates", True)
9999

100100
clear_done.click()
101101
# This was a tricky one - trigger based on deleted components
102102
dashjl.wait_for_text_to_equal("#totals", "0 of 0 items completed")
103103
assert_count(0)
104-
104+
105105
@pytest.mark.parametrize("clientside", (False, True))
106106
def test_jlcbwc002_fibonacci_app(clientside, dashjl):
107107
jl_file = "jlcbwc002_fibonacci_app_true.jl" if clientside else "jlcbwc002_fibonacci_app_false.jl"
108-
fp = jl_test_file_path(jl_file)
108+
fp = jl_test_file_path(jl_file)
109109
dashjl.start_server(fp)
110110

111111
# app starts with 4 elements: 0, 1, 1, 2
112-
dashjl.wait_for_text_to_equal("#sum", "4 elements, sum: 4", timeout = 4)
112+
dashjl.wait_for_text_to_equal("#sum", "4 elements, sum: 4", timeout = 10)
113113

114114
# add 5th item, "3"
115115
dashjl.find_element("#n").send_keys(Keys.UP)
116-
dashjl.wait_for_text_to_equal("#sum", "5 elements, sum: 7")
116+
dashjl.wait_for_text_to_equal("#sum", "5 elements, sum: 7", timeout = 10)
117117

118118
# add 6th item, "5"
119119
dashjl.find_element("#n").send_keys(Keys.UP)
120-
dashjl.wait_for_text_to_equal("#sum", "6 elements, sum: 12")
120+
dashjl.wait_for_text_to_equal("#sum", "6 elements, sum: 12", timeout = 10)
121121

122122
# add 7th item, "8"
123123
dashjl.find_element("#n").send_keys(Keys.UP)
124-
dashjl.wait_for_text_to_equal("#sum", "7 elements, sum: 20")
124+
dashjl.wait_for_text_to_equal("#sum", "7 elements, sum: 20", timeout = 10)
125125

126126
# back down all the way to no elements
127127
dashjl.find_element("#n").send_keys(Keys.DOWN)
128-
dashjl.wait_for_text_to_equal("#sum", "6 elements, sum: 12")
128+
dashjl.wait_for_text_to_equal("#sum", "6 elements, sum: 12", timeout = 10)
129129
dashjl.find_element("#n").send_keys(Keys.DOWN)
130-
dashjl.wait_for_text_to_equal("#sum", "5 elements, sum: 7")
130+
dashjl.wait_for_text_to_equal("#sum", "5 elements, sum: 7", timeout = 10)
131131
dashjl.find_element("#n").send_keys(Keys.DOWN)
132-
dashjl.wait_for_text_to_equal("#sum", "4 elements, sum: 4")
132+
dashjl.wait_for_text_to_equal("#sum", "4 elements, sum: 4", timeout = 10)
133133
dashjl.find_element("#n").send_keys(Keys.DOWN)
134-
dashjl.wait_for_text_to_equal("#sum", "3 elements, sum: 2")
134+
dashjl.wait_for_text_to_equal("#sum", "3 elements, sum: 2", timeout = 10)
135135
dashjl.find_element("#n").send_keys(Keys.DOWN)
136-
dashjl.wait_for_text_to_equal("#sum", "2 elements, sum: 1")
136+
dashjl.wait_for_text_to_equal("#sum", "2 elements, sum: 1", timeout = 10)
137137
dashjl.find_element("#n").send_keys(Keys.DOWN)
138-
dashjl.wait_for_text_to_equal("#sum", "1 elements, sum: 0")
138+
dashjl.wait_for_text_to_equal("#sum", "1 elements, sum: 0", timeout = 10)
139139
dashjl.find_element("#n").send_keys(Keys.DOWN)
140-
dashjl.wait_for_text_to_equal("#sum", "0 elements, sum: 0")
140+
dashjl.wait_for_text_to_equal("#sum", "0 elements, sum: 0", timeout = 10)
141141

142142
def test_jlcbwc003_same_keys(dashjl):
143-
fp = jl_test_file_path("jlcbwc003_same_keys.jl")
143+
fp = jl_test_file_path("jlcbwc003_same_keys.jl")
144144
dashjl.start_server(fp)
145145

146-
dashjl.wait_for_text_to_equal("#add-filter", "Add Filter", timeout = 3)
146+
dashjl.wait_for_text_to_equal("#add-filter", "Add Filter", timeout = 10)
147147
dashjl.select_dcc_dropdown(
148148
'#\\{\\"index\\"\\:0\\,\\"type\\"\\:\\"dropdown\\"\\}', "LA"
149149
)
150150
dashjl.wait_for_text_to_equal(
151-
'#\\{\\"index\\"\\:0\\,\\"type\\"\\:\\"output\\"\\}', "Dropdown 0 = LA"
151+
'#\\{\\"index\\"\\:0\\,\\"type\\"\\:\\"output\\"\\}', "Dropdown 0 = LA", timeout = 10
152152
)
153153
dashjl.find_element("#add-filter").click()
154154
dashjl.select_dcc_dropdown(
155155
'#\\{\\"index\\"\\:1\\,\\"type\\"\\:\\"dropdown\\"\\}', "MTL"
156156
)
157157
dashjl.wait_for_text_to_equal(
158-
'#\\{\\"index\\"\\:1\\,\\"type\\"\\:\\"output\\"\\}', "Dropdown 1 = MTL"
158+
'#\\{\\"index\\"\\:1\\,\\"type\\"\\:\\"output\\"\\}', "Dropdown 1 = MTL", timeout = 10
159159
)
160160
dashjl.wait_for_text_to_equal(
161-
'#\\{\\"index\\"\\:0\\,\\"type\\"\\:\\"output\\"\\}', "Dropdown 0 = LA"
161+
'#\\{\\"index\\"\\:0\\,\\"type\\"\\:\\"output\\"\\}', "Dropdown 0 = LA", timeout = 10
162162
)
163163
dashjl.wait_for_no_elements(dashjl.devtools_error_count_locator)
164164

165165
def test_jlcbwc004_layout_chunk_changed_props(dashjl):
166-
fp = jl_test_file_path("jlcbwc004_layout_chunk_changed_props.jl")
166+
fp = jl_test_file_path("jlcbwc004_layout_chunk_changed_props.jl")
167167
dashjl.start_server(fp)
168168

169-
dashjl.wait_for_text_to_equal("#container", "No content initially")
169+
dashjl.wait_for_text_to_equal("#container", "No content initially", timeout = 10)
170170
dashjl.wait_for_text_to_equal(
171-
"#output-outer", "triggered is Falsy with prop_ids"
171+
"#output-outer", "triggered is Falsy with prop_ids", timeout = 10
172172
)
173173

174174
dashjl.find_element("#btn").click()
175175
dashjl.wait_for_text_to_equal(
176176
"#output-outer",
177-
'triggered is Truthy with prop_ids {"index":2,"type":"input"}.value',
177+
'triggered is Truthy with prop_ids {"index":2,"type":"input"}.value', timeout = 10
178178
)
179179
dashjl.wait_for_text_to_equal(
180-
"#output-inner", "triggered is Falsy with prop_ids"
180+
"#output-inner", "triggered is Falsy with prop_ids", timeout = 10
181181
)
182182

183183
dashjl.find_elements("input")[0].send_keys("X")
184184
trigger_text = 'triggered is Truthy with prop_ids {"index":1,"type":"input"}.value'
185-
dashjl.wait_for_text_to_equal("#output-outer", trigger_text)
186-
dashjl.wait_for_text_to_equal("#output-inner", trigger_text)
185+
dashjl.wait_for_text_to_equal("#output-outer", trigger_text, timeout = 10)
186+
dashjl.wait_for_text_to_equal("#output-inner", trigger_text, timeout = 10)
187187

0 commit comments

Comments
 (0)