From a7219e8eaa596765f08c23fa39c32f409229f30d Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Thu, 27 Feb 2020 18:08:49 -0500 Subject: [PATCH] Use vulture to find unused bokchoy page objects. These were all un-used on master. --- .../test/acceptance/pages/lms/find_courses.py | 28 ------------ .../pages/lms/instructor_dashboard.py | 18 -------- .../acceptance/pages/lms/matlab_problem.py | 45 ------------------- .../acceptance/pages/lms/pay_and_verify.py | 34 -------------- .../acceptance/pages/lms/peer_calibrate.py | 44 ------------------ .../test/acceptance/pages/lms/peer_confirm.py | 35 --------------- .../test/acceptance/pages/lms/peer_grade.py | 39 ---------------- .../pages/studio/edit_subsection.py | 15 ------- .../tests/lms/test_lms_courseware.py | 2 +- 9 files changed, 1 insertion(+), 259 deletions(-) delete mode 100644 common/test/acceptance/pages/lms/find_courses.py delete mode 100644 common/test/acceptance/pages/lms/matlab_problem.py delete mode 100644 common/test/acceptance/pages/lms/peer_calibrate.py delete mode 100644 common/test/acceptance/pages/lms/peer_confirm.py delete mode 100644 common/test/acceptance/pages/lms/peer_grade.py delete mode 100644 common/test/acceptance/pages/studio/edit_subsection.py diff --git a/common/test/acceptance/pages/lms/find_courses.py b/common/test/acceptance/pages/lms/find_courses.py deleted file mode 100644 index 1edb8c4e5e..0000000000 --- a/common/test/acceptance/pages/lms/find_courses.py +++ /dev/null @@ -1,28 +0,0 @@ -""" -Find courses page (main page of the LMS). -""" - - -from bok_choy.page_object import PageObject - -from common.test.acceptance.pages.lms import BASE_URL - - -class FindCoursesPage(PageObject): - """ - Find courses page (main page of the LMS). - """ - - url = BASE_URL - - def is_browser_on_page(self): - return "edX" in self.browser.title - - @property - def course_id_list(self): - """ - Retrieve the list of available course IDs - on the page. - """ - - return self.q(css='article.course').attrs('id') diff --git a/common/test/acceptance/pages/lms/instructor_dashboard.py b/common/test/acceptance/pages/lms/instructor_dashboard.py index 7d71ea0fc2..725fc84377 100644 --- a/common/test/acceptance/pages/lms/instructor_dashboard.py +++ b/common/test/acceptance/pages/lms/instructor_dashboard.py @@ -1347,24 +1347,6 @@ class StudentSpecificAdmin(StudentAdminPage): TASK_HISTORY_TABLE_NAME = "task-history-single-table" -class CourseSpecificAdmin(StudentAdminPage): - """ - Course specific section of the Student Admin page. - """ - CONTAINER = ".course-specific-container" - - PROBLEM_INPUT_NAME = "problem-select-all" - STUDENT_EMAIL_INPUT_NAME = None - - RESET_ATTEMPTS_BUTTON_NAME = "reset-attempts-all" - RESCORE_BUTTON_NAME = "rescore-problem-all" - RESCORE_IF_HIGHER_BUTTON_NAME = "rescore-problem-all-if-higher" - DELETE_STATE_BUTTON_NAME = None - - BACKGROUND_TASKS_BUTTON_NAME = "task-history-all" - TASK_HISTORY_TABLE_NAME = "task-history-all-table" - - class EntranceExamAdmin(StudentAdminPage): """ Entrance exam section of the Student Admin page. diff --git a/common/test/acceptance/pages/lms/matlab_problem.py b/common/test/acceptance/pages/lms/matlab_problem.py deleted file mode 100644 index 54e0f8ce95..0000000000 --- a/common/test/acceptance/pages/lms/matlab_problem.py +++ /dev/null @@ -1,45 +0,0 @@ -""" -Matlab Problem Page. -""" - - -from bok_choy.page_object import PageObject - - -class MatlabProblemPage(PageObject): - """ - View of matlab problem page. - """ - - url = None - - def is_browser_on_page(self): - return self.q(css='.ungraded-matlab-result').present - - @property - def problem_name(self): - """ - Return the current problem name. - """ - return self.q(css='.problem-header').text[0] - - def set_response(self, response_str): - """ - Input a response to the prompt. - """ - input_css = "$('.CodeMirror')[0].CodeMirror.setValue('{}');".format(response_str) - self.browser.execute_script(input_css) - - def click_run_code(self): - """ - Click the run code button. - """ - self.q(css='input.save').click() - self.wait_for_ajax() - - def get_grader_msg(self, class_name): - """ - Returns the text value of given class. - """ - self.wait_for_element_visibility(class_name, 'Grader message is visible') - return self.q(css=class_name).text diff --git a/common/test/acceptance/pages/lms/pay_and_verify.py b/common/test/acceptance/pages/lms/pay_and_verify.py index 5dea559840..3bb15138df 100644 --- a/common/test/acceptance/pages/lms/pay_and_verify.py +++ b/common/test/acceptance/pages/lms/pay_and_verify.py @@ -166,37 +166,3 @@ class FakePaymentPage(PageObject): self.q(css="input[value='Submit']").click() return PaymentAndVerificationFlow(self.browser, self._course_id, entry_point='payment-confirmation').wait_for_page() - - -class FakeSoftwareSecureVerificationPage(PageObject): - """ - This page is a page used for testing that allows the user to change the status of their most recent - verification. - """ - - url = BASE_URL + '/verify_student/software-secure-fake-response' - - def is_browser_on_page(self): - """ Determine if browser is on the page. """ - message = self.q(css='BODY').text - if not message: - return False - - match = re.search('Fake Software Secure page', message[0]) - return True if match else False - - def mark_approved(self): - """ Mark the latest verification attempt as passing. """ - self.q(css='#btn_pass').click() - - def mark_denied(self): - """ Mark the latest verification attempt as denied. """ - self.q(css='#btn_denied').click() - - def mark_error(self): - """ Mark the latest verification attempt as an error. """ - self.q(css='#btn_error').click() - - def mark_unkown_error(self): - """ Mark the latest verification attempt as an unknown error. """ - self.q(css='#btn_unkonwn_error').click() diff --git a/common/test/acceptance/pages/lms/peer_calibrate.py b/common/test/acceptance/pages/lms/peer_calibrate.py deleted file mode 100644 index 7d5bd7b1c1..0000000000 --- a/common/test/acceptance/pages/lms/peer_calibrate.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -Page that allows the student to grade calibration essays -(requirement for being allowed to grade peers). -""" - - -from bok_choy.page_object import PageObject -from bok_choy.promise import Promise - - -class PeerCalibratePage(PageObject): - """ - Grade calibration essays. - """ - - url = None - - def is_browser_on_page(self): - - def _is_correct_page(): - is_present = ( - self.q(css='div.peer-grading-tools').present or - self.q(css='div.calibration-panel.current-state').present - ) - return is_present, is_present - - return Promise(_is_correct_page, 'On the peer grading calibration page.').fulfill() - - def continue_to_grading(self): - """ - Continue to peer grading after completing calibration. - """ - self.q(css='input.calibration-feedback-button').first.click() - - @property - def message(self): - """ - Return a message shown to the user, or None if no message is available. - """ - messages = self.q(css='div.peer-grading-tools > div.message-container > p').text - if len(messages) < 1: - return None - else: - return messages[0] diff --git a/common/test/acceptance/pages/lms/peer_confirm.py b/common/test/acceptance/pages/lms/peer_confirm.py deleted file mode 100644 index e055efadd2..0000000000 --- a/common/test/acceptance/pages/lms/peer_confirm.py +++ /dev/null @@ -1,35 +0,0 @@ -""" -Confirmation screen for peer calibration and grading. -""" - - -from bok_choy.page_object import PageObject -from bok_choy.promise import Promise - - -class PeerConfirmPage(PageObject): - """ - Confirmation for peer calibration and grading. - """ - - url = None - - def is_browser_on_page(self): - - def _is_correct_page(): - is_present = self.q(css='section.calibration-interstitial-page').present - return is_present, is_present - - return Promise(_is_correct_page, 'On the confirmation page for peer calibration and grading.').fulfill() - - def start(self, is_calibrating=False): - """ - Continue to the next section after the confirmation page. - If `is_calibrating` is false, try to continue to peer grading. - Otherwise, try to continue to calibration grading. - """ - if is_calibrating: - css_selector = 'input.calibration-interstitial-page-button' - else: - css_selector = 'input.interstitial-page-button' - self.q(css=css_selector).first.click() diff --git a/common/test/acceptance/pages/lms/peer_grade.py b/common/test/acceptance/pages/lms/peer_grade.py deleted file mode 100644 index b1824d8459..0000000000 --- a/common/test/acceptance/pages/lms/peer_grade.py +++ /dev/null @@ -1,39 +0,0 @@ -""" -Students grade peer submissions. -""" - - -from bok_choy.page_object import PageObject -from bok_choy.promise import Promise - - -class PeerGradePage(PageObject): - """ - Students grade peer submissions. - """ - - url = None - - def is_browser_on_page(self): - def _is_correct_page(): - is_present = ( - self.q(css='div.peer-grading-tools').present or - self.q(css='div.grading-panel.current-state').present - ) - return is_present, is_present - - return Promise(_is_correct_page, 'On the peer grading page.').fulfill() - - @property - def problem_list(self): - """ - Return the list of available problems to peer grade. - """ - return self.q(css='a.problem-button').text - - def select_problem(self, problem_name): - """ - Choose the problem with `problem_name` to start grading or calibrating. - """ - index = self.problem_list.index(problem_name) + 1 - self.q(css='a.problem-button:nth-of-type({})'.format(index)).first.click() diff --git a/common/test/acceptance/pages/studio/edit_subsection.py b/common/test/acceptance/pages/studio/edit_subsection.py deleted file mode 100644 index 2d4415e16c..0000000000 --- a/common/test/acceptance/pages/studio/edit_subsection.py +++ /dev/null @@ -1,15 +0,0 @@ -""" -Edit Subsection page in Studio -""" - - -from bok_choy.page_object import PageObject - - -class SubsectionPage(PageObject): - """ - Edit Subsection page in Studio - """ - - def is_browser_on_page(self): - return self.q(css='body.view-subsection').present diff --git a/common/test/acceptance/tests/lms/test_lms_courseware.py b/common/test/acceptance/tests/lms/test_lms_courseware.py index f04d60c82a..54781b1512 100644 --- a/common/test/acceptance/tests/lms/test_lms_courseware.py +++ b/common/test/acceptance/tests/lms/test_lms_courseware.py @@ -19,7 +19,7 @@ from ...pages.lms.course_home import CourseHomePage from ...pages.lms.courseware import CoursewarePage, CoursewareSequentialTabPage from ...pages.lms.create_mode import ModeCreationPage from ...pages.lms.dashboard import DashboardPage -from ...pages.lms.pay_and_verify import FakePaymentPage, FakeSoftwareSecureVerificationPage, PaymentAndVerificationFlow +from ...pages.lms.pay_and_verify import FakePaymentPage, PaymentAndVerificationFlow from ...pages.lms.problem import ProblemPage from ...pages.lms.progress import ProgressPage from ...pages.lms.track_selection import TrackSelectionPage