@@ -99,31 +99,42 @@ def send_keys(key):
9999 assert num_elements == 100
100100
101101 send_keys (1 ) # Expecting to be typing into the searh bar
102+ sleep (0.1 ) # Give time for the search to filter options
102103 num_elements = len (dash_duo .find_elements (".dash-dropdown-option" ))
103104 assert num_elements == 19
104105
105106 send_keys (Keys .ARROW_DOWN ) # Expecting to be navigating through the options
106107 send_keys (Keys .SPACE ) # Expecting to be selecting
107- assert dash_duo .find_element (".dash-dropdown-value" ).text == "1"
108+ value_items = dash_duo .find_elements (".dash-dropdown-value-item" )
109+ assert len (value_items ) == 1
110+ assert value_items [0 ].text == "1"
108111
109112 send_keys (Keys .ARROW_DOWN ) # Expecting to be navigating through the options
110113 send_keys (Keys .SPACE ) # Expecting to be selecting
111- assert dash_duo .find_element (".dash-dropdown-value" ).text == "1, 10"
114+ value_items = dash_duo .find_elements (".dash-dropdown-value-item" )
115+ assert len (value_items ) == 2
116+ assert [item .text for item in value_items ] == ["1" , "10" ]
112117
113118 send_keys (Keys .SPACE ) # Expecting to be de-selecting
114- assert dash_duo .find_element (".dash-dropdown-value" ).text == "1"
119+ value_items = dash_duo .find_elements (".dash-dropdown-value-item" )
120+ assert len (value_items ) == 1
121+ assert value_items [0 ].text == "1"
115122
116123 send_keys (Keys .ARROW_UP )
117124 send_keys (Keys .ARROW_UP )
118125 send_keys (Keys .ARROW_UP ) # Expecting to wrap over to the last item
119126 send_keys (Keys .SPACE )
120- assert dash_duo .find_element (".dash-dropdown-value" ).text == "1, 91"
127+ value_items = dash_duo .find_elements (".dash-dropdown-value-item" )
128+ assert len (value_items ) == 2
129+ assert [item .text for item in value_items ] == ["1" , "91" ]
121130
122131 send_keys (
123132 Keys .ESCAPE
124133 ) # Expecting focus to remain on the dropdown after escaping out
125134 sleep (0.25 )
126- assert dash_duo .find_element (".dash-dropdown-value" ).text == "1, 91"
135+ value_items = dash_duo .find_elements (".dash-dropdown-value-item" )
136+ assert len (value_items ) == 2
137+ assert [item .text for item in value_items ] == ["1" , "91" ]
127138
128139 assert dash_duo .get_logs () == []
129140
0 commit comments