def test_edit_submissions_are_logged(self):
     project_overview = self.global_navigation_page.navigate_to_view_all_project_page().navigate_to_project_overview_page(
         self.project_title)
     web_submission_page = project_overview.navigate_to_web_questionnaire_page()
     web_submission_page.fill_and_submit_answer(VALID_ANSWERS)
     time.sleep(5)
     submission_log_page = web_submission_page.navigate_to_submission_log()
     #self.driver.wait_for_element(UI_TEST_TIMEOUT, by_css(".blockUI"), True)
     #self.driver.wait_until_element_is_not_present(UI_TEST_TIMEOUT, by_css(".blockUI"))
     time.sleep(3)
     submission_log_page.check_submission_by_row_number(1)
     submission_log_page.choose_on_dropdown_action(EDIT_BUTTON)
     edit_submission_page = WebSubmissionPage(self.driver)
     edit_submission_page.fill_and_submit_answer(EDITED_ANSWERS)
     self.driver.wait_for_element(5, by_css('.success-message-box'), want_visible=True)
     activity_log_page = self.navigate_to_activity_log_page()
     activity_log_page.select_filter('Data Submissions', 'Edited Data Submission(s)')
     time.sleep(3)
     self.assertEqual("Edited Data Submission(s)", activity_log_page.get_data_on_cell(row=1, column=2))
     self.assertTrue(activity_log_page.get_data_on_cell(row=1, column=3).startswith("Reporter Activities"))
     details_data = activity_log_page.get_data_on_cell(row=1, column=4)
     self.assertTrue("Submission Received on" in details_data)
     self.assertTrue("Changed Answers" in details_data)
     self.assertFalse("Changed Status" in details_data)
     self.assertTrue('Number of Docs: "5.0" to "4.0"' in details_data)
     self.assertTrue('Date of report: "12.01.2013" to "11.01.2013"' in details_data)
     self.assertTrue('Color of Eyes: "LIGHT RED" to "LIGHT YELLOW"' in details_data)
     self.assertTrue('Clinic admin name: "something" to "nothing"' in details_data)
     self.assertTrue('Bacterias in water: "Bacteroids" to "Aquificae, Bacteroids, Chlorobia"' in details_data)
     self.assertTrue('Geo points of Clinic: "-1,-1" to "1,1"' in details_data)
 def test_to_submit_data_on_behalf_of_another_datasender(self):
     datasender = "rep11"
     edited_datsender_to = 'rep10'
     web_submission_page = self.project_overview_page.navigate_to_web_questionnaire_page(
     )
     web_submission_page.select_checkbox_to_submit_on_behalf()
     web_submission_page.change_datasender(datasender)
     web_submission_page.fill_and_submit_answer(VALID_ANSWER)
     submission_log_page = web_submission_page.navigate_to_submission_log()
     submission_log_page.check_submission_by_row_number(1)
     submission_log_page.choose_on_dropdown_action(EDIT_BUTTON)
     edit_submission_page = WebSubmissionPage(self.driver)
     edit_submission_page.click_on_change_ds_link()
     edit_submission_page.change_datasender(edited_datsender_to)
     edit_submission_page.save_change_datasender()
     edit_submission_page.fill_and_submit_answer(EDITED_ANSWERS)
     self.driver.wait_for_element(5,
                                  by_css('.success-message-box'),
                                  want_visible=True)
     submission_log_page = edit_submission_page.navigate_to_submission_log()
     submission_log_page.get_total_number_of_rows()
     datasender_name = submission_log_page.get_cell_value(1, 2)
     edited_value = submission_log_page.get_cell_value(1, 5)
     status = submission_log_page.get_cell_value(1, 4)
     self.assertEquals('stefan rep10', datasender_name)
     self.assertEquals('4.0', edited_value)
     self.assertEquals('Success', status)
Exemplo n.º 3
0
 def _edit_data(self):
     analysis_page = self.project_overview_page.navigate_to_data_page()
     submission_log_page = analysis_page.navigate_to_all_data_record_page()
     submission_log_page.check_submission_by_row_number(1)
     submission_log_page.choose_on_dropdown_action(EDIT_BUTTON)
     submission_page = WebSubmissionPage(self.driver)
     submission_page.fill_and_submit_answer(EDITED_ANSWERS)
     self.assertEqual(submission_page.get_success_message(), "Your changes have been saved.", "Edit of web submission failed")
    def admin_edit_delete_submissions(self):
        submission_log_page = SubmissionLogPage(self.driver)
        submission_log_page.check_submission_by_row_number(1)
        submission_log_page.choose_on_dropdown_action(EDIT_BUTTON)

        submission_page = WebSubmissionPage(self.driver)
        submission_page.fill_and_submit_answer(EDITED_WEB_ANSWERS)
        self.verify_submission(EDITED_WEB_ANSWER_LOG, self.project_name)

        submission_log_page.check_submission_by_row_number(1)
        submission_log_page.choose_on_dropdown_action(DELETE_BUTTON)
        warning_dialog = WarningDialog(self.driver)
        warning_dialog.confirm()
        submission_log_page.wait_for_table_data_to_load()
        self.assertTrue(submission_log_page.empty_help_text())