Made SeleniumTests.test_select_multiple less flaky by adding explicit Selenium wait.

This commit is contained in:
sarahboyce 2023-06-11 15:53:34 +02:00 committed by Mariusz Felisiak
parent 1699f8b52a
commit decbfa834f
1 changed files with 2 additions and 1 deletions

View File

@ -494,7 +494,8 @@ class SeleniumTests(AdminSeleniumTestCase):
+ reverse("autocomplete_admin:admin_views_question_add")
)
elem = self.selenium.find_element(By.CSS_SELECTOR, ".select2-selection")
elem.click() # Open the autocomplete dropdown.
with self.select2_ajax_wait():
elem.click() # Open the autocomplete dropdown.
results = self.selenium.find_element(By.CSS_SELECTOR, ".select2-results")
self.assertTrue(results.is_displayed())
option = self.selenium.find_element(By.CSS_SELECTOR, ".select2-results__option")