Commit b7485fd8 by Julian Arni

Review fixes

parent 9f188ed2
......@@ -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():
......
......@@ -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)
......@@ -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"
......
......@@ -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)
......
......@@ -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
<section class="about">
<h2>About This Course</h2>
<p>Include your long course description here. The long course description should contain 150-400 words.</p>
<p>This is paragraph 2 of the long course description. Add more paragraphs as needed. Make sure to enclose them in paragraph tags.</p>
</section>
<section class="prerequisites">
<h2>Prerequisites</h2>
<p>Add information about course prerequisites here.</p>
</section>
<section class="course-staff">
<h2>Course Staff</h2>
<article class="teacher">
<div class="teacher-image">
<img src="/static/images/pl-faculty.png" align="left" style="margin:0 20 px 0">
</div>
<h3>Staff Member #1</h3>
<p>Biography of instructor/staff member #1</p>
</article>
<article class="teacher">
<div class="teacher-image">
<img src="/static/images/pl-faculty.png" align="left" style="margin:0 20 px 0">
</div>
<h3>Staff Member #2</h3>
<p>Biography of instructor/staff member #2</p>
</article>
</section>
<section class="faq">
<section class="responses">
<h2>Frequently Asked Questions</h2>
<article class="response">
<h3>Do I need to buy a textbook?</h3>
<p>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.</p>
</article>
<article class="response">
<h3>Question #2</h3>
<p>Your answer would be displayed here.</p>
</article>
</section>
</section>
<chapter display_name="Week 1" showanswer="attempted" start="2011-09-19T21:00:00Z">
<sequential url_name="8af0ab4186c04c2eb08a92926e36d1ce"/>
</chapter>
<course url_name="hakj" org="hajkslkjads" course="hksj"/>
<course advanced_modules="[]" allow_anonymous="false" announcement="null" cohort_config="{}" days_early_for_beta="100" display_name="Principles of Biostatistics" due="null" end="2013-12-20T05:00:00Z" enrollment_end="2013-09-25T04:00:00Z" enrollment_start="2013-08-26T04:00:00Z" format="null" giturl="null" graceperiod="900 seconds" graded="false" hide_from_toc="false" html_textbooks="[]" ispublic="false" pdf_textbooks="[]" remote_gradebook="{}" rerandomize="never" show_calculator="Yes" showanswer="attempted" source_file="null" start="2013-08-26T04:00:00Z" tags="[]" xqa_key="AlQ7TjCl7Rfhc0Am6WguqjeUzGz7AuVt">
<chapter url_name="Week_1"/>
</course>
<a href='https://6002x.mitx.mit.edu/discussion/questions/scope:all/sort:activity-desc/tags:${tag}/page:1/'> Discussion: ${tag} </a>
\ No newline at end of file
<a href="/static/handouts/${handout_name}" target="_blank"> ${text_of_link} </a>
<img src="http://pmitros.csail.mit.edu/tutorial/images/${file}" />
<a href="${url_to_link_to}" target="_blank"> ${text_of_link} </a>
Lecture Slides Handout [<a href="/static/handouts/6002-L${lecnum}-oei12-gaps.pdf">Clean </a>][<a href="/static/handouts/6002-L${lecnum}-oei12-gaps-annotated.pdf">Annotated</a>]
\ No newline at end of file
{"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
{"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
<sequential display_name="Homework 3" due="2013-09-28T04:00:00Z" format="Problem Set" graded="true" start="2013-09-19T21:00:00Z">
<vertical url_name="vertical_74cca8afc761"/>
</sequential>
<vertical display_name="Probability and BMI ">
<customtag href="/static/bio200_hw3_2013_handout.pdf" handout_name="HandoutWeek3ProblemSet.pdf" text_of_link="PDF of Problem Set 3" url_name="customtag_4a3d46019e44">PDF of Problem Set 3</customtag>
</vertical>
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