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.
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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):
|
||||
"""
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user