Commit 35d58b98 by Jay Zoldak

Merge pull request #1516 from edx/zoldak/fix-component-test

Break out Advanced Problem tests into a Scenario Outline
parents d8447436 380e7c42
...@@ -43,19 +43,14 @@ Feature: CMS.Component Adding ...@@ -43,19 +43,14 @@ Feature: CMS.Component Adding
| Numerical Input | | Numerical Input |
| Text 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 Given I am in Studio editing a new unit
When I add this type of Advanced Problem component: When I add a "<Component>" "Advanced Problem" component
| Component | Then I see a "<Component>" Problem component
| Blank Advanced Problem | # Flush out the database before the next example executes
| Circuit Schematic Builder | And I reset the database
| Custom Python-Evaluated Input |
| Drag and Drop | Examples:
| Image Mapped Input |
| Math Expression Input |
| Problem Written in LaTeX |
| Problem with Adaptive Hint |
Then I see Problem components in this order:
| Component | | Component |
| Blank Advanced Problem | | Blank Advanced Problem |
| Circuit Schematic Builder | | Circuit Schematic Builder |
......
...@@ -63,6 +63,17 @@ def see_a_multi_step_component(step, category): ...@@ -63,6 +63,17 @@ def see_a_multi_step_component(step, category):
assert_in(step_hash['Component'].upper(), actual_text) 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$') @step(u'I add a "([^"]*)" "([^"]*)" component$')
def add_component_category(step, component, category): def add_component_category(step, component, category):
assert category in ('single step', 'HTML', 'Problem', 'Advanced Problem') assert category in ('single step', 'HTML', 'Problem', 'Advanced Problem')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment