From 405c92f4f4725f42eb98dbf9dc8eaaa6d10d2354 Mon Sep 17 00:00:00 2001 From: Jesse Zoldak Date: Wed, 11 Feb 2015 12:14:19 -0500 Subject: [PATCH] Fix flaky library container test TE-745 --- common/test/acceptance/pages/studio/library.py | 7 +++++++ .../tests/studio/test_studio_library_container.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/common/test/acceptance/pages/studio/library.py b/common/test/acceptance/pages/studio/library.py index b9aa4308db..c4ce4213a9 100644 --- a/common/test/acceptance/pages/studio/library.py +++ b/common/test/acceptance/pages/studio/library.py @@ -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() diff --git a/common/test/acceptance/tests/studio/test_studio_library_container.py b/common/test/acceptance/tests/studio/test_studio_library_container.py index 2c17f368c1..d5e0c41cb9 100644 --- a/common/test/acceptance/tests/studio/test_studio_library_container.py +++ b/common/test/acceptance/tests/studio/test_studio_library_container.py @@ -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