Fix many validation bugs and failing tests.
This commit is contained in:
@@ -68,7 +68,7 @@ def press_the_notification_button(_step, name):
|
||||
error_showing = world.is_css_present('.is-shown.wrapper-notification-error')
|
||||
return confirmation_dismissed or error_showing
|
||||
|
||||
assert_true(world.css_click(css, success_condition=button_clicked), '%s button not clicked after 5 attempts.' % name)
|
||||
world.css_click(css, success_condition=button_clicked), '%s button not clicked after 5 attempts.' % name
|
||||
|
||||
|
||||
@step('I change the "(.*)" field to "(.*)"$')
|
||||
@@ -228,6 +228,13 @@ def shows_captions(step, show_captions):
|
||||
assert world.is_css_not_present('.video.closed')
|
||||
|
||||
|
||||
@step('the save button is disabled$')
|
||||
def save_button_disabled(step):
|
||||
button_css = '.action-save'
|
||||
disabled = 'is-disabled'
|
||||
assert world.css_find(button_css)[0].has_class(disabled)
|
||||
|
||||
|
||||
def type_in_codemirror(index, text):
|
||||
world.css_click(".CodeMirror", index=index)
|
||||
g = world.css_find("div.CodeMirror.CodeMirror-focused > div > textarea")
|
||||
|
||||
@@ -65,3 +65,9 @@ Feature: Course Settings
|
||||
And I change the course overview
|
||||
And I press the "Save" notification button
|
||||
Then I see a confirmation that my changes have been saved
|
||||
|
||||
Scenario: User cannot save invalid settings
|
||||
Given I have opened a new course in Studio
|
||||
When I select Schedule and Details
|
||||
And I change the "Course Start Date" field to ""
|
||||
Then the save button is disabled
|
||||
|
||||
@@ -77,3 +77,10 @@ Feature: Course Grading
|
||||
When I change assignment type "Homework" to "New Type"
|
||||
And I press the "Save" notification button
|
||||
Then I see a confirmation that my changes have been saved
|
||||
|
||||
Scenario: User cannot save invalid settings
|
||||
Given I have opened a new course in Studio
|
||||
And I have populated the course
|
||||
And I am viewing the grading settings
|
||||
When I change assignment type "Homework" to ""
|
||||
Then the save button is disabled
|
||||
|
||||
@@ -60,8 +60,6 @@ def change_assignment_name(step, old_name, new_name):
|
||||
for count in range(len(old_name)):
|
||||
f._element.send_keys(Keys.END, Keys.BACK_SPACE)
|
||||
f._element.send_keys(new_name)
|
||||
# Without this, the "you've made changes" notification won't pop up
|
||||
f._element.send_keys(Keys.ENTER)
|
||||
|
||||
|
||||
@step(u'I go back to the main course page')
|
||||
@@ -94,8 +92,6 @@ def add_assignment_type(step, new_name):
|
||||
name_id = '#course-grading-assignment-name'
|
||||
f = world.css_find(name_id)[4]
|
||||
f._element.send_keys(new_name)
|
||||
# Without this, the "you've made changes" notification won't pop up
|
||||
f._element.send_keys(Keys.ENTER)
|
||||
|
||||
|
||||
@step(u'I have populated the course')
|
||||
|
||||
Reference in New Issue
Block a user