Fix acceptance tests to work w/ split

11300
This commit is contained in:
Don Mitchell
2014-09-16 12:57:20 -04:00
parent 4ca5012f3c
commit 8fe55c9aee
5 changed files with 38 additions and 29 deletions

View File

@@ -50,11 +50,17 @@ def get_an_error_dialog(step):
@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"))
course_key = SlashSeparatedCourseKey("MITx", "999", "Robot_Super_Course")
problem_string = unicode(world.scenario_dict['COURSE'].id.make_usage_key("problem", 'ignore'))
problem_string = u"Problem {}".format(problem_string[:problem_string.rfind('ignore')])
assert_true(
world.css_html("span.inline-error").startswith(problem_string),
u"{} does not start with {}".format(
world.css_html("span.inline-error"), problem_string
))
# we don't know the actual ID of the vertical. So just check that we did go to a
# vertical page in the course (there should only be one).
vertical_usage_key = course_key.make_usage_key("vertical", None)
vertical_usage_key = world.scenario_dict['COURSE'].id.make_usage_key("vertical", None)
vertical_url = reverse_usage_url('container_handler', vertical_usage_key)
# Remove the trailing "/None" from the URL - we don't know the course ID, so we just want to
# check that we visited a vertical URL.

View File

@@ -24,14 +24,14 @@ Feature: CMS.HTML Editor
Given I have created a Blank HTML Page
When I edit the page
And I add an image with static link "/static/image.jpg" via the Image Plugin Icon
Then the src link is rewritten to "c4x/MITx/999/asset/image.jpg"
Then the src link is rewritten to the asset link "image.jpg"
And the link is shown as "/static/image.jpg" in the Image Plugin
Scenario: TinyMCE link plugin sets urls correctly
Given I have created a Blank HTML Page
When I edit the page
And I add a link with static link "/static/image.jpg" via the Link Plugin Icon
Then the href link is rewritten to "c4x/MITx/999/asset/image.jpg"
Then the href link is rewritten to the asset link "image.jpg"
And the link is shown as "/static/image.jpg" in the Link Plugin
Scenario: TinyMCE and CodeMirror preserve style tags
@@ -76,7 +76,7 @@ Feature: CMS.HTML Editor
Given I have created a Blank HTML Page
When I edit the page
And type "<img src="/static/image.jpg">" in the code editor and press OK
Then the src link is rewritten to "c4x/MITx/999/asset/image.jpg"
Then the src link is rewritten to the asset link "image.jpg"
And the code editor displays "<p><img src="/static/image.jpg" /></p>"
Scenario: Code format toolbar button wraps text with code tags

View File

@@ -155,20 +155,20 @@ def check_raw_editor_text(step):
assert_equal(step.multiline, get_codemirror_value(0))
@step('the src link is rewritten to "(.*)"$')
@step('the src link is rewritten to the asset link "(.*)"$')
def image_static_link_is_rewritten(step, path):
# Find the TinyMCE iframe within the main window
with world.browser.get_iframe('mce_0_ifr') as tinymce:
image = tinymce.find_by_tag('img').first
assert_in(path, image['src'])
assert_in(unicode(world.scenario_dict['COURSE'].id.make_asset_key('asset', path)), image['src'])
@step('the href link is rewritten to "(.*)"$')
@step('the href link is rewritten to the asset link "(.*)"$')
def link_static_link_is_rewritten(step, path):
# Find the TinyMCE iframe within the main window
with world.browser.get_iframe('mce_0_ifr') as tinymce:
link = tinymce.find_by_tag('a').first
assert_in(path, link['href'])
assert_in(unicode(world.scenario_dict['COURSE'].id.make_asset_key('asset', path)), link['href'])
@step('the expected toolbar buttons are displayed$')