Fix flaky library container test TE-745

This commit is contained in:
Jesse Zoldak
2015-02-11 12:14:19 -05:00
parent 3b319b3d3f
commit 405c92f4f4
2 changed files with 8 additions and 1 deletions

View File

@@ -265,6 +265,12 @@ class StudioLibraryContainerXBlockWrapper(XBlockWrapper):
"""
return self.q(css='article.content-primary').visible
def is_finished_loading(self):
"""
Returns true iff the Loading indicator is not visible
"""
return not self.q(css='div.ui-loading').visible
@classmethod
def from_xblock_wrapper(cls, xblock_wrapper):
"""
@@ -289,6 +295,7 @@ class StudioLibraryContainerXBlockWrapper(XBlockWrapper):
# This causes a reload (see cms/static/xmodule_js/public/js/library_content_edit.js)
self.wait_for(lambda: self.is_browser_on_page(), 'StudioLibraryContainerXBlockWrapper has reloaded.')
self.wait_for(lambda: self.is_finished_loading(), 'Loading indicator is not visible.')
# And wait to make sure the ajax post has finished.
self.wait_for_ajax()

View File

@@ -1,8 +1,8 @@
"""
Acceptance tests for Library Content in LMS
"""
import textwrap
import ddt
import textwrap
from .base_studio_test import StudioLibraryTest
from ...fixtures.course import CourseFixture