Skip to content

Commit 2bb55ff

Browse files
committed
Fix dash integration tests
1 parent b5c8263 commit 2bb55ff

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

dash/testing/browser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,10 @@ def select_dcc_dropdown(self, elem_or_selector, value=None, index=None):
432432
dropdown = self._get_element(elem_or_selector)
433433
dropdown.click()
434434

435-
menu = dropdown.find_element(By.CSS_SELECTOR, "div.Select-menu-outer")
435+
menu = dropdown.find_element(By.CSS_SELECTOR, ".dash-dropdown-options")
436436
logger.debug("the available options are %s", "|".join(menu.text.split("\n")))
437437

438-
options = menu.find_elements(By.CSS_SELECTOR, "div.VirtualizedSelectOption")
438+
options = menu.find_elements(By.CSS_SELECTOR, ".dash-dropdown-option")
439439
if options:
440440
if isinstance(index, int):
441441
options[index].click()

tests/integration/renderer/test_children_reorder.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,28 +62,32 @@ def swap_button_action(n_clicks, children):
6262

6363
for i in range(2):
6464
dash_duo.wait_for_text_to_equal("h1", f"I am section {i}")
65-
dash_duo.wait_for_text_to_equal(
66-
f".dropdown_{i} .Select-multi-value-wrapper", "Select..."
67-
)
65+
# dash_duo.wait_for_text_to_equal(
66+
# f".dropdown_{i} .Select-multi-value-wrapper", "Select..."
67+
# )
6868
dash_duo.find_element(f".dropdown_{i}").click()
69-
dash_duo.find_element(f".dropdown_{i} .VirtualizedSelectOption").click()
70-
dash_duo.wait_for_text_to_equal(
71-
f".dropdown_{i} .Select-multi-value-wrapper", "×A\n "
72-
)
69+
dash_duo.find_element(
70+
f".dropdown_{i} .dash-dropdown-option:nth-child(1)"
71+
).click()
72+
dash_duo.wait_for_text_to_equal(f".dropdown_{i} .dash-dropdown-trigger", "A")
7373
dash_duo.find_element(f".dropdown_{i}").click()
74-
dash_duo.find_element(f".dropdown_{i} .VirtualizedSelectOption").click()
74+
dash_duo.find_element(
75+
f".dropdown_{i} .dash-dropdown-option:nth-child(2)"
76+
).click()
7577
dash_duo.wait_for_text_to_equal(
76-
f".dropdown_{i} .Select-multi-value-wrapper", "×A\n ×B\n "
78+
f".dropdown_{i} .dash-dropdown-trigger", "A, B\n2 selected"
7779
)
7880
dash_duo.find_element(f".dropdown_{i}").click()
79-
dash_duo.find_element(f".dropdown_{i} .VirtualizedSelectOption").click()
81+
dash_duo.find_element(
82+
f".dropdown_{i} .dash-dropdown-option:nth-child(3)"
83+
).click()
8084
dash_duo.wait_for_text_to_equal(
81-
f".dropdown_{i} .Select-multi-value-wrapper", "×A\n ×B\n ×C\n "
85+
f".dropdown_{i} .dash-dropdown-trigger", "A, B, C\n3 selected"
8286
)
8387
dash_duo.find_element(f".swap_button_{i}").click()
8488
dash_duo.wait_for_text_to_equal(
85-
f".dropdown_{0} .Select-multi-value-wrapper", "×A\n ×B\n ×C\n "
89+
f".dropdown_{0} .dash-dropdown-trigger", "A, B, C\n3 selected"
8690
)
8791
dash_duo.wait_for_text_to_equal(
88-
f".dropdown_{1} .Select-multi-value-wrapper", "×A\n ×B\n ×C\n "
92+
f".dropdown_{1} .dash-dropdown-trigger", "A, B, C\n3 selected"
8993
)

tests/integration/renderer/test_component_as_prop.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,8 @@ def on_button(n_clicks):
454454
# Initial callback
455455
dash_duo.wait_for_text_to_equal("#counter", "1")
456456

457-
search = dash_duo.wait_for_element("#my-dynamic-dropdown input")
457+
dash_duo.wait_for_element("#my-dynamic-dropdown").click()
458+
search = dash_duo.wait_for_element("#my-dynamic-dropdown .dash-dropdown-search")
458459

459460
search.send_keys("a")
460461

0 commit comments

Comments
 (0)