diff --git a/cms/djangoapps/contentstore/features/grading.feature b/cms/djangoapps/contentstore/features/grading.feature index 4b5cacc159..0e0ce561ee 100644 --- a/cms/djangoapps/contentstore/features/grading.feature +++ b/cms/djangoapps/contentstore/features/grading.feature @@ -93,3 +93,9 @@ Feature: Course Grading And I press the "Save" notification button And I reload the page Then I see the highest grade range is "Good" + + Scenario: User cannot edit failing grade range name + Given I have opened a new course in Studio + And I have populated the course + And I am viewing the grading settings + Then I cannot edit the "Fail" grade range diff --git a/cms/djangoapps/contentstore/features/grading.py b/cms/djangoapps/contentstore/features/grading.py index 40cba61edc..bedab86bd9 100644 --- a/cms/djangoapps/contentstore/features/grading.py +++ b/cms/djangoapps/contentstore/features/grading.py @@ -4,6 +4,7 @@ from lettuce import world, step from common import * from terrain.steps import reload_the_page +from selenium.common.exceptions import InvalidElementStateException @step(u'I am viewing the grading settings') @@ -130,6 +131,18 @@ def i_see_highest_grade_range(_step, range_name): grade = world.css_find(range_css).first assert grade.value == range_name + +@step(u'I cannot edit the "Fail" grade range$') +def cannot_edit_fail(_step): + range_css = 'span.letter-grade' + ranges = world.css_find(range_css) + assert len(ranges) == 2 + try: + ranges.last.value = 'Failure' + assert False, "Should not be able to edit failing range" + except InvalidElementStateException: + pass # We should get this exception on failing to edit the element + def get_type_index(name): name_id = '#course-grading-assignment-name' all_types = world.css_find(name_id)