From 2be37b253341cfd1f1363c533e6f896230f047a7 Mon Sep 17 00:00:00 2001 From: Marijke Luttekes Date: Wed, 17 Apr 2024 16:30:13 +0200 Subject: [PATCH] Made SeleniumTests.test_inline_add_another_widgets less flaky by adding explicit wait. --- tests/admin_views/test_autocomplete_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/admin_views/test_autocomplete_view.py b/tests/admin_views/test_autocomplete_view.py index 8f56dd8314..dc3789fc5b 100644 --- a/tests/admin_views/test_autocomplete_view.py +++ b/tests/admin_views/test_autocomplete_view.py @@ -576,7 +576,8 @@ class SeleniumTests(AdminSeleniumTestCase): def assertNoResults(row): elem = row.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(