Commit 0222e57c by cahrens

Add acceptance test for behavior when & is in problem xml.

Part of STUD-91
parent 4c126c7b
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
from lettuce import world from lettuce import world
from nose.tools import assert_equal, assert_in # pylint: disable=E0611 from nose.tools import assert_equal, assert_in # pylint: disable=E0611
from terrain.steps import reload_the_page from terrain.steps import reload_the_page
from common import type_in_codemirror
@world.absorb @world.absorb
...@@ -115,6 +116,17 @@ def edit_component(): ...@@ -115,6 +116,17 @@ def edit_component():
@world.absorb @world.absorb
def enter_xml_in_advanced_problem(step, text):
"""
Edits an advanced problem (assumes only on page),
types the provided XML, and saves the component.
"""
world.edit_component()
type_in_codemirror(0, text)
world.save_component(step)
@world.absorb
def verify_setting_entry(setting, display_name, value, explicitly_set): def verify_setting_entry(setting, display_name, value, explicitly_set):
""" """
Verify the capa module fields are set as expected in the Verify the capa module fields are set as expected in the
......
...@@ -9,3 +9,11 @@ Feature: Course export ...@@ -9,3 +9,11 @@ Feature: Course export
And I export the course And I export the course
Then I get an error dialog Then I get an error dialog
And I can click to go to the unit with the error And I can click to go to the unit with the error
Scenario: User is directed to problem with & in it when export fails
Given I am in Studio editing a new unit
When I add a "Blank Advanced Problem" "Advanced Problem" component
And I edit and enter an ampersand
And I export the course
Then I get an error dialog
And I can click to go to the unit with the error
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#pylint: disable=C0111 #pylint: disable=C0111
from lettuce import world, step from lettuce import world, step
from common import type_in_codemirror
from nose.tools import assert_true, assert_equal from nose.tools import assert_true, assert_equal
...@@ -16,9 +15,7 @@ def i_export_the_course(step): ...@@ -16,9 +15,7 @@ def i_export_the_course(step):
@step('I edit and enter bad XML$') @step('I edit and enter bad XML$')
def i_enter_bad_xml(step): def i_enter_bad_xml(step):
world.edit_component() world.enter_xml_in_advanced_problem(step,
type_in_codemirror(
0,
"""<problem><h1>Smallest Canvas</h1> """<problem><h1>Smallest Canvas</h1>
<p>You want to make the smallest canvas you can.</p> <p>You want to make the smallest canvas you can.</p>
<multiplechoiceresponse> <multiplechoiceresponse>
...@@ -29,7 +26,11 @@ def i_enter_bad_xml(step): ...@@ -29,7 +26,11 @@ def i_enter_bad_xml(step):
</multiplechoiceresponse> </multiplechoiceresponse>
</problem>""" </problem>"""
) )
world.save_component(step)
@step('I edit and enter an ampersand$')
def i_enter_bad_xml(step):
world.enter_xml_in_advanced_problem(step, "<problem>&</problem>")
@step('I get an error dialog$') @step('I get an error dialog$')
......
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