def submit_cp_sales_values(self, validation_type, internet_sales,
                            total_sales):
     global cp_internet_sales, cp_total_sales
     cp_internet_sales = Utilities.convert_blank_data_value(internet_sales)
     cp_total_sales = Utilities.convert_blank_data_value(total_sales)
     self.set_internet_sales_value(validation_type, cp_internet_sales)
     self.set_total_turnover_sales_value(validation_type, cp_total_sales)
     CheckValuesContributorDetails().save_the_application()
Пример #2
0
 def submit_period_dates(self, start_date=None, end_date=None):
     if start_date or end_date is not None:
         st_date = Utilities.convert_blank_data_value(start_date)
         en_date = Utilities.convert_blank_data_value(end_date)
         self.set_period_start_date(st_date)
         self.set_period_end_date(en_date)
     else:
         self.submit_default_period_dates()
Пример #3
0
 def submit_period_dates(self, period, start_date, end_date):
     RsiDateAdjustedResponseValidation.period = period
     RsiDateAdjustedResponseValidation.start_date = Utilities.convert_blank_data_value(
         start_date)
     RsiDateAdjustedResponseValidation.end_date = Utilities.convert_blank_data_value(
         end_date)
     SubmitContributorDetails().submit_period_dates(
         RsiDateAdjustedResponseValidation.start_date,
         RsiDateAdjustedResponseValidation.end_date)
 def submit_pp_sales_values(self, validation_type, internet_sales,
                            total_sales):
     global pp_internet_sales, pp_total_sales
     pp_internet_sales = Utilities.convert_blank_data_value(internet_sales)
     pp_total_sales = Utilities.convert_blank_data_value(total_sales)
     self.set_internet_sales_value(validation_type, pp_internet_sales)
     self.set_total_turnover_sales_value(validation_type, pp_total_sales)
     CheckValuesContributorDetails().save_the_application()
     SeleniumCore.close_the_current_window()
 def submit_cp_sales_values(self, period, period_start_date, internet_sales,
                            total_sales):
     global cp_internet_sales, cp_total_sales
     cp_internet_sales = Utilities.convert_blank_data_value(internet_sales)
     cp_total_sales = Utilities.convert_blank_data_value(total_sales)
     SubmitContributorDetails().submit_default_period_dates(
         period, period_start_date)
     self.set_internet_sales_value(cp_internet_sales)
     self.set_total_turnover_sales_value(cp_total_sales)
     CheckValuesContributorDetails().save_the_application()
 def submit_pp_sales_values(self, period, period_start_date, internet_sales,
                            total_sales):
     global pp_internet_sales, pp_total_sales
     pp_internet_sales = Utilities.convert_blank_data_value(internet_sales)
     pp_total_sales = Utilities.convert_blank_data_value(total_sales)
     SubmitContributorDetails().submit_default_period_dates(
         period, period_start_date)
     self.set_internet_sales_value(pp_internet_sales)
     self.set_total_turnover_sales_value(pp_total_sales)
     CheckValuesContributorDetails().save_the_application()
     SeleniumCore.close_the_current_window()
Пример #7
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)
Пример #8
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)
Пример #9
0
    def check_values_are_not_equal(self, question, comparison_val_one,
                                   comparison_val_two, result):
        CheckMessagesContributorDetails(
        ).check_if_overall_validation_triggered()
        if comparison_val_one == 'blank' and comparison_val_two == 'blank':
            comparison_val_one = Utilities.convert_blank_data_value(
                comparison_val_one)
            comparison_val_two = Utilities.convert_blank_data_value(
                comparison_val_two)
            is_validation_exists = ReportingHelper.compare_strings(
                comparison_val_one, comparison_val_two)

        else:
            is_validation_exists = ReportingHelper.compare_values_are_not_equal(
                comparison_val_one, comparison_val_two)
        ReportingHelper.check_single_message_matches(
            question, result,
            str(is_validation_exists).lower())
Пример #10
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)
Пример #11
0
    def check_values_movement_to_or_from_zero(self, question_codes,
                                              comparison_val_one,
                                              comparison_val_two, result):
        CheckMessagesContributorDetails(
        ).check_if_overall_validation_triggered()
        if len(question_codes) > 1:
            for question in question_codes:
                if comparison_val_one == 'blank' and comparison_val_two == 'blank':
                    value_one = Utilities.convert_blank_data_value(
                        comparison_val_one)
                    value_two = Utilities.convert_blank_data_value(
                        comparison_val_two)
                    is_validation_exists = ReportingHelper.compare_strings(
                        value_one, value_two)

                else:
                    is_validation_exists = ReportingHelper.compare_the_zero_movement_values(
                        comparison_val_one, comparison_val_two)
                ReportingHelper.check_single_message_matches(
                    question, result,
                    str(is_validation_exists).lower())
Пример #12
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_for_blank_validation(self, operator_type, value_one, value_two,
                                result):
     value_one = Utilities.convert_blank_data_value(value_one)
     val_two = Utilities.convert_blank_data_value(value_two)
     self.check_validation_msg_matches(operator_type, value_one, val_two,
                                       result)