def submit_sales_value(self, period, period_start_date, survey, value, question): value = Utilities.convert_blank_data_value(value) question_element = Utilities.get_question_code_element( survey, question) self.submit_default_period_dates(period, period_start_date) SeleniumCore.set_current_data_text(question_element, value)
def set_total_turnover_sales_value(self, validation_type, value): if validation_type.lower() == 'poprrm': SeleniumCore.set_current_data_text( details.POPRRM_QUESTION_SECONDARY_ELEMENT, value) elif validation_type.lower() == 'popmrz': SeleniumCore.set_current_data_text( details.POPMRZ_QUESTION_SECONDARY_ELEMENT, value)
def set_internet_sales_value(self, validation_type, value): if validation_type.lower() == 'poprrm': SeleniumCore.set_current_data_text( details.POPRRM_QUESTION_PRIMARY_ELEMENT, value) elif validation_type.lower() == 'popmrz': SeleniumCore.set_current_data_text( details.POPMRZ_QUESTION_PRIMARY_ELEMENT, value)
def submit_single_value_for_multiple_questions(self, survey, questions_list, commodity_value): for question in questions_list: question_element = Utilities.get_question_code_element( survey, question) commodity_value = Utilities.convert_blank_data_value( commodity_value) SeleniumCore.set_current_data_text(question_element, commodity_value)
def run_the_validation_process(self, total_turnover_value, exp_derived_value): SeleniumCore.set_current_data_text( self.QUESTION_TOTAL_TURNOVER_ELEMENT, total_turnover_value) CheckValuesContributorDetails().save_the_application() actual_derived_val = SeleniumCore.get_attribute_element_text( *RsiContributorDetailsPage.QUESTION_DERIVED_ELEMENT) ReportingHelper.check_single_message_matches('Q7034', actual_derived_val, exp_derived_value)
def run_the_validation_process(self, threshold_primary_value, exp_derived_value): SeleniumCore.set_current_data_text( details.THRESHOLD_PRIMARY_QUESTION_ELEMENT, threshold_primary_value) CheckValuesContributorDetails().save_the_application() actual_derived_val = SeleniumCore.get_attribute_element_text( By.ID, details.THRESHOLD_DERIVED_QUESTION_ELEMENT) ReportingHelper.check_single_message_matches('Q12', actual_derived_val, exp_derived_value)
def submit_values_as_a_list_for_multiple_questions(self, survey, questions_list, commodity_values): if len(questions_list) > 1: count = 0 for question in questions_list: question_element = Utilities.get_question_code_element( survey, question) SeleniumCore.set_current_data_text( question_element, Utilities.convert_blank_data_value(commodity_values[count])) if len(commodity_values) > 1: count += 1
def run_the_validation_process(self, questions): questions_list = questions[0] comparing_question_value = Utilities.convert_blank_data_value(questions[1]) derived_question_value = Utilities.convert_blank_data_value(questions[2]) survey = Utilities.convert_blank_data_value(questions[3]) comparing_question_element = Utilities.get_question_code_element(survey, questions_list[0]) derived_question_element = Utilities.get_question_code_element(survey, questions_list[1]) SeleniumCore.set_current_data_text(comparing_question_element, comparing_question_value) CheckValuesContributorDetails().save_the_application() actual_derived_val = SeleniumCore.get_attribute_element_text(By.ID, derived_question_element) if derived_question_value == '': derived_question_value = '0' ReportingHelper.check_single_message_matches(questions_list[1], actual_derived_val, derived_question_value)
def set_period_end_date(self, value): SeleniumCore.set_current_data_text( contributor_details.PERIOD_END_DATE_ELEMENT, value)
def submit_single_value_per_question(self, survey, questions_list, commodity_value): question_element = Utilities.get_question_code_element( survey, questions_list) SeleniumCore.set_current_data_text(question_element, commodity_value)
def set_total_turnover_sales_value(self, value): SeleniumCore.set_current_data_text( self.QUESTION_TOTAL_TURNOVER_ELEMENT, value)
def set_internet_sales_value(self, value): SeleniumCore.set_current_data_text( self.QUESTION_INTERNET_SALES_ELEMENT, value)