fixed flaky test from grading
This commit is contained in:
@@ -73,9 +73,14 @@ class GradingPage(SettingsPage):
|
||||
Drag and drop grade range.
|
||||
"""
|
||||
self.wait_for_element_visibility(self.grade_ranges, "Grades ranges are visible")
|
||||
# We have used jquery here to adjust the width of slider to
|
||||
# desired range because drag and drop has behaved very inconsistently.
|
||||
# This does not updates the text of range on the slider.
|
||||
# So as a work around, we have used drag_and_drop without any offset
|
||||
self.browser.execute_script('$(".ui-resizable").css("width","10")')
|
||||
action = ActionChains(self.browser)
|
||||
moveable_css = self.q(css='.ui-resizable-e').results[0]
|
||||
action.drag_and_drop_by_offset(moveable_css, 100, 0).perform()
|
||||
action.drag_and_drop_by_offset(moveable_css, 0, 0).perform()
|
||||
|
||||
@property
|
||||
def grade_letters(self):
|
||||
|
||||
@@ -112,3 +112,21 @@ class GradingPageTest(StudioCourseTest):
|
||||
self.grading_page.remove_grades(1)
|
||||
total_number_of_grades = self.grading_page.total_number_of_grades
|
||||
self.assertEqual(total_number_of_grades, 2)
|
||||
|
||||
def test_staff_can_move_grading_ranges(self):
|
||||
"""
|
||||
Scenario: Users can move grading ranges
|
||||
Given I have opened a new course in Studio
|
||||
And I am viewing the grading settings
|
||||
When I move a grading section
|
||||
Then I see that the grade range has changed
|
||||
"""
|
||||
grade_ranges = self.grading_page.grades_range
|
||||
self.assertIn('0-50', grade_ranges)
|
||||
self.grading_page.drag_and_drop_grade()
|
||||
grade_ranges = self.grading_page.grades_range
|
||||
self.assertIn(
|
||||
'0-3',
|
||||
grade_ranges,
|
||||
'expected range: 0-3, not found in grade ranges:{}'.format(grade_ranges)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user