From 16200827c5eac4d42ea66474584bbbca58e7f9e1 Mon Sep 17 00:00:00 2001 From: cahrens Date: Wed, 12 Feb 2014 11:31:36 -0500 Subject: [PATCH] Acceptance test for STUD-1311. --- cms/djangoapps/contentstore/features/common.py | 5 +++++ .../contentstore/features/problem-editor.feature | 9 +++++++++ cms/djangoapps/contentstore/features/problem-editor.py | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/cms/djangoapps/contentstore/features/common.py b/cms/djangoapps/contentstore/features/common.py index c97c5d1704..592352e7d9 100644 --- a/cms/djangoapps/contentstore/features/common.py +++ b/cms/djangoapps/contentstore/features/common.py @@ -396,6 +396,11 @@ def i_replace_w_draft(_step): world.css_click("a.publish-draft") +@step(u'I click on "delete draft"$') +def i_delete_draft(_step): + world.css_click("a.delete-draft") + + @step(u'I publish the unit$') def publish_unit(_step): world.select_option('visibility-select', 'public') diff --git a/cms/djangoapps/contentstore/features/problem-editor.feature b/cms/djangoapps/contentstore/features/problem-editor.feature index edcb1b93e2..b0fe18e514 100644 --- a/cms/djangoapps/contentstore/features/problem-editor.feature +++ b/cms/djangoapps/contentstore/features/problem-editor.feature @@ -95,6 +95,15 @@ Feature: CMS.Problem Editor And I delete "1" component Then I see no components + # This is a very specific scenario for a bug where editing a component in draft + # impacted the published version. + Scenario: Changes to draft problem do not impact published version + Given I have created a Blank Common Problem + When I publish the unit + And I click on "edit a draft" + And I change the display name to "draft" + And I click on "delete draft" + Then the problem display name is "Blank Common Problem" # Disabled 11/13/2013 after failing in master # The screenshot showed that the LaTeX editor had the text "hi", diff --git a/cms/djangoapps/contentstore/features/problem-editor.py b/cms/djangoapps/contentstore/features/problem-editor.py index b52fdc6ed6..d3df55af05 100644 --- a/cms/djangoapps/contentstore/features/problem-editor.py +++ b/cms/djangoapps/contentstore/features/problem-editor.py @@ -62,6 +62,11 @@ def my_display_name_change_is_persisted_on_save(step): verify_modified_display_name() +@step('the problem display name is "(.*)"$') +def verify_problem_display_name(step, name): + assert_equal(name.upper(), world.browser.find_by_css('.problem-header').text) + + @step('I can specify special characters in the display name') def i_can_modify_the_display_name_with_special_chars(_step): index = world.get_setting_entry_index(DISPLAY_NAME)