def check_the_override_message(self, survey, question_code, exp_msg): exp_msg = GetContributorDetails().get_validation_message( survey, exp_msg) question_row = GetContributorDetails().get_question_code_row_details( contributor_details.CURRENT_DATA_TAB_ELEMENT, question_code) elements = contributor_details.ERROR_MESSAGES_COLUMN + contributor_details.ERROR_LABEL override_messages_elements = question_row.find_elements( By.XPATH, elements) ReportingHelper.check_elements_message_matches( question_code, override_messages_elements, exp_msg)
def check_historic_data_matches_with_current_period_data( self, survey, question_codes, values, tab_name): self.switch_to_the_tab(tab_name) if len(question_codes) > 1: values = Utilities.get_values_as_a_list(values) count = 0 for value in values: question_row = GetContributorDetails(). \ get_question_code_row_details('tabId2', Utilities.get_question_code_element( survey, question_codes[count])) elements = contributor_details.CURRENT_PERIOD_COLUMN current_period_value = question_row.find_elements( By.XPATH, elements) ReportingHelper.check_elements_message_matches( question_codes[count], current_period_value, value) count += 1
def check_validation_message(self, survey, question_type, exp_msg, is_validation_exists): self.check_if_overall_validation_triggered() exp_msg = GetContributorDetails().get_validation_message( survey, exp_msg) no_of_msgs = GetContributorDetails( ).get_no_of_validation_error_messages_per_question(question_type) if len(no_of_msgs) == 0: if is_validation_exists == 'be': ReportingHelper.check_elements_message_matches( question_type, no_of_msgs, exp_msg) elif is_validation_exists == 'not be': act_msg = '' ReportingHelper.check_multiple_messages_not_matches( question_type, act_msg, exp_msg) elif len(no_of_msgs) > 0: if is_validation_exists == 'be': ReportingHelper.check_elements_message_matches( question_type, no_of_msgs, exp_msg) elif is_validation_exists == 'not be': ReportingHelper.check_multiple_messages_not_matches( question_type, no_of_msgs, exp_msg)