Skip to content

Commit ccf27a0

Browse files
committed
fix flaky test
1 parent a4d0d09 commit ccf27a0

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

components/dash-core-components/tests/integration/misc/test_platter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,19 @@ def reset_input(elem):
3939
elem.send_keys(len(elem.get_attribute("value")) * Keys.BACKSPACE)
4040
elem.send_keys("1997-05-03")
4141

42-
dt_input_1 = dash_dcc.find_element("#dt-single-no-date-value #date")
42+
dt_input_1 = dash_dcc.find_element(
43+
"#dt-single-no-date-value .dash-datepicker-input"
44+
)
4345
dt_input_1.click()
4446
dash_dcc.percy_snapshot(
4547
"gallery - DatePickerSingle's datepicker "
4648
"when no date value and no initial month specified"
4749
)
4850
reset_input(dt_input_1)
4951

50-
dt_input_2 = dash_dcc.find_element("#dt-single-no-date-value-init-month #date")
52+
dt_input_2 = dash_dcc.find_element(
53+
"#dt-single-no-date-value-init-month .dash-datepicker-input"
54+
)
5155
dash_dcc.find_element("label").click()
5256
dt_input_2.click()
5357
dash_dcc.percy_snapshot(

tests/integration/callbacks/test_basic_callback.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def update_output(value):
5555
for key in "hello world":
5656
with lock:
5757
input_.send_keys(key)
58+
time.sleep(0.05) # Small delay to prevent callback debouncing
5859

5960
dash_duo.wait_for_text_to_equal("#output-1", "hello world")
6061

@@ -416,6 +417,7 @@ def update_text(data):
416417
for key in "hello world":
417418
with lock:
418419
input1.send_keys(key)
420+
time.sleep(0.05) # Small delay to prevent callback debouncing
419421

420422
dash_duo.wait_for_text_to_equal("#output-1", "hello world")
421423
assert dash_duo.find_element("#output-1").get_attribute("data-cb") == "hello world"

0 commit comments

Comments
 (0)