From 4c2b98e2cdea6ddd9529ad97340fd562023ebaa9 Mon Sep 17 00:00:00 2001 From: Neil Muller Date: Mon, 4 Mar 2024 13:13:07 +0200 Subject: [PATCH 1/4] Modify handling of wait times in selenium tests and bump up value as github seems to have become more sensitive to this --- .../tests/test_schedule_datetime_widget.py | 6 +++--- wafer/schedule/tests/test_schedule_editor.py | 20 +++++++++---------- wafer/tests/utils.py | 9 +++++++-- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/wafer/schedule/tests/test_schedule_datetime_widget.py b/wafer/schedule/tests/test_schedule_datetime_widget.py index f313ee0a..2bf9468e 100644 --- a/wafer/schedule/tests/test_schedule_datetime_widget.py +++ b/wafer/schedule/tests/test_schedule_datetime_widget.py @@ -17,7 +17,7 @@ from django.urls import reverse from wafer.pages.models import Page -from wafer.tests.utils import ChromeTestRunner, FirefoxTestRunner +from wafer.tests.utils import ChromeTestRunner, FirefoxTestRunner, WAIT_TIME from wafer.schedule.models import Venue, Slot, ScheduleBlock from wafer.schedule.tests.test_views import make_pages, make_items @@ -51,7 +51,7 @@ def setUp(self): def check_clock_button(self): """Standard check for the clock button contents""" # Find the clock button - clock_button = WebDriverWait(self.driver, 10).until( + clock_button = WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, 'clock-icon')) ) # Check that the list isn't visible before we click @@ -59,7 +59,7 @@ def check_clock_button(self): style = clock_box.get_attribute('style') self.assertIn('display: none', style) clock_button.click() - timelist = WebDriverWait(self.driver, 10).until( + timelist = WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, 'timelist')) ) clock_box = self.driver.find_element(By.ID, 'clockbox0') diff --git a/wafer/schedule/tests/test_schedule_editor.py b/wafer/schedule/tests/test_schedule_editor.py index 556f2440..7466e793 100644 --- a/wafer/schedule/tests/test_schedule_editor.py +++ b/wafer/schedule/tests/test_schedule_editor.py @@ -21,7 +21,7 @@ from django.urls import reverse from wafer.pages.models import Page -from wafer.tests.utils import create_user, ChromeTestRunner, FirefoxTestRunner +from wafer.tests.utils import create_user, ChromeTestRunner, FirefoxTestRunner, WAIT_TIME from wafer.talks.tests.fixtures import create_talk from wafer.talks.models import ACCEPTED @@ -126,14 +126,14 @@ def _start(self): """Helper method to login as admin and load the editor""" self.admin_login() self.driver.get(self.edit_page) - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.TAG_NAME, "h1")) ) def test_access_schedule_editor_no_login(self): """Test that the schedule editor isn't accessible if not logged in""" self.driver.get(self.edit_page) - header = WebDriverWait(self.driver, 10).until( + header = WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.TAG_NAME, "h1")) ) self.assertEqual('Django administration', header.text) @@ -148,7 +148,7 @@ def test_access_schedule_editor_no_super(self): """Test that the schedule editor isn't accessible for non-superuser accounts""" self.normal_login() self.driver.get(self.edit_page) - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.TAG_NAME, "h1")) ) error = self.driver.find_element(By.CLASS_NAME, "errornote") @@ -196,7 +196,7 @@ def test_drag_talk(self): # Pause briefly to make sure the server has a chance to do stuff actions.pause(0.5) actions.perform() - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) self.assertEqual(ScheduleItem.objects.count(), 1) @@ -217,7 +217,7 @@ def test_drag_talk(self): actions.drag_and_drop(source, target) actions.pause(0.5) actions.perform() - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) self.assertEqual(ScheduleItem.objects.count(), 2) @@ -253,7 +253,7 @@ def test_drag_page(self): actions.drag_and_drop(source, target) actions.pause(0.5) actions.perform() - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) self.assertEqual(ScheduleItem.objects.count(), 1) @@ -279,7 +279,7 @@ def test_drag_page(self): actions.drag_and_drop(source, target) actions.pause(0.5) actions.perform() - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) self.assertEqual(ScheduleItem.objects.count(), 2) @@ -333,12 +333,12 @@ def test_swicth_day(self): buttons = self.driver.find_elements(By.TAG_NAME, 'button') self.assertIn('Sep', buttons[1].text) buttons[1].click() - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "show")) ) days = self.driver.find_elements(By.PARTIAL_LINK_TEXT, "Sep") days[1].click() - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) # Verify we see the expected schedule items on day 2 diff --git a/wafer/tests/utils.py b/wafer/tests/utils.py index 4c16dab7..af98209a 100644 --- a/wafer/tests/utils.py +++ b/wafer/tests/utils.py @@ -52,6 +52,11 @@ def mock_avatar_url(self): return None return "avatar-%s" % self.user.email + +# Time to wait for elements to appear - single constant so we can easily tune it if needed +WAIT_TIME = 20 + + @tag('selenium') class BaseWebdriverRunner(StaticLiveServerTestCase): @@ -76,7 +81,7 @@ def _login(self, name, password): """Generic login handler""" login_url = reverse('auth_login') self.driver.get(f"{self.live_server_url}{login_url}") - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.NAME, "submit")) ) user_field = self.driver.find_element(By.NAME, 'username') @@ -85,7 +90,7 @@ def _login(self, name, password): pass_field.send_keys(password) loginbut = self.driver.find_element(By.NAME, 'submit') loginbut.click() - WebDriverWait(self.driver, 10).until( + WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "wafer-profile")) ) From 9ec506c88f22617dc6ba0e2a6d7bc3be36b7ed9f Mon Sep 17 00:00:00 2001 From: Neil Muller Date: Mon, 4 Mar 2024 21:24:02 +0200 Subject: [PATCH 2/4] Add some extra waits to try be a bit more robust to slow page loads --- wafer/schedule/tests/test_schedule_editor.py | 33 +++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/wafer/schedule/tests/test_schedule_editor.py b/wafer/schedule/tests/test_schedule_editor.py index 7466e793..dc89cc81 100644 --- a/wafer/schedule/tests/test_schedule_editor.py +++ b/wafer/schedule/tests/test_schedule_editor.py @@ -161,7 +161,9 @@ def test_access_schedule_editor_no_super(self): def test_access_schedule_editor_admin(self): """Test that the schedule editor is accessible for superuser accounts""" self._start() - all_talks_link = self.driver.find_element(By.PARTIAL_LINK_TEXT, "All Talks") + all_talks_link = WebDriverWait(self.driver, WAIT_TIME).until( + expected_conditions.presence_of_element_located((By.PARTIAL_LINK_TEXT, "All Talks")) + ) all_talks_link.click() tab_pane = None for pane in self.driver.find_elements(By.CLASS_NAME, "tab-pane"): @@ -176,7 +178,9 @@ def test_drag_talk(self): self.assertEqual(ScheduleItem.objects.count(), 0) self._start() # partial link text to avoid whitespace fiddling - talks_link = self.driver.find_element(By.PARTIAL_LINK_TEXT, "Unassigned Talks") + talks_link = WebDriverWait(self.driver, WAIT_TIME).until( + expected_conditions.presence_of_element_located((By.PARTIAL_LINK_TEXT, "Unassigned Talks")) + ) talks_link.click() tab_pane = None for pane in self.driver.find_elements(By.CLASS_NAME, "tab-pane"): @@ -232,7 +236,10 @@ def test_drag_page(self): self.assertEqual(ScheduleItem.objects.count(), 0) self._start() # Drag a page from the siderbar to a slot in the schedule - page_link = self.driver.find_element(By.PARTIAL_LINK_TEXT, "Pages") + + page_link = WebDriverWait(self.driver, WAIT_TIME).until( + expected_conditions.presence_of_element_located((By.PARTIAL_LINK_TEXT, "Pages")) + ) page_link.click() tab_pane = None for pane in self.driver.find_elements(By.CLASS_NAME, "tab-pane"): @@ -323,7 +330,9 @@ def test_swicth_day(self): # Load schedule page self._start() # Verify we see the expected schedule items on day 1 - td1 = self.driver.find_element(By.ID, f"scheduleItem{item1.pk}") + td1 = WebDriverWait(self.driver, WAIT_TIME).until( + expected_conditions.presence_of_element_located((By.ID, f"scheduleItem{item1.pk}")) + ) self.assertEqual(td1.tag_name, 'td') td2 = self.driver.find_element(By.ID, f"scheduleItem{item2.pk}") self.assertEqual(td2.tag_name, 'td') @@ -362,7 +371,9 @@ def test_drag_over_talk(self): item1.save() self._start() # Test dragging a talk over an existing talk - target = self.driver.find_element(By.ID, f"scheduleItem{item1.pk}") + target = WebDriverWait(self.driver, WAIT_TIME).until( + expected_conditions.presence_of_element_located((By.ID, f"scheduleItem{item1.pk}")) + ) talks_link = self.driver.find_element(By.PARTIAL_LINK_TEXT, "Unassigned Talks") talks_link.click() tab_pane = None @@ -414,7 +425,9 @@ def test_drag_over_page(self): item1.save() self._start() # Test dragging a page over an existing page - target = self.driver.find_element(By.ID, f"scheduleItem{item1.pk}") + target = WebDriverWait(self.driver, WAIT_TIME).until( + expected_conditions.presence_of_element_located((By.ID, f"scheduleItem{item1.pk}")) + ) page_link = self.driver.find_element(By.PARTIAL_LINK_TEXT, "Pages") page_link.click() tab_pane = None @@ -462,7 +475,9 @@ def test_adding_clash(self): item2.save() self._start() # Verify that there are no validation errors - validation = self.driver.find_element(By.CLASS_NAME, "alert-danger") + validation = WebDriverWait(self.driver, WAIT_TIME).until( + expected_conditions.presence_of_element_located((By.CLASS_NAME, "alert-danger")) + ) self.assertFalse(validation.is_displayed()) # Drag a talk into a clashing slot target = self.driver.find_element(By.ID, f"scheduleItem{item2.pk}") @@ -507,7 +522,9 @@ def test_removing_clash(self): item2.save() self._start() # Verify that there are validation errors - validation = self.driver.find_element(By.CLASS_NAME, "alert-danger") + validation = WebDriverWait(self.driver, WAIT_TIME).until( + expected_conditions.presence_of_element_located((By.CLASS_NAME, "alert-danger")) + ) self.assertTrue(validation.is_displayed()) error_item = validation.find_element(By.TAG_NAME, "li") self.assertIn('Common speaker', error_item.text) From 5189c4b1755867458170e3087b90345765c623b4 Mon Sep 17 00:00:00 2001 From: Neil Muller Date: Tue, 5 Mar 2024 10:30:23 +0200 Subject: [PATCH 3/4] Add an explicit wait here, since this seems a common sticking point --- wafer/schedule/tests/test_schedule_editor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wafer/schedule/tests/test_schedule_editor.py b/wafer/schedule/tests/test_schedule_editor.py index dc89cc81..7322c121 100644 --- a/wafer/schedule/tests/test_schedule_editor.py +++ b/wafer/schedule/tests/test_schedule_editor.py @@ -151,7 +151,9 @@ def test_access_schedule_editor_no_super(self): WebDriverWait(self.driver, WAIT_TIME).until( expected_conditions.presence_of_element_located((By.TAG_NAME, "h1")) ) - error = self.driver.find_element(By.CLASS_NAME, "errornote") + error = WebDriverWait(self.driver, WAIT_TIME).until( + expected_conditions.presence_of_element_located((By.CLASS_NAME, "errornote")) + ) self.assertIn("authenticated as normal", error.text) self.assertIn("not authorized to access this page", error.text) # Check that no admin info has loaded From 398bbc478bc510d83b39b69f600adc700fdec930 Mon Sep 17 00:00:00 2001 From: Neil Muller Date: Tue, 5 Mar 2024 10:30:53 +0200 Subject: [PATCH 4/4] Rename constant --- .../tests/test_schedule_datetime_widget.py | 6 +-- wafer/schedule/tests/test_schedule_editor.py | 38 +++++++++---------- wafer/tests/utils.py | 6 +-- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/wafer/schedule/tests/test_schedule_datetime_widget.py b/wafer/schedule/tests/test_schedule_datetime_widget.py index 2bf9468e..4508c72c 100644 --- a/wafer/schedule/tests/test_schedule_datetime_widget.py +++ b/wafer/schedule/tests/test_schedule_datetime_widget.py @@ -17,7 +17,7 @@ from django.urls import reverse from wafer.pages.models import Page -from wafer.tests.utils import ChromeTestRunner, FirefoxTestRunner, WAIT_TIME +from wafer.tests.utils import ChromeTestRunner, FirefoxTestRunner, SELENIUM_WAIT_TIME from wafer.schedule.models import Venue, Slot, ScheduleBlock from wafer.schedule.tests.test_views import make_pages, make_items @@ -51,7 +51,7 @@ def setUp(self): def check_clock_button(self): """Standard check for the clock button contents""" # Find the clock button - clock_button = WebDriverWait(self.driver, WAIT_TIME).until( + clock_button = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, 'clock-icon')) ) # Check that the list isn't visible before we click @@ -59,7 +59,7 @@ def check_clock_button(self): style = clock_box.get_attribute('style') self.assertIn('display: none', style) clock_button.click() - timelist = WebDriverWait(self.driver, WAIT_TIME).until( + timelist = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, 'timelist')) ) clock_box = self.driver.find_element(By.ID, 'clockbox0') diff --git a/wafer/schedule/tests/test_schedule_editor.py b/wafer/schedule/tests/test_schedule_editor.py index 7322c121..524723ba 100644 --- a/wafer/schedule/tests/test_schedule_editor.py +++ b/wafer/schedule/tests/test_schedule_editor.py @@ -21,7 +21,7 @@ from django.urls import reverse from wafer.pages.models import Page -from wafer.tests.utils import create_user, ChromeTestRunner, FirefoxTestRunner, WAIT_TIME +from wafer.tests.utils import create_user, ChromeTestRunner, FirefoxTestRunner, SELENIUM_WAIT_TIME from wafer.talks.tests.fixtures import create_talk from wafer.talks.models import ACCEPTED @@ -126,14 +126,14 @@ def _start(self): """Helper method to login as admin and load the editor""" self.admin_login() self.driver.get(self.edit_page) - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.TAG_NAME, "h1")) ) def test_access_schedule_editor_no_login(self): """Test that the schedule editor isn't accessible if not logged in""" self.driver.get(self.edit_page) - header = WebDriverWait(self.driver, WAIT_TIME).until( + header = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.TAG_NAME, "h1")) ) self.assertEqual('Django administration', header.text) @@ -148,10 +148,10 @@ def test_access_schedule_editor_no_super(self): """Test that the schedule editor isn't accessible for non-superuser accounts""" self.normal_login() self.driver.get(self.edit_page) - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.TAG_NAME, "h1")) ) - error = WebDriverWait(self.driver, WAIT_TIME).until( + error = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "errornote")) ) self.assertIn("authenticated as normal", error.text) @@ -163,7 +163,7 @@ def test_access_schedule_editor_no_super(self): def test_access_schedule_editor_admin(self): """Test that the schedule editor is accessible for superuser accounts""" self._start() - all_talks_link = WebDriverWait(self.driver, WAIT_TIME).until( + all_talks_link = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.PARTIAL_LINK_TEXT, "All Talks")) ) all_talks_link.click() @@ -180,7 +180,7 @@ def test_drag_talk(self): self.assertEqual(ScheduleItem.objects.count(), 0) self._start() # partial link text to avoid whitespace fiddling - talks_link = WebDriverWait(self.driver, WAIT_TIME).until( + talks_link = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.PARTIAL_LINK_TEXT, "Unassigned Talks")) ) talks_link.click() @@ -202,7 +202,7 @@ def test_drag_talk(self): # Pause briefly to make sure the server has a chance to do stuff actions.pause(0.5) actions.perform() - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) self.assertEqual(ScheduleItem.objects.count(), 1) @@ -223,7 +223,7 @@ def test_drag_talk(self): actions.drag_and_drop(source, target) actions.pause(0.5) actions.perform() - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) self.assertEqual(ScheduleItem.objects.count(), 2) @@ -239,7 +239,7 @@ def test_drag_page(self): self._start() # Drag a page from the siderbar to a slot in the schedule - page_link = WebDriverWait(self.driver, WAIT_TIME).until( + page_link = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.PARTIAL_LINK_TEXT, "Pages")) ) page_link.click() @@ -262,7 +262,7 @@ def test_drag_page(self): actions.drag_and_drop(source, target) actions.pause(0.5) actions.perform() - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) self.assertEqual(ScheduleItem.objects.count(), 1) @@ -288,7 +288,7 @@ def test_drag_page(self): actions.drag_and_drop(source, target) actions.pause(0.5) actions.perform() - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) self.assertEqual(ScheduleItem.objects.count(), 2) @@ -332,7 +332,7 @@ def test_swicth_day(self): # Load schedule page self._start() # Verify we see the expected schedule items on day 1 - td1 = WebDriverWait(self.driver, WAIT_TIME).until( + td1 = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.ID, f"scheduleItem{item1.pk}")) ) self.assertEqual(td1.tag_name, 'td') @@ -344,12 +344,12 @@ def test_swicth_day(self): buttons = self.driver.find_elements(By.TAG_NAME, 'button') self.assertIn('Sep', buttons[1].text) buttons[1].click() - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "show")) ) days = self.driver.find_elements(By.PARTIAL_LINK_TEXT, "Sep") days[1].click() - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "close")) ) # Verify we see the expected schedule items on day 2 @@ -373,7 +373,7 @@ def test_drag_over_talk(self): item1.save() self._start() # Test dragging a talk over an existing talk - target = WebDriverWait(self.driver, WAIT_TIME).until( + target = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.ID, f"scheduleItem{item1.pk}")) ) talks_link = self.driver.find_element(By.PARTIAL_LINK_TEXT, "Unassigned Talks") @@ -427,7 +427,7 @@ def test_drag_over_page(self): item1.save() self._start() # Test dragging a page over an existing page - target = WebDriverWait(self.driver, WAIT_TIME).until( + target = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.ID, f"scheduleItem{item1.pk}")) ) page_link = self.driver.find_element(By.PARTIAL_LINK_TEXT, "Pages") @@ -477,7 +477,7 @@ def test_adding_clash(self): item2.save() self._start() # Verify that there are no validation errors - validation = WebDriverWait(self.driver, WAIT_TIME).until( + validation = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "alert-danger")) ) self.assertFalse(validation.is_displayed()) @@ -524,7 +524,7 @@ def test_removing_clash(self): item2.save() self._start() # Verify that there are validation errors - validation = WebDriverWait(self.driver, WAIT_TIME).until( + validation = WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "alert-danger")) ) self.assertTrue(validation.is_displayed()) diff --git a/wafer/tests/utils.py b/wafer/tests/utils.py index af98209a..bef71d93 100644 --- a/wafer/tests/utils.py +++ b/wafer/tests/utils.py @@ -54,7 +54,7 @@ def mock_avatar_url(self): # Time to wait for elements to appear - single constant so we can easily tune it if needed -WAIT_TIME = 20 +SELENIUM_WAIT_TIME = 20 @tag('selenium') @@ -81,7 +81,7 @@ def _login(self, name, password): """Generic login handler""" login_url = reverse('auth_login') self.driver.get(f"{self.live_server_url}{login_url}") - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.NAME, "submit")) ) user_field = self.driver.find_element(By.NAME, 'username') @@ -90,7 +90,7 @@ def _login(self, name, password): pass_field.send_keys(password) loginbut = self.driver.find_element(By.NAME, 'submit') loginbut.click() - WebDriverWait(self.driver, WAIT_TIME).until( + WebDriverWait(self.driver, SELENIUM_WAIT_TIME).until( expected_conditions.presence_of_element_located((By.CLASS_NAME, "wafer-profile")) )