diff --git a/common/test/acceptance/pages/studio/users.py b/common/test/acceptance/pages/studio/users.py index d20bfbb56e..e8da392f46 100644 --- a/common/test/acceptance/pages/studio/users.py +++ b/common/test/acceptance/pages/studio/users.py @@ -107,18 +107,39 @@ class UsersPageMixin(PageObject): """ Gets modal dialog text """ return self.q(css='.prompt.{dialog_type} .message'.format(dialog_type=dialog_type)).text[0] + def wait_until_no_loading_indicator(self): + """ + When the page first loads, there is a loading indicator and most + functionality is not yet available. This waits for that loading to finish + and be removed from the DOM. + + This method is different from wait_until_ready because the loading element + is removed from the DOM, rather than hidden. + + It also disables animations for improved test reliability. + """ + + self.wait_for( + lambda: not self.q(css='.ui-loading').present, + "Wait for page to complete its initial loading" + ) + disable_animations(self) + def wait_until_ready(self): """ When the page first loads, there is a loading indicator and most functionality is not yet available. This waits for that loading to finish. - Always call this before using the page. It also disables animations - for improved test reliability. + This method is different from wait_until_no_loading_indicator because this expects + the loading indicator to still exist on the page; it is just hidden. + + It also disables animations for improved test reliability. """ + self.wait_for_element_invisibility( '.ui-loading', - 'Wait for the page to complete its initial loading and rendering via Backbone' + 'Wait for the page to complete its initial loading' ) disable_animations(self) diff --git a/common/test/acceptance/tests/studio/test_studio_course_team.py b/common/test/acceptance/tests/studio/test_studio_course_team.py index d8f79f83fd..8e82b0f4ef 100644 --- a/common/test/acceptance/tests/studio/test_studio_course_team.py +++ b/common/test/acceptance/tests/studio/test_studio_course_team.py @@ -42,7 +42,7 @@ class CourseTeamPageTest(StudioCourseTest): def _go_to_course_team_page(self): """ Opens Course Team page """ self.page.visit() - self.page.wait_until_ready() + self.page.wait_until_no_loading_indicator() def _refresh_page(self): """ diff --git a/common/test/acceptance/tests/studio/test_studio_library.py b/common/test/acceptance/tests/studio/test_studio_library.py index 8e7bca4372..28fd99800a 100644 --- a/common/test/acceptance/tests/studio/test_studio_library.py +++ b/common/test/acceptance/tests/studio/test_studio_library.py @@ -523,7 +523,7 @@ class LibraryUsersPageTest(StudioLibraryTest): """ self.page = LibraryUsersPage(self.browser, self.library_key) self.page.visit() - self.page.wait_until_ready() + self.page.wait_until_no_loading_indicator() @flaky # TODO fix this; see TNL-2647 def test_user_management(self): diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index da7fbb055d..7998b54822 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -124,7 +124,7 @@ django_debug_toolbar==1.2.2 # Used for testing astroid==1.3.4 -bok-choy==0.4.1 +bok-choy==0.4.2 chrono==1.0.2 coverage==3.7 ddt==0.8.0