Commit 367bdf18 by cahrens

Improve stability of test_studio_outline tests.

STUD-2084
parent 05bddae3
......@@ -55,6 +55,15 @@ class ContainerPage(PageObject):
Promise(_is_finished_loading, 'Finished rendering the xblock wrappers.').fulfill()
)
def wait_for_component_menu(self):
"""
Waits until the menu bar of components is present on the page.
"""
EmptyPromise(
lambda: self.q(css='div.add-xblock-component').present,
'Wait for the menu of components to be present'
).fulfill()
@property
def xblocks(self):
"""
......
......@@ -345,7 +345,7 @@ class CourseOutlinePage(CoursePage, CourseOutlineContainer):
BOTTOM_ADD_SECTION_BUTTON = '.outline > .add-section .button-new'
def is_browser_on_page(self):
return self.q(css='body.view-outline').present
return self.q(css='body.view-outline').present and self.q(css='div.ui-loading.is-hidden').present
def view_live(self):
"""
......
......@@ -69,6 +69,7 @@ def add_discussion(page, menu_index=0):
menu_index specifies which instance of the menus should be used (based on vertical
placement within the page).
"""
page.wait_for_component_menu()
click_css(page, 'a>span.large-discussion-icon', menu_index)
......@@ -80,6 +81,7 @@ def add_advanced_component(page, menu_index, name):
placement within the page).
"""
# Click on the Advanced icon.
page.wait_for_component_menu()
click_css(page, 'a>span.large-advanced-icon', menu_index, require_notification=False)
# This does an animation to hide the first level of buttons
......
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