diff --git a/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py b/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py index 45fc568f23..9881290eba 100644 --- a/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py +++ b/cms/djangoapps/contentstore/features/component_settings_editor_helpers.py @@ -39,6 +39,7 @@ def click_new_component_button(step, component_button_css): ) world.css_click(component_button_css) + @world.absorb def click_component_from_menu(category, boilerplate, expected_css): """ @@ -63,11 +64,13 @@ def edit_component_and_select_settings(): world.css_click('a.edit-button') world.css_click('#settings-mode a') + @world.absorb def edit_component(): world.wait_for(lambda _driver: world.css_visible('a.edit-button')) world.css_click('a.edit-button') + @world.absorb def verify_setting_entry(setting, display_name, value, explicitly_set): """ @@ -97,6 +100,7 @@ def verify_setting_entry(setting, display_name, value, explicitly_set): assert_equal(explicitly_set, settingClearButton.has_class('active')) assert_equal(not explicitly_set, settingClearButton.has_class('inactive')) + @world.absorb def verify_all_setting_entries(expected_entries): settings = world.browser.find_by_css('.wrapper-comp-setting') @@ -107,6 +111,7 @@ def verify_all_setting_entries(expected_entries): expected_entries[counter][1], expected_entries[counter][2] ) + @world.absorb def save_component_and_reopen(step): world.css_click("a.save-button") @@ -116,6 +121,7 @@ def save_component_and_reopen(step): reload_the_page(step) edit_component_and_select_settings() + @world.absorb def cancel_component(step): world.css_click("a.cancel-button") @@ -123,10 +129,12 @@ def cancel_component(step): # they are not persisted. Refresh the browser to make sure the changes were not persisted. reload_the_page(step) + @world.absorb def revert_setting_entry(label): get_setting_entry(label).find_by_css('.setting-clear')[0].click() + @world.absorb def get_setting_entry(label): def get_setting(): diff --git a/cms/djangoapps/contentstore/features/import.py b/cms/djangoapps/contentstore/features/import.py index 1efb40e974..d1dec5da4c 100644 --- a/cms/djangoapps/contentstore/features/import.py +++ b/cms/djangoapps/contentstore/features/import.py @@ -9,14 +9,13 @@ def import_file(filename): world.browser.attach_file('course-data', os.path.abspath(path)) world.css_click('input.submit-button') # Go to course outline - menu_css = 'li.nav-course-courseware' + world.click_course_content() outline_css = 'li.nav-course-courseware-outline a' - world.css_click(menu_css) world.css_click(outline_css) + @world.absorb def go_to_import(): - menu_css = 'li.nav-course-tools' + world.click_course_content() import_css = 'li.nav-course-tools-import a' - world.css_click(menu_css) world.css_click(import_css) diff --git a/cms/djangoapps/contentstore/features/problem-editor.feature b/cms/djangoapps/contentstore/features/problem-editor.feature index e73bdee81b..2a8f231e16 100644 --- a/cms/djangoapps/contentstore/features/problem-editor.feature +++ b/cms/djangoapps/contentstore/features/problem-editor.feature @@ -3,7 +3,7 @@ Feature: CMS.Problem Editor As a course author, I want to be able to create problems and edit their settings. Scenario: User can view metadata - Given I have an empty course + Given I have created a Blank Common Problem When I edit and select Settings Then I see the advanced settings and their expected values And Edit High Level Source is not visible @@ -91,7 +91,7 @@ Feature: CMS.Problem Editor And when I view the High Level Source I see my changes Scenario: Exceptions don't cause problem to be uneditable (bug STUD-786) - Given I have created a Blank Common Problem + Given I have an empty course And I go to the import page And I import the file "get_html_exception_test.tar.gz" When I go to the unit "Probability and BMI" diff --git a/cms/djangoapps/contentstore/features/problem-editor.py b/cms/djangoapps/contentstore/features/problem-editor.py index 49c884e082..3b614bc028 100644 --- a/cms/djangoapps/contentstore/features/problem-editor.py +++ b/cms/djangoapps/contentstore/features/problem-editor.py @@ -6,7 +6,6 @@ import json from lettuce import world, step from nose.tools import assert_equal, assert_true # pylint: disable=E0611 from common import type_in_codemirror -from time import sleep DISPLAY_NAME = "Display Name" @@ -199,10 +198,12 @@ def high_level_source_in_editor(_step): open_high_level_source() assert_equal('hi', world.css_value('.source-edit-box')) + @step(u'I have an empty course') def i_have_empty_course(step): step.given('I have clicked the new unit button') + @step(u'I go to the import page') def i_go_to_import(_step): world.go_to_import() @@ -215,7 +216,6 @@ def i_import_the_file(_step, filename): @step(u'I click on the link "([^"]*)"$') def i_click_on(_step, link): - #go = "$(\"a:contains('{0}')\").click()".format(link) world.browser.click_link_by_text(link) @@ -232,7 +232,7 @@ def i_go_to_unit(_step, unit): @step(u'I see a message that says "([^"]*)"$') def i_can_see_message(_step, msg): - msg = json.dumps(msg) # escape quotes + msg = json.dumps(msg) # escape quotes world.browser.is_text_present(msg) diff --git a/cms/djangoapps/contentstore/views/preview.py b/cms/djangoapps/contentstore/views/preview.py index 22a0af8171..5aec46c5d7 100644 --- a/cms/djangoapps/contentstore/views/preview.py +++ b/cms/djangoapps/contentstore/views/preview.py @@ -79,13 +79,12 @@ def preview_component(request, location): # can bind to it correctly component.runtime.wrappers.append(partial(wrap_xmodule, 'xmodule_edit.html')) - try: content = component.render('studio_view').content # catch exceptions indiscriminately, since after this point they escape the # dungeon and surface as uneditable, unsaveable, and undeletable # component-goblins. - except Exception as exc: #pylint: disable=W0703 + except Exception as exc: # pylint: disable=W0703 content = render_to_string('html_error.html', {'message': str(exc)}) return render_to_response('component.html', { @@ -168,6 +167,6 @@ def get_preview_html(request, descriptor, idx): module = load_preview_module(request, str(idx), descriptor) try: content = module.render("student_view").content - except Exception as exc: #pylint: disable=W0703 + except Exception as exc: # pylint: disable=W0703 content = render_to_string('html_error.html', {'message': str(exc)}) return content diff --git a/common/test/data/get_html_exception_test/about/overview.html b/common/test/data/get_html_exception_test/about/overview.html deleted file mode 100644 index 961786b8f4..0000000000 --- a/common/test/data/get_html_exception_test/about/overview.html +++ /dev/null @@ -1,47 +0,0 @@ -
-

About This Course

-

Include your long course description here. The long course description should contain 150-400 words.

- -

This is paragraph 2 of the long course description. Add more paragraphs as needed. Make sure to enclose them in paragraph tags.

-
- -
-

Prerequisites

-

Add information about course prerequisites here.

-
- -
-

Course Staff

-
-
- -
- -

Staff Member #1

-

Biography of instructor/staff member #1

-
- -
-
- -
- -

Staff Member #2

-

Biography of instructor/staff member #2

-
-
- -
-
-

Frequently Asked Questions

-
-

Do I need to buy a textbook?

-

No, a free online version of Chemistry: Principles, Patterns, and Applications, First Edition by Bruce Averill and Patricia Eldredge will be available, though you can purchase a printed version (published by FlatWorld Knowledge) if you’d like.

-
- -
-

Question #2

-

Your answer would be displayed here.

-
-
-
diff --git a/common/test/data/get_html_exception_test/chapter/Week_1.xml b/common/test/data/get_html_exception_test/chapter/Week_1.xml deleted file mode 100644 index c6e1295a69..0000000000 --- a/common/test/data/get_html_exception_test/chapter/Week_1.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/common/test/data/get_html_exception_test/course.xml b/common/test/data/get_html_exception_test/course.xml deleted file mode 100644 index bedccb4153..0000000000 --- a/common/test/data/get_html_exception_test/course.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/common/test/data/get_html_exception_test/course/hakj.xml b/common/test/data/get_html_exception_test/course/hakj.xml deleted file mode 100644 index cd83c98bac..0000000000 --- a/common/test/data/get_html_exception_test/course/hakj.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/common/test/data/get_html_exception_test/custom_tags/book b/common/test/data/get_html_exception_test/custom_tags/book deleted file mode 100644 index 8b13789179..0000000000 --- a/common/test/data/get_html_exception_test/custom_tags/book +++ /dev/null @@ -1 +0,0 @@ - diff --git a/common/test/data/get_html_exception_test/custom_tags/discuss b/common/test/data/get_html_exception_test/custom_tags/discuss deleted file mode 100644 index ac56590074..0000000000 --- a/common/test/data/get_html_exception_test/custom_tags/discuss +++ /dev/null @@ -1 +0,0 @@ - Discussion: ${tag} \ No newline at end of file diff --git a/common/test/data/get_html_exception_test/custom_tags/handout b/common/test/data/get_html_exception_test/custom_tags/handout deleted file mode 100644 index 014e6f3305..0000000000 --- a/common/test/data/get_html_exception_test/custom_tags/handout +++ /dev/null @@ -1 +0,0 @@ - ${text_of_link} diff --git a/common/test/data/get_html_exception_test/custom_tags/image b/common/test/data/get_html_exception_test/custom_tags/image deleted file mode 100644 index d2939ba88c..0000000000 --- a/common/test/data/get_html_exception_test/custom_tags/image +++ /dev/null @@ -1 +0,0 @@ - diff --git a/common/test/data/get_html_exception_test/custom_tags/link b/common/test/data/get_html_exception_test/custom_tags/link deleted file mode 100644 index e389844059..0000000000 --- a/common/test/data/get_html_exception_test/custom_tags/link +++ /dev/null @@ -1 +0,0 @@ - ${text_of_link} diff --git a/common/test/data/get_html_exception_test/custom_tags/slides b/common/test/data/get_html_exception_test/custom_tags/slides deleted file mode 100644 index 7a33ffd6c7..0000000000 --- a/common/test/data/get_html_exception_test/custom_tags/slides +++ /dev/null @@ -1 +0,0 @@ -Lecture Slides Handout [Clean ][Annotated] \ No newline at end of file diff --git a/common/test/data/get_html_exception_test/policies/assets.json b/common/test/data/get_html_exception_test/policies/assets.json deleted file mode 100644 index 9e26dfeeb6..0000000000 --- a/common/test/data/get_html_exception_test/policies/assets.json +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/common/test/data/get_html_exception_test/policies/hakj/grading_policy.json b/common/test/data/get_html_exception_test/policies/hakj/grading_policy.json deleted file mode 100644 index 272cb4fec6..0000000000 --- a/common/test/data/get_html_exception_test/policies/hakj/grading_policy.json +++ /dev/null @@ -1 +0,0 @@ -{"GRADER": [{"short_label": "HW", "min_count": 12, "type": "Homework", "drop_count": 2, "weight": 0.15}, {"min_count": 12, "type": "Lab", "drop_count": 2, "weight": 0.15}, {"short_label": "Midterm", "min_count": 1, "type": "Midterm Exam", "drop_count": 0, "weight": 0.3}, {"short_label": "Final", "min_count": 1, "type": "Final Exam", "drop_count": 0, "weight": 0.4}], "GRADE_CUTOFFS": {"Pass": 0.5}} \ No newline at end of file diff --git a/common/test/data/get_html_exception_test/policies/hakj/policy.json b/common/test/data/get_html_exception_test/policies/hakj/policy.json deleted file mode 100644 index defbd8245d..0000000000 --- a/common/test/data/get_html_exception_test/policies/hakj/policy.json +++ /dev/null @@ -1 +0,0 @@ -{"course/hakj": {"ispublic": false, "graded": false, "tabs": [{"type": "courseware"}, {"type": "course_info", "name": "Course Info"}, {"type": "textbooks"}, {"type": "discussion", "name": "Discussion"}, {"type": "wiki", "name": "Wiki"}, {"type": "progress", "name": "Progress"}], "remote_gradebook": {}, "giturl": null, "discussion_topics": {"General": {"id": "i4x-edx-ctt101-course-html_exception_test"}}, "due": null, "source_file": null, "html_textbooks": [], "announcement": null, "showanswer": "attempted", "display_name": "Principles of Biostatistics", "graceperiod": "900 seconds", "allow_anonymous": false, "tags": [], "enrollment_start": "2013-08-26T04:00:00Z", "start": "2013-08-26T04:00:00Z", "xml_attributes": {"filename": ["course/html_exception_test.xml", "course/html_exception_test.xml"]}, "pdf_textbooks": [], "days_early_for_beta": 100, "advanced_modules": [], "format": null, "xqa_key": "AlQ7TjCl7Rfhc0Am6WguqjeUzGz7AuVt", "enrollment_end": "2013-09-25T04:00:00Z", "end": "2013-12-20T05:00:00Z", "show_calculator": "Yes", "hide_from_toc": false, "rerandomize": "never", "cohort_config": {}}} \ No newline at end of file diff --git a/common/test/data/get_html_exception_test/sequential/8af0ab4186c04c2eb08a92926e36d1ce.xml b/common/test/data/get_html_exception_test/sequential/8af0ab4186c04c2eb08a92926e36d1ce.xml deleted file mode 100644 index 5885a6ae5c..0000000000 --- a/common/test/data/get_html_exception_test/sequential/8af0ab4186c04c2eb08a92926e36d1ce.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/common/test/data/get_html_exception_test/vertical/vertical_74cca8afc761.xml b/common/test/data/get_html_exception_test/vertical/vertical_74cca8afc761.xml deleted file mode 100644 index 7a02d7565c..0000000000 --- a/common/test/data/get_html_exception_test/vertical/vertical_74cca8afc761.xml +++ /dev/null @@ -1,3 +0,0 @@ - - PDF of Problem Set 3 -