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 populate_data_for_date_range_filters( self, project_data=NEW_PROJECT_DATA, questionnaire_data=DATE_PROJECT_QUESTIONNAIRE_DATA, monthly=False): self._create_project(project_data, questionnaire_data, monthly) project_name, questionnaire_code = self._get_project_details() self.driver.go_to(DATA_WINNER_ALL_DATA_SENDERS_PAGE) all_datasenders_page = AllDataSendersPage(self.driver) all_datasenders_page.associate_datasender_to_projects( "rep8", [project_name.lower()]) self._submit_sms_data(questionnaire_code, monthly=monthly) return project_name