Merge pull request #1869 from edx/christina/export-error
On export error, handle quotes within string.
This commit is contained in:
@@ -161,9 +161,14 @@ def verify_all_setting_entries(expected_entries):
|
||||
|
||||
|
||||
@world.absorb
|
||||
def save_component_and_reopen(step):
|
||||
def save_component(step):
|
||||
world.css_click("a.save-button")
|
||||
world.wait_for_ajax_complete()
|
||||
|
||||
|
||||
@world.absorb
|
||||
def save_component_and_reopen(step):
|
||||
save_component(step)
|
||||
# We have a known issue that modifications are still shown within the edit window after cancel (though)
|
||||
# they are not persisted. Refresh the browser to make sure the changes WERE persisted after Save.
|
||||
reload_the_page(step)
|
||||
|
||||
11
cms/djangoapps/contentstore/features/course-export.feature
Normal file
11
cms/djangoapps/contentstore/features/course-export.feature
Normal file
@@ -0,0 +1,11 @@
|
||||
@shard_1
|
||||
Feature: Course export
|
||||
I want to export my course to a tar.gz file to share with others or check into source control
|
||||
|
||||
Scenario: User is directed to unit with bad XML 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 bad XML
|
||||
And I export the course
|
||||
Then I get an error dialog
|
||||
And I can click to go to the unit with the error
|
||||
44
cms/djangoapps/contentstore/features/course-export.py
Normal file
44
cms/djangoapps/contentstore/features/course-export.py
Normal file
@@ -0,0 +1,44 @@
|
||||
# disable missing docstring
|
||||
#pylint: disable=C0111
|
||||
|
||||
from lettuce import world, step
|
||||
from common import type_in_codemirror
|
||||
from nose.tools import assert_true, assert_equal
|
||||
|
||||
|
||||
@step('I export the course$')
|
||||
def i_export_the_course(step):
|
||||
world.click_tools()
|
||||
link_css = 'li.nav-course-tools-export a'
|
||||
world.css_click(link_css)
|
||||
world.css_click('a.action-export')
|
||||
|
||||
|
||||
@step('I edit and enter bad XML$')
|
||||
def i_enter_bad_xml(step):
|
||||
world.edit_component()
|
||||
type_in_codemirror(
|
||||
0,
|
||||
"""<problem><h1>Smallest Canvas</h1>
|
||||
<p>You want to make the smallest canvas you can.</p>
|
||||
<multiplechoiceresponse>
|
||||
<choicegroup type="MultipleChoice">
|
||||
<choice correct="false"><verbatim><canvas id="myCanvas" width = 10 height = 100> </canvas></verbatim></choice>
|
||||
<choice correct="true"><code><canvas id="myCanvas" width = 10 height = 10> </canvas></code></choice>
|
||||
</choicegroup>
|
||||
</multiplechoiceresponse>
|
||||
</problem>"""
|
||||
)
|
||||
world.save_component(step)
|
||||
|
||||
|
||||
@step('I get an error dialog$')
|
||||
def get_an_error_dialog(step):
|
||||
assert_true(world.is_css_present("div.prompt.error"))
|
||||
|
||||
|
||||
@step('I can click to go to the unit with the error$')
|
||||
def i_click_on_error_dialog(step):
|
||||
world.click_link_by_text('Correct failed component')
|
||||
assert_true(world.css_html("span.inline-error").startswith("Problem i4x://MITx/999/problem"))
|
||||
assert_equal(1, world.browser.url.count("unit/MITx.999.Robot_Super_Course/branch/draft/block/vertical"))
|
||||
@@ -15,7 +15,7 @@
|
||||
var hasUnit = ${json.dumps(bool(unit))},
|
||||
editUnitUrl = "${edit_unit_url or ""}",
|
||||
courseHomeUrl = "${course_home_url or ""}",
|
||||
errMsg = "${raw_err_msg or ""}";
|
||||
errMsg = ${json.dumps(raw_err_msg or "")};
|
||||
|
||||
require(["domReady!", "gettext", "js/views/feedback_prompt"], function(doc, gettext, PromptView) {
|
||||
var dialog;
|
||||
|
||||
Reference in New Issue
Block a user