From 380e7c421cd22a19d9449daa072b850e302569a2 Mon Sep 17 00:00:00 2001 From: Jay Zoldak Date: Mon, 28 Oct 2013 11:44:27 -0400 Subject: [PATCH] Break out Advanced Problem tests into a Scenario Outline --- .../contentstore/features/component.feature | 19 +++++++------------ .../contentstore/features/component.py | 11 +++++++++++ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cms/djangoapps/contentstore/features/component.feature b/cms/djangoapps/contentstore/features/component.feature index 7f31eb6d69..95de94c4bd 100644 --- a/cms/djangoapps/contentstore/features/component.feature +++ b/cms/djangoapps/contentstore/features/component.feature @@ -43,19 +43,14 @@ Feature: CMS.Component Adding | Numerical Input | | Text Input | - Scenario: I can add Advanced Problem components + Scenario Outline: I can add Advanced Problem components Given I am in Studio editing a new unit - When I add this type of Advanced Problem component: - | Component | - | Blank Advanced Problem | - | Circuit Schematic Builder | - | Custom Python-Evaluated Input | - | Drag and Drop | - | Image Mapped Input | - | Math Expression Input | - | Problem Written in LaTeX | - | Problem with Adaptive Hint | - Then I see Problem components in this order: + When I add a "" "Advanced Problem" component + Then I see a "" Problem component + # Flush out the database before the next example executes + And I reset the database + + Examples: | Component | | Blank Advanced Problem | | Circuit Schematic Builder | diff --git a/cms/djangoapps/contentstore/features/component.py b/cms/djangoapps/contentstore/features/component.py index e99f6e2ae5..56d977e940 100644 --- a/cms/djangoapps/contentstore/features/component.py +++ b/cms/djangoapps/contentstore/features/component.py @@ -63,6 +63,17 @@ def see_a_multi_step_component(step, category): assert_in(step_hash['Component'].upper(), actual_text) +@step(u'I see a "([^"]*)" Problem component$') +def see_a_problem_component(step, category): + component_css = 'section.xmodule_CapaModule' + assert_true(world.is_css_present(component_css), + 'No problem was added to the unit.') + + problem_css = 'li.component section.xblock-student_view' + actual_text = world.css_text(problem_css) + assert_in(category.upper(), actual_text) + + @step(u'I add a "([^"]*)" "([^"]*)" component$') def add_component_category(step, component, category): assert category in ('single step', 'HTML', 'Problem', 'Advanced Problem')