diff --git a/tests/admin_views/tests.py b/tests/admin_views/tests.py index 1bdbe34adf..d1731335d9 100644 --- a/tests/admin_views/tests.py +++ b/tests/admin_views/tests.py @@ -4680,14 +4680,16 @@ class SeleniumTests(AdminSeleniumTestCase): """JavaScript-assisted auto-focus on first usable form field.""" # First form field has a single widget self.admin_login(username='super', password='secret', login_url=reverse('admin:index')) - self.selenium.get(self.live_server_url + reverse('admin:admin_views_picture_add')) + with self.wait_page_loaded(): + self.selenium.get(self.live_server_url + reverse('admin:admin_views_picture_add')) self.assertEqual( self.selenium.switch_to.active_element, self.selenium.find_element_by_id('id_name') ) # First form field has a MultiWidget - self.selenium.get(self.live_server_url + reverse('admin:admin_views_reservation_add')) + with self.wait_page_loaded(): + self.selenium.get(self.live_server_url + reverse('admin:admin_views_reservation_add')) self.assertEqual( self.selenium.switch_to.active_element, self.selenium.find_element_by_id('id_start_date_0')