1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

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

View File

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