From 9ebfc49b9362c2622de86ad11833a12e6daca880 Mon Sep 17 00:00:00 2001 From: Jesse Zoldak Date: Wed, 2 Mar 2016 12:12:00 -0500 Subject: [PATCH] Wait for the Advanced problem tab to be active. Remove the __test__ signifier. --- common/test/acceptance/pages/studio/utils.py | 7 +++++++ .../test/acceptance/tests/studio/test_studio_components.py | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/common/test/acceptance/pages/studio/utils.py b/common/test/acceptance/pages/studio/utils.py index 1b1e360c7e..5ac2148234 100644 --- a/common/test/acceptance/pages/studio/utils.py +++ b/common/test/acceptance/pages/studio/utils.py @@ -87,6 +87,13 @@ def add_component(page, item_type, specific_type, is_advanced_problem=False): advanced_tab = page.q(css='.problem-type-tabs a').filter(text='Advanced').first advanced_tab.click() + # Wait for the advanced tab to be active + css = '.problem-type-tabs li.ui-tabs-active a' + page.wait_for( + lambda: len(page.q(css=css).filter(text='Advanced').execute()) > 0, + 'Waiting for the Advanced problem tab to be active' + ) + all_options = page.q(css='.new-component-{} ul.new-component-template li button span'.format(item_type)) chosen_option = all_options.filter(text=specific_type).first chosen_option.click() diff --git a/common/test/acceptance/tests/studio/test_studio_components.py b/common/test/acceptance/tests/studio/test_studio_components.py index 61c00cdf41..c4527cc631 100644 --- a/common/test/acceptance/tests/studio/test_studio_components.py +++ b/common/test/acceptance/tests/studio/test_studio_components.py @@ -15,8 +15,6 @@ class AdvancedProblemComponentTest(ContainerBase): Feature: CMS.Component Adding As a course author, I want to be able to add a wide variety of components """ - __test__ = True - def setUp(self, is_staff=True): """ Create a course with a section, subsection, and unit to which to add the component.