Commit 65a36a64 by Ben Patterson

Merge pull request #8686 from edx/benp/3bok-choy-check-invisible

Update to latest bok-choy. Update tests to be compatible with the updated `invisible` property.
parents e086bb4d 8d9c16ba
...@@ -107,18 +107,39 @@ class UsersPageMixin(PageObject): ...@@ -107,18 +107,39 @@ class UsersPageMixin(PageObject):
""" Gets modal dialog text """ """ Gets modal dialog text """
return self.q(css='.prompt.{dialog_type} .message'.format(dialog_type=dialog_type)).text[0] 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): def wait_until_ready(self):
""" """
When the page first loads, there is a loading indicator and most When the page first loads, there is a loading indicator and most
functionality is not yet available. This waits for that loading to functionality is not yet available. This waits for that loading to
finish. finish.
Always call this before using the page. It also disables animations This method is different from wait_until_no_loading_indicator because this expects
for improved test reliability. 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( self.wait_for_element_invisibility(
'.ui-loading', '.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) disable_animations(self)
......
...@@ -42,7 +42,7 @@ class CourseTeamPageTest(StudioCourseTest): ...@@ -42,7 +42,7 @@ class CourseTeamPageTest(StudioCourseTest):
def _go_to_course_team_page(self): def _go_to_course_team_page(self):
""" Opens Course Team page """ """ Opens Course Team page """
self.page.visit() self.page.visit()
self.page.wait_until_ready() self.page.wait_until_no_loading_indicator()
def _refresh_page(self): def _refresh_page(self):
""" """
......
...@@ -523,7 +523,7 @@ class LibraryUsersPageTest(StudioLibraryTest): ...@@ -523,7 +523,7 @@ class LibraryUsersPageTest(StudioLibraryTest):
""" """
self.page = LibraryUsersPage(self.browser, self.library_key) self.page = LibraryUsersPage(self.browser, self.library_key)
self.page.visit() self.page.visit()
self.page.wait_until_ready() self.page.wait_until_no_loading_indicator()
@flaky # TODO fix this; see TNL-2647 @flaky # TODO fix this; see TNL-2647
def test_user_management(self): def test_user_management(self):
......
...@@ -124,7 +124,7 @@ django_debug_toolbar==1.2.2 ...@@ -124,7 +124,7 @@ django_debug_toolbar==1.2.2
# Used for testing # Used for testing
astroid==1.3.4 astroid==1.3.4
bok-choy==0.4.1 bok-choy==0.4.2
chrono==1.0.2 chrono==1.0.2
coverage==3.7 coverage==3.7
ddt==0.8.0 ddt==0.8.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment