def test_should_update_submission_log_when_DS_info_is_edited(self): all_project_page = self.dashboard.navigate_to_view_all_project_page() project_overview_page = all_project_page.navigate_to_project_overview_page( "clinic test project1") my_data_sender_page = project_overview_page.navigate_to_datasenders_page( ) add_ds_page = my_data_sender_page.navigate_to_add_a_data_sender_page() add_ds_page.enter_data_sender_details_from(DATASENDER_DETAILS) ds_id = add_ds_page.get_registered_datasender_id() send_valid_sms_with(VALID_DATA) submission_log_page = self.get_first_project_submission_log_page() submission_log_page.search(ds_id) self.assertTrue(DATASENDER_DETAILS[NAME] in submission_log_page.get_cell_value(row=1, column=2)) self.driver.go_to(DATA_WINNER_ALL_DATA_SENDERS_PAGE) all_datasenders_page = AllDataSendersPage(self.driver) all_datasenders_page.search_with(ds_id) all_datasenders_page.wait_for_table_to_load() all_datasenders_page.select_a_data_sender_by_id(ds_id) all_datasenders_page.select_edit_action() AddDataSenderPage(self.driver).enter_data_sender_details_from( EDITED_DATASENDER_DETAILS) submission_log_page = self.get_first_project_submission_log_page() submission_log_page.search(ds_id) self.assertTrue(EDITED_DATASENDER_DETAILS[NAME] in submission_log_page.get_cell_value(row=1, column=2))
def test_should_update_submission_log_when_DS_info_is_edited(self): self.driver.go_to(DATA_WINNER_ALL_DATA_SENDERS_PAGE) all_datasenders_page = AllDataSendersPage(self.driver) ds_id = self.register_datasender(DATASENDER_DETAILS, all_datasenders_page) self.driver.go_to(DATA_WINNER_SMS_TESTER_PAGE) sms_tester_page = SMSTesterPage(self.driver) sms_tester_page.send_valid_sms_with(VALID_DATA) message = sms_tester_page.get_response_message() self.assertTrue( fetch_(SUCCESS_MESSAGE, VALID_DATA) in message, "message:" + message) submission_log_page = self.go_to_submission_log_page() submission_log_page.search(ds_id) self.assertTrue(DATASENDER_DETAILS[NAME] in submission_log_page.get_cell_value(row=1, column=2)) self.driver.go_to(DATA_WINNER_ALL_DATA_SENDERS_PAGE) all_datasenders_page.search_with(ds_id) all_datasenders_page.wait_for_table_to_load() all_datasenders_page.select_a_data_sender_by_id(ds_id) all_datasenders_page.select_edit_action() AddDataSenderPage(self.driver).enter_data_sender_details_from( EDITED_DATASENDER_DETAILS) submission_log_page = self.go_to_submission_log_page() submission_log_page.search(ds_id) self.assertTrue(EDITED_DATASENDER_DETAILS[NAME] in submission_log_page.get_cell_value(row=1, column=2))
def add_edit_datasender(self): global_navigation = GlobalNavigationPage(self.driver) all_data_sender_page = global_navigation.navigate_to_all_data_sender_page( ) add_data_sender_page = all_data_sender_page.navigate_to_add_a_data_sender_page( ) email = generate_random_email_id() add_data_sender_page.enter_data_sender_details_from( VALID_DATA_WITH_EMAIL, email=email) success_msg = add_data_sender_page.get_success_message() self.assertIn(fetch_(SUCCESS_MESSAGE, from_(VALID_DATA_WITH_EMAIL)), success_msg) add_data_sender_page.navigate_to_datasender_page() all_data_sender_page = AllDataSendersPage(self.driver) rep_id = success_msg.replace(VALID_DATA_WITH_EMAIL[SUCCESS_MESSAGE], '') all_data_sender_page.select_a_data_sender_by_id(rep_id) all_data_sender_page.select_edit_action() time.sleep(2) edit_datasender_page = AddDataSenderPage(self.driver) edit_datasender_page.enter_data_sender_details_from( VALID_DATA_WITH_EMAIL_FOR_EDIT) self.assertRegexpMatches( edit_datasender_page.get_success_message(), fetch_(SUCCESS_MSG, from_(VALID_DATA_WITH_EMAIL_FOR_EDIT))) edit_datasender_page.navigate_to_datasender_page() all_data_sender_page = AllDataSendersPage(self.driver) all_data_sender_page.associate_datasender_to_projects( rep_id, [self.project_name]) return email
def test_successful_addition_and_editing_of_data_sender(self): add_data_sender_page = self.current_page add_data_sender_page.enter_data_sender_details_from(VALID_DATA) success_msg = add_data_sender_page.get_success_message() self.assertIn(fetch_(SUCCESS_MSG, from_(VALID_DATA)), success_msg) rep_id = self._parse(success_msg) all_data_senders_page = AllDataSendersPage(self.driver) all_data_senders_page.load() all_data_senders_page.search_with(rep_id) all_data_senders_page.select_a_data_sender_by_id(rep_id) all_data_senders_page.select_edit_action() self.current_page.enter_data_sender_details_from(VALID_EDIT_DATA) self.assertRegexpMatches(self.current_page.get_success_message(), fetch_(SUCCESS_MSG, from_(VALID_EDIT_DATA)))