From a35cbf1c632565fd9190bedd476d8f8d15eb9211 Mon Sep 17 00:00:00 2001 From: cahrens Date: Wed, 13 Aug 2014 11:55:34 -0400 Subject: [PATCH] Verify loading indicator has been hidden. STUD-2090 --- cms/djangoapps/contentstore/features/common.py | 9 +++++++++ .../features/component_settings_editor_helpers.py | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index 5c6c244193..0ac82a6545 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -248,10 +248,19 @@ def create_unit_from_course_outline(): world.wait_for_mathjax() world.wait_for_xmodule() + world.wait_for_loading() assert world.is_css_present('ul.new-component-type') +@world.absorb +def wait_for_loading(): + """ + Waits for the loading indicator to be hidden. + """ + world.wait_for(lambda _driver: len(world.browser.find_by_css('div.ui-loading.is-hidden')) > 0) + + @step('I have clicked the new unit button$') @step(u'I am in Studio editing a new unit$') def edit_new_unit(step): diff --git a/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py b/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py index e440287c2c..9e9ed9cc7f 100644 --- a/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py +++ b/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py @@ -6,7 +6,6 @@ from nose.tools import assert_equal, assert_in # pylint: disable=E0611 from terrain.steps import reload_the_page from common import type_in_codemirror from selenium.webdriver.common.keys import Keys -from cms.envs.common import FEATURES @world.absorb @@ -123,6 +122,9 @@ def ensure_settings_visible(): @world.absorb def edit_component(index=0): + # Verify that the "loading" indication has been hidden. + world.wait_for_loading() + # Verify that the "edit" button is present. world.wait_for(lambda _driver: world.css_visible('a.edit-button')) world.css_click('a.edit-button', index) world.wait_for_ajax_complete()