예제 #1
0
    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)
예제 #2
0
 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)
예제 #3
0
 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)
예제 #4
0
 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 check_multiple_comment_text_messages(self, question_codes):
     survey = question_codes[0]
     questions_list = question_codes[1]
     commodity_values = Utilities.get_values_as_a_list(question_codes[2])
     if len(questions_list) > 1:
         count = 0
         for question in questions_list:
             question_element = Utilities.get_question_code_element(
                 survey, question)
             question_actual_text = SeleniumCore.get_attribute_element_text(
                 By.ID, question_element)
             commodity_value = Utilities.convert_blank_data_value(
                 commodity_values[count])
             ReportingHelper.check_single_message_matches(
                 question_element, question_actual_text, commodity_value)
    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
예제 #7
0
 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)