Exemple #1
0
    def test_step_backward_donation_process_d(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        full_query = sql_query(
            '''select top(1) PerC.UniqueId Ent, 'Донору введены результаты осмотра/анализов. Продолжить возврат?' 
			OR1 from ref.SystemSettings SysSet, PersonCards PerC join DonationProcessRegistry PrReg on PerC.UniqueId = PrReg.DonorId 
			where PerC.IsDeleted != 1 and PrReg.OrgId = SysSet.CurrentOrganizationId and PrReg.RegDate = cast(getdate() as date) 
			and PrReg.CurrentState = 1 and PrReg.MobileTeamSessionId is null and PerC.UniqueId not in 
			(select Ex.DonorId from Examinations Ex where cast(Ex.ExamDate as date) = cast(getdate() as date))'''
        )

        donorid = str(full_query[0][0])

        main_page.open()

        aistium.fill(donorid, elements=main_page.quick_search_field)

        main_page.quick_search('click')

        main_page.loading_is_completed()

        ind = sql_query(
            "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC left join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and (PerC.UniqueId = '"
            + donorid + "' or IDoc.Number = '" + donorid +
            "')) Main where Main.UniqueId = '" + donorid + "'")[0][0]

        main_page.get_grid_values('UniqueId',
                                  ind,
                                  main_page.main_grid,
                                  mode='click')

        main_page.loading_is_completed()

        aistium.click_on(elements=main_page.process_state_button)

        main_page.loading_is_completed()

        aistium.click_on(locators_list=locators,
                         element_name='confirm_popup_yes_btn')

        main_page.loading_is_completed()

        aistium.fill('автотест', elements=main_page.reason_back_donation_input)

        assert aistium.get_text(main_page.process_state_button) == 'Вернуть'

        assert len(
            sql_query(
                "select PrReg.Id from DonationProcessRegistry PrReg, ref.SystemSettings SysSet where PrReg.DonorId = '"
                + donorid +
                "' and PrReg.OrgId = SysSet.CurrentOrganizationId and PrReg.RegDate = cast(getdate() as date) and PrReg.CurrentState = 1 and PrReg.MobileTeamSessionId is null"
            )) > 0

        assert aistium.element_is_on_the_page(
            locators_list=locators, element_name='confirm_popup') == False

        assert aistium.get_text(main_page.process_state_button) == 'Вернуть'
    def test_deferral(self, deferral_system_name, expected_result,
                      test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        deferrals_gui = []

        deferrals_db = []

        main_page.newdonor_click()

        main_page.ndp_filling_first_page('Сидоров', "Алексей", "",
                                         "05.06.1980", "8914", "650235")

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_filling_region('Москва г')

        main_page.ndp_filling_street('Перовская ул')

        aistium.fill('8', elements=main_page.reg_fias_address_house)

        assert main_page.is_deferral_type_field_disabled() == ('true', 'true')

        active_deferrals = sql_query(
            "select DefT.Code+' '+DefT.Name Otvod from ref.DeferralTypes DefT join ref.DeferralTypeParams DefTP on DefT.UniqueId = DefTP.DeferralTypeId where DefTP.IsActive = 1 order by DefT.Code asc"
        )

        for defer in main_page.ndp_deferrals_listbox():
            deferrals_gui.append(
                self.driver.execute_script(
                    "return jQuery(arguments[0]).text();", defer))

        for deferral in active_deferrals:
            deferrals_db.append(deferral[0])

        assert deferrals_gui == deferrals_db

        main_page.ndp_filling_deferral(deferral_system_name)

        main_page.ndp_save_new_donor('success')

        assert expected_result.upper() in aistium.get_text(
            elements=main_page.deferral_from_minicard).upper()

        assert aistium.get_text(
            elements=main_page.fio_minicard) == 'Сидоров Алексей'
Exemple #3
0
    def test_gender_and_middlename_confirm_yes(self, middlename,
                                               test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        main_page.newdonor_click()

        main_page.ndp_filling_first_page('Машинный', 'Проверкаполаиотчества',
                                         middlename, '10.12.1977', '2013',
                                         '312313')

        if middlename[-2:] == 'ич' or middlename[-4:] == 'оглы':
            main_page.select_gender('female')
            aistium.click_on(elements=main_page.next_step_ndp)
            assert aistium.get_text(
                locators_list=locators, element_name='confirm_popup'
            ) == 'Пол донора не соответствует отчеству. Продолжить?'
            aistium.click_on(locators_list=locators,
                             element_name='confirm_popup_yes_btn')
            aistium.click_on(elements=main_page.next_step_ndp
                             )  #https://aj.srvdev.ru/browse/AIST-15978
            saved_gender = 'Ж'
        elif middlename[-2:] == 'на' or middlename[-4:] == 'кызы':
            main_page.select_gender('male')
            aistium.click_on(elements=main_page.next_step_ndp)
            assert aistium.get_text(
                locators_list=locators, element_name='confirm_popup'
            ) == 'Пол донора не соответствует отчеству. Продолжить?'
            aistium.click_on(locators_list=locators,
                             element_name='confirm_popup_yes_btn')
            aistium.click_on(elements=main_page.next_step_ndp
                             )  #https://aj.srvdev.ru/browse/AIST-15978
            saved_gender = 'М'

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_filling_region('Москва г')

        main_page.ndp_filling_street('Строителей ул')

        aistium.fill('13', elements=main_page.reg_fias_address_house)

        main_page.ndp_save_new_donor('success')

        assert main_page.get_gender_from_minicard() == saved_gender
Exemple #4
0
	def test_ndp_homephone(self, homephone, expected_result, test_data_set_number):
		main_page = DonorsModuleRegistryPage()

		main_page.clear_localstorage()

		main_page.open()

		main_page.newdonor_click()

		main_page.ndp_filling_first_page("Сидоров", "Кирилл", "", "01.06.1980", "8910", "650231")

		main_page.select_gender('male')

		aistium.click_on(elements=main_page.next_step_ndp)

		main_page.loading_is_completed()

		main_page.if_donor_is_in_local_cabinet()

		main_page.ndp_second_page_loaded()

		main_page.ndp_filling_contacts("", homephone, "")

		main_page.ndp_filling_region('Москва г')

		main_page.ndp_filling_street('Перовская ул')

		aistium.fill('4', elements=main_page.reg_fias_address_house)

		main_page.ndp_save_new_donor('success')

		assert aistium.get_text(elements=main_page.minicard_phone) == expected_result
Exemple #5
0
    def test_donor_minicard_fio_a(self, query, test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        full_query = sql_query(query)

        donorid = str(full_query[0][0])

        expected_result = str(full_query[0][1])

        main_page.clear_localstorage()

        main_page.open()

        aistium.fill(donorid, elements=main_page.quick_search_field)

        main_page.quick_search('click')

        main_page.loading_is_completed()

        ind = sql_query(
            "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC left join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and (PerC.UniqueId = '"
            + donorid + "' or IDoc.Number = '" + donorid +
            "')) Main where Main.UniqueId = '" + donorid + "'")[0][0]

        main_page.get_grid_values('UniqueId', ind, main_page.main_grid,
                                  'click')

        main_page.loading_is_completed()

        assert aistium.get_text(
            elements=main_page.fio_minicard) == expected_result
    def test_ndp_moving_between_pages_first_step(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        main_page.newdonor_click()

        main_page.ndp_filling_first_page('Сидоров', 'Кирилл', '', '01.06.1980',
                                         '8910', '650231')

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_filling_region('Москва г')

        main_page.ndp_filling_street('Перовская ул')

        aistium.fill('46', elements=main_page.reg_fias_address_house)

        aistium.click_on(elements=main_page.previous_step_ndp)

        main_page.ndp_first_page_check_values_of_mandatory_fields(
            'Сидоров', 'Кирилл', '01.06.1980', '8910', '650231')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_second_page_check_values_of_mandatory_fields() == (
            'Москва г', '', 'Перовская ул', '46')

        main_page.ndp_save_new_donor('success')

        main_page.loading_is_completed()

        assert aistium.get_text(
            elements=main_page.fio_minicard) == 'Сидоров Кирилл'

        assert main_page.get_gender_from_minicard() == 'М'

        assert main_page.get_birthdate_from_minicard() == '01.06.1980'

        assert main_page.get_document_serie_and_number(
        ) == '8910' + ' ' + '650231'

        assert main_page.get_accurate_address(
        ) == 'Москва г, Перовская ул, д.46'
Exemple #7
0
    def test_ndp_validation_of_social_status_and_job_info_d(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        change_general_settings(WorkWithSocialStatus='true')

        query = sql_query(
            "select SocSt.Name from ref.SocialStatuses SocSt where SocSt.IsActive = 1 and SocSt.Name like '%ц%'"
        )

        social_statuses_db = []

        for s in query:
            social_statuses_db.append(s[0])

        main_page.open()

        main_page.newdonor_click()

        main_page.ndp_filling_first_page("Сидоров", "Афанасий", '',
                                         "04.06.1980", "8913", "650234")

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_filling_region("Москва г")

        main_page.ndp_filling_street("Перовская ул")

        aistium.fill('7', elements=main_page.reg_fias_address_house)

        aistium.click_on(elements=main_page.social_status_select_row)

        main_page.ndp_choose_social_status_from_list("Рабочие")

        main_page.ndp_social_status_clear()

        main_page.ndp_typing_social_status('ц')

        assert main_page.ndp_social_statuses_list_on_form(
        ) == social_statuses_db

        main_page.ndp_choose_social_status_from_list(
            "Младший медицинский персонал")

        main_page.ndp_social_status_focusout()

        assert main_page.ndp_get_job_information(
        )[2] == 'Младший медицинский персонал'

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(
            elements=main_page.fio_minicard) == "Сидоров " + "Афанасий"
    def test_edit_and_save_deferral(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        deferrals_db = []

        main_page.newdonor_click()

        main_page.ndp_filling_first_page('Сидоров', "Алексей", "",
                                         "05.06.1980", "8914", "650235")

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_filling_region('Москва г')

        main_page.ndp_filling_street('Перовская ул')

        aistium.fill('13', elements=main_page.reg_fias_address_house)

        main_page.ndp_filling_deferral(
            str(
                sql_query(
                    "select top(1) DefT.Code+' '+DefT.Name Otvod from ref.DeferralTypes DefT join ref.DeferralTypeParams DefTP on DefT.UniqueId = DefTP.DeferralTypeId where DefTP.IsActive = 1 and DefT.BaseType = 3"
                ))[3:-5])

        aistium.click_on(elements=main_page.ndp_deferral_clear_button)

        main_page.ndp_filling_deferral('Ф', '')

        for deferral in sql_query(
                "select DefT.Code+' '+DefT.Name Otvod from ref.DeferralTypes DefT join ref.DeferralTypeParams DefTP on DefT.UniqueId = DefTP.DeferralTypeId where DefTP.IsActive = 1 and DefT.Code+' '+DefT.Name like '%ф%' order by DefT.Code"
        ):
            deferrals_db.append(str(deferral)[2:-4])

        assert main_page.ndp_deferral_list_on_form() == deferrals_db

        main_page.ndp_deferrals_press_enter()

        assert aistium.get_value(
            locators_list=locators,
            element_name='ndp_deferral_field') == deferrals_db[0]

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(
            elements=main_page.fio_minicard) == 'Сидоров Алексей'
Exemple #9
0
    def test_ndp_validation_of_social_status_and_job_info_a(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        change_general_settings(WorkWithSocialStatus='true')

        main_page.open()

        query = sql_query(
            "select SocSt.Name from ref.SocialStatuses SocSt where SocSt.IsActive = 1 order by SocSt.Name asc"
        )

        social_statuses_db = []

        main_page.newdonor_click()

        main_page.ndp_filling_first_page("Сидоров", "Дмитрий", '',
                                         "31.05.1980", "8909", "650229")

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_filling_region("Москва г")

        main_page.ndp_filling_street("Перовская ул")

        aistium.fill("2", elements=main_page.reg_fias_address_house)

        aistium.click_on(elements=main_page.social_status_select_row)

        for s in query:
            social_statuses_db.append(s[0])

        assert main_page.ndp_social_statuses_list_on_form(
        ) == social_statuses_db

        main_page.ndp_choose_social_status_from_list('Рабочие')

        main_page.ndp_social_status_focusout()

        assert main_page.ndp_get_job_information()[2] == 'Рабочие'

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(
            elements=main_page.fio_minicard) == "Сидоров " + "Дмитрий"
Exemple #10
0
    def test_ndp_validation_of_social_status_and_job_info_e(
            self, social_status, test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        change_general_settings(WorkWithSocialStatus='true')

        query = sql_query(
            "select SocSt.Name from ref.SocialStatuses SocSt where SocSt.IsActive = 1 and SocSt.Name like '%ц%'"
        )

        social_statuses_db = []

        for s in query:
            social_statuses_db.append(s[0])

        main_page.open()

        main_page.newdonor_click()

        main_page.ndp_filling_first_page("Сидоров", "Кирилл", '', "01.06.1980",
                                         "8910", "650231")

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_filling_region("Москва г")

        main_page.ndp_filling_street("Перовская ул")

        aistium.fill('4', elements=main_page.reg_fias_address_house)

        main_page.ndp_typing_social_status(social_status)

        assert main_page.ndp_social_status_listbox_is_empty()

        main_page.ndp_social_status_focusout()

        assert main_page.ndp_get_job_information()[2] == ''

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(
            elements=main_page.fio_minicard) == "Сидоров " + "Кирилл"
Exemple #11
0
    def test_ndp_validation_of_donation_type_first_case(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        query = sql_query(
            "select DonT.Code+' '+DonT.Name from ref.DonationTypes DonT join ref.DonationTypeParams DonTP on DonT.UniqueId = DonTP.DonationTypeId where DonTP.IsActive = 1 and DonT.DonationParams not like '%4%' order by DonT.Code"
        )

        donation_types_db = []

        main_page.newdonor_click()

        main_page.ndp_filling_first_page("Сидоров", "Павел", '', "11.06.1980",
                                         "8920", "650241")

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_filling_region("Москва г")

        main_page.ndp_filling_street("Перовская ул")

        aistium.fill('14', elements=main_page.reg_fias_address_house)

        aistium.click_on(elements=main_page.donation_type_select_row)

        for t in query:
            donation_types_db.append(t[0])

        assert main_page.ndp_donation_types_list_on_form() == donation_types_db

        main_page.ndp_filling_donation_type('001 на лабораторные исследования')

        assert main_page.ndp_get_donation_type(
        ) == '001 На лабораторные исследования'

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(
            elements=main_page.fio_minicard) == "Сидоров " + "Павел"
Exemple #12
0
	def test_birthdate_validation_confirm_no(self, birthdate, test_data_set_number):
		main_page = DonorsModuleRegistryPage()

		main_page.open()

		main_page.newdonor_click()
		
		main_page.ndp_filling_first_page("Сидоров", "Кирилл", '', birthdate, "8910", "650231")

		main_page.select_gender('male')

		aistium.click_on(elements=main_page.next_step_ndp)

		assert aistium.get_text(locators_list=locators, element_name='confirm_popup') == 'Возраст донора меньше рекомендуемого для сдачи донаций. Продолжить?'

		aistium.click_on(locators_list=locators, element_name='confirm_popup_no_btn')

		assert main_page.is_birthdate_field_focused() == True
Exemple #13
0
	def test_from_second_page_cancellation(self, element, confirmation, test_data_set_number):
		main_page = DonorsModuleRegistryPage()

		main_page.open()

		main_page.newdonor_click()
		
		main_page.ndp_filling_first_page("Сидоров", "Кирилл", '', '01.06.1980', "8910", "650231")

		main_page.select_gender('male')

		aistium.click_on(elements=main_page.next_step_ndp)

		main_page.if_donor_is_in_local_cabinet()

		main_page.ndp_second_page_loaded()

		main_page.ndp_filling_region('Москва г')

		main_page.ndp_filling_street('Перовская ул')

		aistium.fill('4', elements=main_page.reg_fias_address_house)

		if element == 'icon':

			aistium.click_on(elements=main_page.popup_close_icon)

		elif element == 'button':

			aistium.click_on(elements=main_page.ndp_second_page_cancel_newdonor)

		assert aistium.get_text(locators_list=locators, element_name='confirm_popup') == 'Вы точно хотите покинуть форму Добавление донора?'

		if confirmation == 'yes':

			aistium.click_on(locators_list=locators, element_name='confirm_popup_yes_btn')

			assert main_page.is_ndp_closed() == True

		elif confirmation == 'no':

			aistium.click_on(locators_list=locators, element_name='confirm_popup_no_btn')

			assert main_page.ndp_second_page_check_values_of_mandatory_fields() == ('Москва г', '', 'Перовская ул', '4')
    def test_deferral_clear_button(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        main_page.newdonor_click()

        main_page.ndp_filling_first_page('Сидоров', "Алексей", "",
                                         "05.06.1980", "8914", "650235")

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_filling_deferral(
            str(
                sql_query(
                    "select top(1) DefT.Code+' '+DefT.Name Otvod from ref.DeferralTypes DefT join ref.DeferralTypeParams DefTP on DefT.UniqueId = DefTP.DeferralTypeId where DefTP.IsActive = 1 and DefT.BaseType = 1"
                ))[3:-5])

        aistium.click_on(elements=main_page.ndp_deferral_clear_button)

        assert aistium.get_value(locators_list=locators,
                                 element_name='ndp_deferral_type') == ''

        assert aistium.get_value(locators_list=locators,
                                 element_name='ndp_deferral_field') == ''

        main_page.ndp_save_new_donor('success')

        main_page.mc_donor_has_not_deferral()

        assert aistium.get_text(
            elements=main_page.fio_minicard) == 'Сидоров Алексей'
    def test_deferral_incorrect_input(self, incorrect_value,
                                      test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        main_page.newdonor_click()

        main_page.ndp_filling_first_page('Сидоров', "Алексей", "",
                                         "05.06.1980", "8914", "650235")

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_filling_region('Москва г')

        main_page.ndp_filling_street('Перовская ул')

        aistium.fill('1', elements=main_page.reg_fias_address_house)

        main_page.ndp_filling_deferral(incorrect_value, 'incorrect_input')

        main_page.is_deferral_listbox_empty()

        main_page.ndp_deferrals_press_enter()

        assert aistium.get_value(locators_list=locators,
                                 element_name='ndp_deferral_field') == ''

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(
            elements=main_page.fio_minicard) == 'Сидоров Алексей'
Exemple #16
0
    def test_step_backward_donation_process_warning_messages_a(
            self, query, test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        full_query = sql_query(query)

        donorid = str(full_query[0][0])

        expected_message = str(full_query[0][1])

        main_page.open()

        aistium.fill(donorid, elements=main_page.quick_search_field)

        main_page.quick_search('click')

        main_page.loading_is_completed()

        ind = sql_query(
            "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC left join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and (PerC.UniqueId = '"
            + donorid + "' or IDoc.Number = '" + donorid +
            "')) Main where Main.UniqueId = '" + donorid + "'")[0][0]

        main_page.get_grid_values('UniqueId',
                                  ind,
                                  main_page.main_grid,
                                  mode='click')

        main_page.loading_is_completed()

        aistium.click_on(elements=main_page.process_state_button)

        main_page.loading_is_completed()

        aistium.click_on(locators_list=locators,
                         element_name='confirm_popup_yes_btn')

        assert expected_message in aistium.get_text(
            locators_list=locators, element_name='confirm_popup')
    def test_donors_direction_warning_messages_a(self, query,
                                                 test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        change_donor_settings(CheckDonorInFicWhileDirection='false',
                              CheckFiasAddressForDonor='true',
                              CheckIncompleteAnalysis='true',
                              AlwaysShowEpidAddress='true')

        full_query = sql_query(query)

        donorid = str(full_query[0][0])

        expected_message = str(full_query[0][1])

        main_page.open()

        aistium.fill(donorid, elements=main_page.quick_search_field)

        main_page.quick_search('click')

        main_page.loading_is_completed()

        ind = sql_query(
            "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC left join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and (PerC.UniqueId = '"
            + donorid + "' or IDoc.Number = '" + donorid +
            "')) Main where Main.UniqueId = '" + donorid + "'")[0][0]

        main_page.get_grid_values('UniqueId', ind, main_page.main_grid,
                                  'click')

        main_page.loading_is_completed()

        aistium.click_on(elements=main_page.process_state_button)

        main_page.loading_is_completed()

        assert expected_message in aistium.get_text(
            locators_list=locators, element_name='confirm_popup')
Exemple #18
0
    def test_ndp_validation_of_social_status_and_job_info_b(
            self, expected_color_back, expected_color_text, expected_type,
            test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        change_general_settings(WorkWithSocialStatus='true')

        main_page.open()

        main_page.newdonor_click()

        main_page.ndp_filling_first_page("Сидоров", "Никита", '', "02.06.1980",
                                         "8911", "650232")

        main_page.select_gender('male')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_filling_region("Москва г")

        main_page.ndp_filling_street("Перовская ул")

        aistium.fill('5', elements=main_page.reg_fias_address_house)

        main_page.ndp_typing_social_status('врачи')

        main_page.ndp_social_status_focusout()

        assert main_page.ndp_get_job_information()[2] == 'Врачи'

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(
            elements=main_page.fio_minicard) == "Сидоров " + "Никита"
Exemple #19
0
	def test_from_first_page_cancellation(self, element, confirmation, test_data_set_number):
		main_page = DonorsModuleRegistryPage()

		main_page.open()

		main_page.newdonor_click()
		
		main_page.ndp_filling_first_page("Сидоров", "Кирилл", '', '01.06.1980', "8910", "650231")

		main_page.select_gender('male')

		if element == 'icon':

			aistium.click_on(elements=main_page.popup_close_icon)

		elif element == 'button':

			aistium.click_on(elements=main_page.ndp_first_page_cancel_newdonor)

		assert aistium.get_text(locators_list=locators, element_name='confirm_popup') == 'Вы точно хотите покинуть форму Добавление донора?'

		if confirmation == 'yes':

			aistium.click_on(locators_list=locators, element_name='confirm_popup_yes_btn')

			assert main_page.is_ndp_closed() == True

		elif confirmation == 'no':

			aistium.click_on(locators_list=locators, element_name='confirm_popup_no_btn')

			assert aistium.get_value(locators_list=locators, element_name='birthdate_field_ndp') == '01.06.1980'

			assert aistium.get_value(locators_list=locators, element_name='last_name_field_ndp') == "Сидоров"

			assert aistium.get_value(locators_list=locators, element_name='first_name_field_ndp') == "Кирилл"

			assert aistium.get_value(locators_list=locators, element_name='document_serie_field_ndp') == "8910"

			assert aistium.get_value(locators_list=locators, element_name='document_number_field_ndp') == "650231"
    def test_donors_direction_e(self, query, test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        donations_counts = {
            'HonorableDonorSettings[0].DonationsCount': '10',
            'HonorableDonorSettings[0].BloodAndComponentsCount': '5',
            'HonorableDonorSettings[0].PlasmaCount': '5',
            'HonorableDonorSettings[1].DonationsCount': '999',
            'HonorableDonorSettings[1].BloodAndComponentsCount': '999',
            'HonorableDonorSettings[1].PlasmaCount': '0',
            'HonorableDonorSettings[2].DonationsCount': '999',
            'HonorableDonorSettings[2].BloodAndComponentsCount': '999',
            'HonorableDonorSettings[2].PlasmaCount': '0',
            'HonorableDonorSettings[3].DonationsCount': '999',
            'HonorableDonorSettings[3].BloodAndComponentsCount': '999',
            'HonorableDonorSettings[3].PlasmaCount': '0'
        }

        change_donor_settings(
            **{str(k): v
               for k, v in donations_counts.items()},
            NotifyRegistrarForHonorableDonor='true',
            CheckDonorInFicWhileDirection='false',
            CheckFiasAddressForDonor='false',
            CheckIncompleteAnalysis='false',
            AlwaysShowEpidAddress='false',
            CheckAntierythrocyteDonationOrExamination='false',
        )

        change_product_settings(AutoDonorAutomaticApprobationProducts='true')

        change_sticker_settings(PrintRunner='false')

        full_query = sql_query(query)

        donorid = str(full_query[0][0])

        main_page.open()

        aistium.fill(donorid, elements=main_page.quick_search_field)

        main_page.quick_search('click')

        main_page.loading_is_completed()

        ind = sql_query(
            "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC left join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and (PerC.UniqueId = '"
            + donorid + "' or IDoc.Number = '" + donorid +
            "')) Main where Main.UniqueId = '" + donorid + "'")[0][0]

        main_page.get_grid_values('UniqueId', ind, main_page.main_grid,
                                  'click')

        main_page.loading_is_completed()

        aistium.click_on(elements=main_page.process_state_button)

        main_page.loading_is_completed()

        assert aistium.get_text(
            elements=main_page.process_state_button) == 'Вернуть'

        assert len(
            sql_query(
                "select PrReg.Id from DonationProcessRegistry PrReg, ref.SystemSettings SysSet where PrReg.DonorId = '"
                + donorid +
                "' and PrReg.OrgId = SysSet.CurrentOrganizationId and PrReg.RegDate = cast(getdate() as date) and PrReg.CurrentState = 1 and PrReg.MobileTeamSessionId is null"
            )[0]) > 0

        payload = {'Login': BaseTest.login, 'Password': BaseTest.password}

        url = BaseTest.stand + '/Auth/LogOn'

        s = requests.Session()

        s.post(url, data=payload)

        body = {'donorId': donorid}

        s.post('http://10.32.200.142/Common/IsExaminationsSaved', data=body)

        body = {
            'id': donorid,
            'confirmed': 'true',
            'sessionId': '',
            'reason': 'автотест',
            'fromQuickRegistryForm': 'false',
            'recipientId': '',
            'donationTypeId': '',
            'noteType': 'Registration'
        }

        s.post(BaseTest.stand + '/Common/StepBackwardDonationProcess',
               data=body)
Exemple #21
0
    def test_donors_creation_mandatory_fields_only(self, lastname, firstname,
                                                   birthdate, gender,
                                                   document_serie,
                                                   document_number, address):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        region = address.split(':')[0]
        city = address.split(':')[1]
        street = address.split(':')[2]
        house = address.split(':')[3]

        full_address = [region, city, street, 'д.' + house]
        for item in full_address:
            if item == '':
                del (full_address[full_address.index(item)])

        full_name = lastname + ' ' + firstname

        main_page.newdonor_click()

        main_page.ndp_filling_first_page(lastname, firstname, '', birthdate,
                                         document_serie, document_number)
        if gender == 'Женский':
            main_page.select_gender('female')
            saved_gender = 'Ж'
        elif gender == 'Мужской':
            main_page.select_gender('male')
            saved_gender = 'М'

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_filling_region(region)

        if city != '':
            main_page.ndp_filling_city(city)

        main_page.ndp_filling_street(street)

        aistium.fill(house, elements=main_page.reg_fias_address_house)

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(elements=main_page.fio_minicard) == full_name

        #assert main_page.get_grid_values(' Fio', 1, main_page.main_grid) == full_name

        assert aistium.get_value(
            locators_list=locators,
            element_name='quick_search_field') == full_name + ' '

        assert main_page.get_gender_from_minicard() == saved_gender

        assert main_page.get_address_from_minicard() == full_address

        assert main_page.get_birthdate_from_minicard() == birthdate

        assert main_page.get_document_serie_and_number(
        ) == document_serie + ' ' + document_number
    def test_donors_creation_all_fields(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        change_general_settings(WorkWithSocialStatus='true')

        main_page.open()

        main_page.newdonor_click()

        main_page.ndp_filling_first_page('Петров', 'Константин', 'Семенович',
                                         '02.03.1980', '9360',
                                         '206519')  #mandatory fields only

        main_page.select_gender('male')

        if main_page.get_is_agree_persional_data_processing_value() != 'true':
            aistium.click_on(
                elements=main_page.is_agree_persional_data_processing)

        if main_page.get_is_message_agree_value() != 'true':
            aistium.click_on(elements=main_page.is_message_agree)

        main_page.filling_identity_document_issue_date('10.03.2000')

        aistium.fill('Учреждение выдачи паспортов',
                     elements=main_page.identity_document_issued_by)

        aistium.fill('14805696690', elements=main_page.snils_field)

        main_page.ndp_filling_birth_place('г. Москва')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_filling_region('Москва г')

        main_page.ndp_filling_street('Перова Поля 3-й проезд')

        aistium.fill('21', elements=main_page.reg_fias_address_house)

        main_page.ndp_filling_building('366')

        main_page.ndp_filling_structure('16')

        main_page.ndp_filling_flat('80')

        main_page.ndp_filling_contacts('9252451340', '4956280991',
                                       '*****@*****.**')

        aistium.fill('ООО Работа', elements=main_page.ndp_job_place_field)

        aistium.fill('Специалист', elements=main_page.job_position)

        aistium.fill('Безработные, в т.ч. домохозяйки',
                     elements=main_page.social_status_field)

        main_page.ndp_filling_deferral('А Прием алкоголя')

        main_page.ndp_filling_donation_type('110 Безв. доноp кpови')

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(
            elements=main_page.fio_minicard) == 'Петров Константин Семенович'

        assert main_page.get_grid_values(
            'Fio', 1, main_page.main_grid) == 'Петров Константин Семенович'

        assert aistium.get_value(
            locators_list=locators,
            element_name='quick_search_field') == 'Петров Константин Семенович'

        assert main_page.get_gender_from_minicard() == 'М'

        assert main_page.get_birthdate_from_minicard() == '02.03.1980'

        assert main_page.get_document_serie_and_number(
        ) == '9360' + ' ' + '206519'

        assert aistium.get_text(
            elements=main_page.deferral_from_minicard) == 'Прием алкоголя'

        assert main_page.get_donation_type_value_from_minicard(
        ) == '110 Безв. доноp кpови'

        assert main_page.get_email_from_minicard() == '*****@*****.**'

        assert aistium.get_text(
            elements=main_page.minicard_mobile_phone) == '+7 925 245 13 40'

        assert aistium.get_text(
            elements=main_page.minicard_phone) == '+7 4956280991'

        assert main_page.get_accurate_address(
        ) == '111141, Москва г, Перова Поля 3-й проезд, д.21, корп.366, стр.16, кв. 80'

        grid_donor_id = main_page.get_grid_values('UniqueId', 'active_cell',
                                                  main_page.main_grid)

        donors_card_title_page = DonorsCardTitle(grid_donor_id)

        donors_card_title_page.open()

        #assert donors_card_title_page.job_place() == 'ООО Работа' '''https://aj.srvdev.ru/browse/AIST-16521'''

        assert donors_card_title_page.job() == 'Специалист'

        assert donors_card_title_page.social_status(
        ) == 'Статус: ' + 'Безработные, в т.ч. домохозяйки'
    def test_donors_direction_warning_messages_с(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        change_donor_settings(CheckDonorInFicWhileDirection='false',
                              CheckFiasAddressForDonor='true',
                              CheckIncompleteAnalysis='true',
                              AlwaysShowEpidAddress='true')

        change_sticker_settings(PrintRunner='false')

        full_query = sql_query(
            '''select top(1) PerC.UniqueId Ent, 'Донор отведён (тип отвода: Абсолютный).' 
			OR1 from PersonCards PerC join AppointedDonationTypes AppD on PerC.UniqueId = AppD.DonorId 
			join (select AppD.DonorId, max(AppD.DonationDate) MaxDate from AppointedDonationTypes AppD group by AppD.DonorId) 
			Main on AppD.DonorId = Main.DonorId and AppD.DonationDate = Main.MaxDate 
			join ref.DonationTypeParams DonTP on AppD.DonationTypeId = DonTP.DonationTypeId 
			join ref.DonationTypes DonT on AppD.DonationTypeId = DonT.UniqueId 
			join Deferrals Def on PerC.UniqueId = Def.DonorId and Def.RevokeDate is null 
			join ref.DeferralTypes DefT on Def.DeferralTypeId = DefT.UniqueId and DefT.BaseType = 1 where PerC.IsDeleted != 1 
			and PerC.BirthDateIsUndefined = 0 and PerC.DeathDate is null and PerC.UniqueId not in 
			(select PrReg.DonorId from DonationProcessRegistry PrReg where PrReg.RegDate = cast(getdate() as date) and PrReg.CurrentState != 6) 
			and PerC.UniqueId not in (select Don.DonorId from Donations Don where cast(Don.DonationDate as date) = cast(getdate() as date)) 
			and PerC.UniqueId not in (select Def.DonorId from Deferrals Def join ref.DeferralTypes DefT on Def.DeferralTypeId = DefT.UniqueId 
			where ((DefT.BaseType = 2 and Def.RevokeDate is null) or (DefT.BaseType = 3 
			and (cast(Def.StopDate as date) >= cast(getdate() as date) or Def.StopDate is null)))) and PerC.Gender in (1,2) 
			and PerC.IdentityDocId is not null and ((PerC.RegAddressId is not null and (PerC.RegAddressIsInactive = 0 
			or PerC.RegAddressIsInactive is null)) or (PerC.FactAddressId is not null and (PerC.FactAddressIsInactive = 0 
			or PerC.FactAddressIsInactive is null)) or (PerC.TempAddressId is not null and (PerC.TempAddressIsInactive = 0 
			or PerC.TempAddressIsInactive is null))) and DonTP.IsActive = 1 and DonT.DonationParams not in (4, 5, 6, 7, 12, 15) 
			and (cast(AppD.NextDonationDate as date) <= cast(getdate() as date) or AppD.NextDonationDate is null) and DonT.ChargeType = 0 
			and PerC.UniqueId not in (select Don.DonorId from Donations Don where Don.ResultStatus != 5)'''
        )

        donorid = str(full_query[0][0])

        expected_message = str(full_query[0][1])

        main_page.open()

        aistium.fill(donorid, elements=main_page.quick_search_field)

        main_page.quick_search('click')

        main_page.loading_is_completed()

        ind = sql_query(
            "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC left join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and (PerC.UniqueId = '"
            + donorid + "' or IDoc.Number = '" + donorid +
            "')) Main where Main.UniqueId = '" + donorid + "'")[0][0]

        main_page.get_grid_values('UniqueId', ind, main_page.main_grid,
                                  'click')

        main_page.loading_is_completed()

        aistium.click_on(elements=main_page.process_state_button)

        main_page.loading_is_completed()

        aistium.click_on(locators_list=locators,
                         element_name='confirm_popup_yes_btn')

        main_page.loading_is_completed()

        assert aistium.get_text(main_page.process_state_button) == 'Вернуть'

        assert len(
            sql_query(
                "select PrReg.Id from DonationProcessRegistry PrReg, ref.SystemSettings SysSet where PrReg.DonorId = '"
                + donorid +
                "' and PrReg.OrgId = SysSet.CurrentOrganizationId and PrReg.RegDate = cast(getdate() as date) and PrReg.CurrentState = 1 and PrReg.MobileTeamSessionId is null"
            )[0]) > 0

        payload = {'Login': BaseTest.login, 'Password': BaseTest.password}

        url = BaseTest.stand + '/Auth/LogOn'

        s = requests.Session()

        s.post(url, data=payload)

        body = {'donorId': donorid}

        s.post('http://10.32.200.142/Common/IsExaminationsSaved', data=body)

        body = {
            'id': donorid,
            'confirmed': 'true',
            'sessionId': '',
            'reason': 'автотест',
            'fromQuickRegistryForm': 'false',
            'recipientId': '',
            'donationTypeId': '',
            'noteType': 'Registration'
        }

        s.post(BaseTest.stand + '/Common/StepBackwardDonationProcess',
               data=body)
    def test_ndp_moving_between_pages_second_step(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        change_general_settings(WorkWithSocialStatus='true')

        main_page.newdonor_click()

        main_page.ndp_filling_first_page('Сидоров', 'Иван', 'Петрович',
                                         '15.06.1980', '8933', '650245')

        main_page.select_gender('male')

        main_page.filling_identity_document_issue_date('20.11.2000')

        aistium.fill('А', elements=main_page.identity_document_issued_by)

        aistium.fill('19133561060', elements=main_page.snils_field)

        main_page.ndp_filling_birth_place('Б')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_filling_region('Москва г')

        main_page.ndp_filling_street('Перовская ул')

        aistium.fill('52', elements=main_page.reg_fias_address_house)

        main_page.ndp_filling_contacts('123456789', '123456789', '*****@*****.**')

        aistium.fill('Работа', elements=main_page.ndp_job_place_field)

        aistium.fill('К', elements=main_page.job_position)

        aistium.fill('Рабочие', main_page.social_status_field)

        main_page.ndp_filling_deferral(
            str(
                sql_query(
                    "select top(1) DefT.Code+' '+DefT.Name Otvod from ref.DeferralTypes DefT join ref.DeferralTypeParams DefTP on DefT.UniqueId = DefTP.DeferralTypeId where DefTP.IsActive = 1 and DefT.BaseType = 1"
                ))[3:-5])

        main_page.ndp_filling_donation_type(
            str(
                sql_query(
                    "select top(1) DonT.Code+' '+DonT.Name  from ref.DonationTypes DonT join ref.DonationTypeParams DonTP on DonT.UniqueId = DonTP.DonationTypeId where DonTP.IsActive = 1 and DonT.DonationParams not like '%4%' and DonT.ComponentType = 1"
                ))[3:-5])

        aistium.click_on(elements=main_page.previous_step_ndp)

        main_page.ndp_first_page_clear()

        main_page.ndp_select_document_type('Загранпаспорт РФ')

        main_page.select_gender('female')

        main_page.ndp_filling_first_page('Сидорова', 'Иванка', 'Петровна',
                                         '15.08.1980', '89', '6502455')

        main_page.filling_identity_document_issue_date('20.11.2002')

        aistium.fill('Б', elements=main_page.identity_document_issued_by)

        aistium.fill('24559224384', elements=main_page.snils_field)

        main_page.ndp_filling_birth_place('3')

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_fias_address_clear()

        main_page.ndp_contacts_clear()

        main_page.ndp_job_or_study_place_clear()

        aistium.click_on(elements=main_page.ndp_deferral_clear_button)

        main_page.ndp_donation_type_clear()

        main_page.ndp_filling_region('Москва г')

        main_page.ndp_filling_street('Кленовый б-р')

        aistium.fill('28', elements=main_page.reg_fias_address_house)

        main_page.ndp_filling_contacts('123456785', '123456783', '*****@*****.**')

        main_page.filling_job_or_study_place('Работа 2', 'К', 'Служащие')

        main_page.ndp_filling_deferral(
            str(
                sql_query(
                    "select top(1) DefT.Code+' '+DefT.Name Otvod from ref.DeferralTypes DefT join ref.DeferralTypeParams DefTP on DefT.UniqueId = DefTP.DeferralTypeId where DefTP.IsActive = 1 and DefT.BaseType = 2"
                ))[3:-5])

        main_page.ndp_filling_donation_type(
            str(
                sql_query(
                    "select top(1) DonT.Code+' '+DonT.Name from ref.DonationTypes DonT join ref.DonationTypeParams DonTP on DonT.UniqueId = DonTP.DonationTypeId where DonTP.IsActive = 1 and DonT.DonationParams not like '%4%' and DonT.ComponentType = 2"
                ))[3:-5])

        aistium.click_on(elements=main_page.previous_step_ndp)

        main_page.ndp_first_page_check_values_of_mandatory_fields(
            'Сидорова', 'Иванка', '15.08.1980', '89', '6502455')

        aistium.get_value(locators_list=locators,
                          element_name='middle_name_field_ndp') == 'Петровна'

        aistium.get_value(
            locators_list=locators,
            element_name='identity_document_issue_date') == '20.11.2002'

        aistium.get_value(locators_list=locators,
                          element_name='identity_document_issued_by') == 'Б'

        aistium.get_value(locators_list=locators,
                          element_name='ndp_birth_place') == '3'

        aistium.get_value(locators_list=locators,
                          element_name='snils_field') == '24559224384'

        main_page.identity_document_issued_by_clear()

        aistium.fill('Бв', elements=main_page.identity_document_issued_by)

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        main_page.if_donor_is_in_local_cabinet()

        main_page.ndp_second_page_loaded()

        main_page.ndp_get_contacts_values() == ('123456785', '123456783',
                                                '*****@*****.**')

        main_page.ndp_second_page_check_values_of_mandatory_fields() == (
            'Москва г', '', 'Кленовый б-р', '28')

        main_page.ndp_get_job_information() == ('Работа 2', 'К', 'Служащие')

        assert aistium.get_value(
            locators_list=locators, element_name='ndp_deferral_field'
        ) == str(
            sql_query(
                "select top(1) DefT.Code+' '+DefT.Name Otvod from ref.DeferralTypes DefT join ref.DeferralTypeParams DefTP on DefT.UniqueId = DefTP.DeferralTypeId where DefTP.IsActive = 1 and DefT.BaseType = 2"
            ))[3:-5]

        main_page.ndp_get_donation_type() == str(
            sql_query(
                "select top(1) DonT.Code+' '+DonT.Name from ref.DonationTypes DonT join ref.DonationTypeParams DonTP on DonT.UniqueId = DonTP.DonationTypeId where DonTP.IsActive = 1 and DonT.DonationParams not like '%4%' and DonT.ComponentType = 2"
            ))[3:-5]

        main_page.ndp_phone_clear()

        main_page.ndp_filling_contacts('', '123456788', '')

        main_page.ndp_save_new_donor('success')

        assert aistium.get_text(
            elements=main_page.fio_minicard) == 'Сидорова Иванка Петровна'

        assert aistium.get_text(
            elements=main_page.minicard_phone) == '123456788'

        grid_donor_id = main_page.get_grid_values('UniqueId', 'active_cell',
                                                  main_page.main_grid)

        donors_card_title_page = DonorsCardTitle(grid_donor_id)

        donors_card_title_page.open()

        donors_card_title_page.issued_by() == 'Бв 20.11.2002'
    def test_donors_direction_information_messages(self, query, test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        full_query = sql_query(query)

        donor_id = str(full_query[0][0])

        expected_message = str(full_query[0][1])

        str_index = str(full_query[0][2])

        donations_count = str(full_query[0][3])

        blood_and_components_count = str(full_query[0][4])

        plasma_count = str(full_query[0][4])

        donations_counts = {
        'HonorableDonorSettings[0].DonationsCount': '999',
        'HonorableDonorSettings[0].BloodAndComponentsCount': '999',
        'HonorableDonorSettings[0].PlasmaCount': '999',
        'HonorableDonorSettings[1].DonationsCount': '999',
        'HonorableDonorSettings[1].BloodAndComponentsCount': '999',
        'HonorableDonorSettings[1].PlasmaCount': '999',
        'HonorableDonorSettings[2].DonationsCount': '999',
        'HonorableDonorSettings[2].BloodAndComponentsCount': '999',
        'HonorableDonorSettings[2].PlasmaCount': '999',
        'HonorableDonorSettings[3].DonationsCount': '999',
        'HonorableDonorSettings[3].BloodAndComponentsCount': '999',
        'HonorableDonorSettings[3].PlasmaCount': '999'
        }

        donations_counts['HonorableDonorSettings['+str_index+'].DonationsCount'] = donations_count

        donations_counts['HonorableDonorSettings['+str_index+'].BloodAndComponentsCount'] = blood_and_components_count

        donations_counts['HonorableDonorSettings['+str_index+'].PlasmaCount'] = plasma_count

        change_donor_settings(**{str(k): v for k, v in donations_counts.items()},
            DonorsModuleRegistryPage='false',
            CheckFiasAddressForDonor='false',
            CheckIncompleteAnalysis='false',
            NotifyRegistrarForHonorableDonor='true')

        change_sticker_settings(PrintRunner='false')

        main_page.open()

        aistium.fill(donor_id, elements = main_page.quick_search_field)

        main_page.quick_search('click')

        main_page.loading_is_completed()

        ind = sql_query("select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC left join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and (PerC.UniqueId = '"+donor_id+"' or IDoc.Number = '"+donor_id+"')) Main where Main.UniqueId = '"+donor_id+"'")[0][0]

        main_page.get_grid_values('UniqueId', ind, main_page.main_grid, 'click')

        main_page.loading_is_completed()

        aistium.click_on(elements=main_page.process_state_button)

        main_page.loading_is_completed()

        if aistium.get_background_color(locators_list=locators, element_name='popup_titlebar') == '#E19F50':
            aistium.click_on(locators_list=locators, element_name='confirm-popup-yes')
        else: 
            pass

        assert main_page.get_alert_text() == expected_message

        assert aistium.get_text(elements=main_page.process_state_button) == 'Вернуть'