From 354b8a4d501cf674d217fa3d23f7082bada02281 Mon Sep 17 00:00:00 2001 From: Sarah Fischmann Date: Wed, 26 Jul 2017 14:12:43 -0400 Subject: [PATCH] Fixing flaky edx-proctoring acceptance tests This commit fixes four flaky bokchoy tests: test_can_add_remove_allowance, test_can_reset_attempts, test_rescore_nonrescorable and test_timed_exam_flow. EDUCATOR-949 Fixed 2 of 3 flaky tests EDUCATOR-949 possible fix for third failing test Another possible fix for third flaky test starting tests again starting tests again removing flaky decorators possible fix for fourth flaky test fixing quality errors removing flaky decorator from fourth test --- common/test/acceptance/pages/lms/instructor_dashboard.py | 8 +++++--- common/test/acceptance/tests/lms/test_lms_courseware.py | 1 + .../acceptance/tests/lms/test_lms_instructor_dashboard.py | 4 +--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/common/test/acceptance/pages/lms/instructor_dashboard.py b/common/test/acceptance/pages/lms/instructor_dashboard.py index 6b59e6ac00..ea0f7b0a1f 100644 --- a/common/test/acceptance/pages/lms/instructor_dashboard.py +++ b/common/test/acceptance/pages/lms/instructor_dashboard.py @@ -119,9 +119,11 @@ class InstructorDashboardPage(CoursePage): return ecommerce_section def is_rescore_unsupported_message_visible(self): - return u'This component cannot be rescored.' in unicode( - self.q(css='.request-response-error').html - ) + if (self.q(css='.request-response-error').present): + return u'This component cannot be rescored.' in unicode( + self.q(css='.request-response-error').html + ) + return False @staticmethod def get_asset_path(file_name): diff --git a/common/test/acceptance/tests/lms/test_lms_courseware.py b/common/test/acceptance/tests/lms/test_lms_courseware.py index e86fd7e78d..1219ddd1a8 100644 --- a/common/test/acceptance/tests/lms/test_lms_courseware.py +++ b/common/test/acceptance/tests/lms/test_lms_courseware.py @@ -285,6 +285,7 @@ class ProctoredExamTest(UniqueCourseTest): self.assertTrue(self.courseware_page.is_timer_bar_present) self.courseware_page.stop_timed_exam() + self.courseware_page.wait_for_page() self.assertTrue(self.courseware_page.has_submitted_exam_message()) LogoutPage(self.browser).visit() diff --git a/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py b/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py index fe1147f7a1..287b665f09 100644 --- a/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py +++ b/common/test/acceptance/tests/lms/test_lms_instructor_dashboard.py @@ -395,8 +395,8 @@ class ProctoredExamsTest(BaseInstructorDashboardTest): # Stop the timed exam. self.courseware_page.stop_timed_exam() + LogoutPage(self.browser).visit() - @skip("EDUCATOR-949") def test_can_add_remove_allowance(self): """ Make sure that allowances can be added and removed. @@ -426,7 +426,6 @@ class ProctoredExamsTest(BaseInstructorDashboardTest): # Then, the added record should be visible self.assertTrue(allowance_section.is_allowance_record_visible) - @skip("EDUCATOR-551, EDUCATOR-949") def test_can_reset_attempts(self): """ Make sure that Exam attempts are visible and can be reset. @@ -1375,7 +1374,6 @@ class StudentAdminTest(BaseInstructorDashboardTest): self.username, _ = self.log_in_as_instructor() self.instructor_dashboard_page = self.visit_instructor_dashboard() - @skip("EDUCATOR-552, EDUCATOR-949") def test_rescore_nonrescorable(self): student_admin_section = self.instructor_dashboard_page.select_student_admin(StudentSpecificAdmin) student_admin_section.set_student_email_or_username(self.username)