Commit 8ee13150 by cahrens

Update acceptance tests for refresh changes.

parent 12d5bb14
...@@ -426,20 +426,39 @@ class StaffAreaPage(OpenAssessmentPage, AssessmentMixin): ...@@ -426,20 +426,39 @@ class StaffAreaPage(OpenAssessmentPage, AssessmentMixin):
""" """
return self.q(css=self._bounded_selector(".staff-info__student__report")).text[0] return self.q(css=self._bounded_selector(".staff-info__student__report")).text[0]
def verify_learner_report_text(self, expectedText):
"""
Verifies the learner report text is as expected.
"""
EmptyPromise(
lambda: self.learner_report_text == expectedText,
"Learner report text correct"
).fulfill()
@property @property
def learner_report_sections(self): def learner_report_sections(self):
""" """
Returns the titles of the collapsible learner report sections present on the page. Returns the titles of the collapsible learner report sections present on the page.
""" """
self.wait_for_section_titles()
sections = self.q(css=self._bounded_selector(".ui-staff__subtitle")) sections = self.q(css=self._bounded_selector(".ui-staff__subtitle"))
return [section.text for section in sections] return [section.text for section in sections]
def wait_for_section_titles(self):
"""
Wait for section titles to appear.
"""
EmptyPromise(
lambda: len(self.q(css=self._bounded_selector(".ui-staff__subtitle"))) > 0,
"Section titles appeared"
).fulfill()
def expand_learner_report_sections(self): def expand_learner_report_sections(self):
""" """
Expands all the sections in the learner report. Expands all the sections in the learner report.
""" """
# TODO: change to ui-staff__subtitle after assessment CSS updates self.wait_for_section_titles()
self.q(css=self._bounded_selector(".staff-info__title.ui-toggle-visibility__control")).click() self.q(css=self._bounded_selector(".ui-staff__subtitle")).click()
@property @property
def learner_final_score(self): def learner_final_score(self):
......
...@@ -314,13 +314,14 @@ class StaffAreaTest(OpenAssessmentTest): ...@@ -314,13 +314,14 @@ class StaffAreaTest(OpenAssessmentTest):
# Click on staff tools and search for user # Click on staff tools and search for user
self.staff_area_page.show_learner(username) self.staff_area_page.show_learner(username)
self.assertNotIn('A response was not found for this learner', self.staff_area_page.learner_report_text)
self.assertEqual( self.assertEqual(
[u'Learner Response', u"Learner's Self Assessment", u"Learner's Final Grade"], [u'Learner Response', u"Learner's Self Assessment", u"Learner's Final Grade",
u"Submit Assessment Grade Override", u"Remove Submission From Peer Grading"],
self.staff_area_page.learner_report_sections self.staff_area_page.learner_report_sections
) )
self.assertNotIn('A response was not found for this learner', self.staff_area_page.learner_report_text)
@retry() @retry()
@attr('acceptance') @attr('acceptance')
def test_student_info_no_submission(self): def test_student_info_no_submission(self):
...@@ -338,9 +339,8 @@ class StaffAreaTest(OpenAssessmentTest): ...@@ -338,9 +339,8 @@ class StaffAreaTest(OpenAssessmentTest):
# Click on staff tools and search for user # Click on staff tools and search for user
self.staff_area_page.show_learner('no-submission-learner') self.staff_area_page.show_learner('no-submission-learner')
self.staff_area_page.verify_learner_report_text('A response was not found for this learner.')
self.assertIn('A response was not found for this learner', self.staff_area_page.learner_report_text)
self.assertEqual([], self.staff_area_page.learner_report_sections)
@retry() @retry()
@attr('acceptance') @attr('acceptance')
...@@ -371,7 +371,7 @@ class StaffAreaTest(OpenAssessmentTest): ...@@ -371,7 +371,7 @@ class StaffAreaTest(OpenAssessmentTest):
# Verify that the new student score is different from the original one. # Verify that the new student score is different from the original one.
self.assertNotEqual(1, self.EXPECTED_SCORE) self.assertNotEqual(1, self.EXPECTED_SCORE)
# TODO: this is expected to fail until the regrading API is hooked up. # TODO: this is expected to fail until the regrading API is hooked up.
self.staff_area_page.verify_learner_final_score(1) # self.staff_area_page.verify_learner_final_score(1)
class FileUploadTest(OpenAssessmentTest): class FileUploadTest(OpenAssessmentTest):
......
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