From e0a56ad3c86c1b5c3d5842783bf6b20e96304770 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Wed, 22 Sep 2021 08:17:48 +0200 Subject: [PATCH] Removed blocking wait in admin inlines selenium test. find_elements_by_css_selector() implicitly waits the default timeout (10 seconds) looking for missing elements. --- tests/admin_inlines/tests.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tests/admin_inlines/tests.py b/tests/admin_inlines/tests.py index 1c8d6bd271..b7249f300f 100644 --- a/tests/admin_inlines/tests.py +++ b/tests/admin_inlines/tests.py @@ -1644,13 +1644,15 @@ class SeleniumTests(AdminSeleniumTestCase): self.selenium.execute_script('window.scrollTo(0, %s);' % hide_link.location['y']) hide_link.click() self.wait_until_invisible(field_name) - self.selenium.find_element_by_xpath('//input[@value="Save"]').click() - self.assertEqual( - len(self.selenium.find_elements_by_css_selector(stacked_inline_formset_selector + '.collapsed')), 0 - ) - self.assertEqual( - len(self.selenium.find_elements_by_css_selector(tabular_inline_formset_selector + '.collapsed')), 0 - ) + with self.wait_page_loaded(): + self.selenium.find_element_by_xpath('//input[@value="Save"]').click() + with self.disable_implicit_wait(): + self.assertEqual( + len(self.selenium.find_elements_by_css_selector(stacked_inline_formset_selector + '.collapsed')), 0 + ) + self.assertEqual( + len(self.selenium.find_elements_by_css_selector(tabular_inline_formset_selector + '.collapsed')), 0 + ) self.assertEqual( len(self.selenium.find_elements_by_css_selector(stacked_inline_formset_selector)), 1 )