Exemple #1
0
    def test_grid_rh(self, query, expected_color, test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        full_query = sql_query(query)

        donorid, rh = str(full_query[0][0]), 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]

        assert main_page.get_grid_values('Rh', ind, main_page.main_grid) == rh

        assert convert_to_hex(
            main_page.get_grid_values(
                'Rh', ind, main_page.main_grid,
                mode='background-color')) == expected_color
    def test_donor_minicard_diseases_grid_create_date(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_result = 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('№', ind, 'click')

        main_page.loading_is_completed()

        aistium.click_on(elements=main_page.diseases_button)

        main_page.loading_is_completed()

        assert main_page.get_grid_values(
            'CreateDate', 1, main_page.diseases_grid) == expected_result
Exemple #3
0
    def test_step_backward_donation_process_alerts(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)

        assert expected_message == main_page.get_alert_text()
Exemple #4
0
    def test_ndp_checking_donor_by_fic_rc_a(self, query, st, row_index):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        change_donor_settings(UseFicDonorSearch='true')

        main_page.open()

        query = sql_query(query, stand=st)

        document_serie = query[0][0]

        document_number = query[0][1]

        expected = query[0][2]

        main_page.newdonor_click()

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

        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_results_by_fic_is_on_the_page()

        assert main_page.ndp_results_by_fic_get_grid_values(
            'РК', int(row_index)) == expected
    def test_grid_donor_id(self, query, test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        full_query = sql_query(query)

        donor_id, fullname, lastname, firstname, middlename = str(
            full_query[0][0]), full_query[0][1], full_query[0][2], full_query[
                0][3], full_query[0][4]

        main_page.clear_localstorage()

        main_page.open()

        aistium.fill(fullname, 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 where PerC.IsDeleted != 1 and PerC.LastName like '"
            + lastname + "%' and PerC.FirstName like '" + firstname +
            "%' and PerC.MiddleName like '" + middlename +
            "%') Main where Main.UniqueId = " + donor_id)[0][0]

        assert main_page.get_grid_values('UniqueId', ind,
                                         main_page.main_grid) == donor_id
    def test_simple_search_d(self):
        main_page = DonorsModuleRegistryPage()

        donorid = str(
            sql_query(
                "select top (1) PerC.UniqueId from PersonCards PerC join IdentityDocs IDoc on IDoc.UniqueId = PerC.IdentityDocId where convert(nvarchar(10), PerC.UniqueId) not in (select IDoc.Number from IdentityDocs IDoc) and PerC.IsDeleted != 1"
            )[0][0])

        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]

        assert main_page.is_grid_row_selected(ind) == True

        assert main_page.link_to_donor_card(
        ) == BaseTest.stand + '/Donor/Registration/Edit/' + donorid + '?showDeleted=False'
Exemple #7
0
    def test_ndp_validation_of_donation_type_second_case(
            self, expected_color_back, expected_color_text, expected_type,
            test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        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="

        main_page.newdonor_click()

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

        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_donation_type(
            sql_query(query + expected_type)[0][0])

        assert convert_to_hex(main_page.ndp_get_donation_type_color()).lower(
        ) == expected_color_back

        assert convert_to_hex(main_page.ndp_get_donation_type_text_color()
                              ).lower() == expected_color_text
Exemple #8
0
    def test_ndp_document_date_validation_messages(self, date_issue, issued_by,
                                                   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.fill(issued_by, elements=main_page.identity_document_issued_by)

        main_page.filling_identity_document_issue_date(date_issue)

        main_page.identity_document_issued_date_focusout()

        aistium.click_on(elements=main_page.next_step_ndp)

        main_page.loading_is_completed()

        assert main_page.get_validation_message_text() == expected_result
Exemple #9
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) == "Сидоров " + "Афанасий"
Exemple #10
0
    def test_ndp_validation_of_donation_type_fifth_case(
            self, donation_type, 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",
                                         "3608", "360471")

        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()

        assert main_page.ndp_filling_donation_type(
            donation_type, mode='does_not_exists') == True

        main_page.ndp_donation_type_focus_out()

        assert main_page.ndp_get_donation_type() == ''

        main_page.ndp_save_new_donor('success')
Exemple #11
0
    def test_extended_search_by_gender_c(self, gender, query,
                                         test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        donorid = str(sql_query(query)[0][0])

        ind = sql_query(
            "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC where PerC.IsDeleted != 1 and PerC.Gender = case when '"
            + gender +
            "' = 'Мужской' then '1' else '2' end) Main where Main.UniqueId = '"
            + donorid + "'")[0][0]

        main_page.clear_localstorage()

        main_page.open()

        main_page.extended_search_click('open')

        main_page.filling_gender_in_extended_search(gender)

        aistium.click_on(elements=main_page.extended_search_button)

        main_page.loading_is_completed()

        assert main_page.get_grid_values('UniqueId', ind,
                                         main_page.main_grid) == donorid

        assert main_page.number_of_entities_at_grid_including_hidden(
        ) == sql_query(
            "select count ( * ) Q from PersonCards PerC where PerC.IsDeleted != 1 and PerC.Gender = case when '"
            + gender + "' = 'Мужской' then '1' else '2' end")[0][0]
    def test_extended_search_by_lastname_b(self, query, test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        full_query = sql_query(query)

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

        lastname = full_query[0][1]

        ind = sql_query(
            "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC where PerC.IsDeleted != 1 and PerC.LastName like '%"
            + lastname + "%') Main where Main.UniqueId = '" + donorid +
            "'")[0][0]

        main_page.clear_localstorage()

        main_page.open()

        main_page.extended_search_click('open')

        main_page.filling_fio_in_extended_search(lastname, '', '')

        aistium.click_on(elements=main_page.extended_search_button)

        main_page.loading_is_completed()

        assert main_page.get_grid_values('UniqueId', ind,
                                         main_page.main_grid) == donorid

        assert main_page.number_of_entities_at_grid_including_hidden(
        ) == sql_query(
            "select count ( * ) Q from PersonCards PerC where PerC.IsDeleted != 1 and PerC.LastName like '%"
            + lastname + "%'")[0][0]
	def test_extended_search_by_donation_barcode_b(self, query, test_data_set_number):
		main_page = DonorsModuleRegistryPage()

		full_query = sql_query(query)

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

		barcode = full_query[0][1]

		ind = sql_query("select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC join Donations Don on PerC.UniqueId = Don.DonorId where PerC.IsDeleted != 1 and Don.Barcode like '%' + replace('"+barcode+"', '=7', '') + '%' group by PerC.UniqueId, PerC.BirthDate) Main where Main.UniqueId = '"+donorid+"'")[0][0]

		main_page.clear_localstorage()

		main_page.open()

		main_page.extended_search_click('open')

		aistium.fill(barcode, elements=main_page.extended_donation_barcode)

		aistium.click_on(elements=main_page.extended_search_button)

		main_page.loading_is_completed()

		assert main_page.get_grid_values('UniqueId', ind, main_page.main_grid) == donorid

		assert main_page.number_of_entities_at_grid_including_hidden() == sql_query("select count (distinct PerC.UniqueId) from PersonCards PerC join Donations Don on PerC.UniqueId = Don.DonorId where PerC.IsDeleted != 1 and Don.Barcode like '%' + replace('"+barcode+"', '=7', '') + '%'")[0][0]
    def test_reset_search_filters_e(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        simple_search_donorid = str(
            sql_query(
                "select top (1) PerC.UniqueId Ent from PersonCards PerC where PerC.Gender = '1' and PerC.IsDeleted != '1'"
            )[0][0])

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

        main_page.quick_search('press_enter')

        main_page.loading_is_completed()

        extended_search_donorid = str(
            sql_query(
                "select top (1) PerC.UniqueId Ent from PersonCards PerC where PerC.Gender = '2' and PerC.IsDeleted != '1'"
            )[0][0])

        main_page.extended_search_click('open')

        aistium.fill(extended_search_donorid,
                     elements=main_page.extended_registry_number)

        aistium.click_on(elements=main_page.extended_search_button)

        main_page.loading_is_completed()

        assert aistium.get_value(locators_list=locators,
                                 element_name='quick_search_field') == ''
Exemple #15
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
	def test_email_validation(self, email, 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('', '', email)

		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 main_page.get_email_from_minicard() == expected_result
	def test_donor_minicard_job_place_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])

		change_donor_settings(ShowJobInfo='true')

		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()

		if expected_result == '':
			assert aistium.element_is_on_the_page(locators_list='minicard_job_place_label',element_name='minicard_job_place_label') == False
		else:
			assert main_page.minicard_get_job_place() == 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'
	def test_donors_registry_extended_search_filters(self):

		full_name = sql_query("select top (1) PerC.LastName, PerC.FirstName from PersonCards PerC where PerC.Gender = '2' and PerC.LastName not like '%[a-zA-Z0-9]%' and PerC.FirstName not like '%[a-zA-Z0-9]%'")

		main_page = DonorsModuleRegistryPage()

		main_page.clear_localstorage()

		main_page.open()

		main_page.extended_search_click('open')

		main_page.filling_fio_in_extended_search(full_name[0][0], full_name[0][1])

		aistium.click_on(elements=main_page.extended_search_button)

		main_page.loading_is_completed()

		quantity = main_page.number_of_entities_at_grid()

		main_page.open()

		main_page.loading_is_completed()

		assert main_page.get_lastname_from_extended_search() == full_name[0][0]

		assert main_page.get_firstname_from_extended_search() == full_name[0][1]

		assert quantity == main_page.number_of_entities_at_grid()
Exemple #20
0
    def test_grid_phenotype_с(self, query, test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        change_general_settings(UsePhenotypeShortFormat='true')

        full_query = sql_query(query)

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

        phenotype = convert_phenotype(expected_result)

        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]

        assert main_page.get_grid_values('Phenotype', ind,
                                         main_page.main_grid) == phenotype
Exemple #21
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_reset_search_filters_a(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        assert main_page.reset_filters_is_not_on_page() == True
Exemple #23
0
    def test_job_place_enter_value(self):

        i = 1

        sel = 'a'

        while len(sel) > 0:
            place_ent = str(
                sql_query(
                    "select ls.Pl from (select row_number() over (order by PerC.UniqueId asc) as rank, PerC.JobInfo + ' ООО' Pl from PersonCards PerC where len(PerC.JobInfo) < 57 and PerC.JobInfo not like '%[a-zA-Z0-9?!_+=*\/%()}{<>^]%') ls where ls.rank = '"
                    + str(i) + "'"))[3:-5]
            sel = str(
                sql_query(
                    "select top (1) PerC.JobInfo from PersonCards PerC where PerC.JobInfo = '"
                    + place_ent + "'"))[3:-5]
            i = i + 1

        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        main_page.newdonor_click()

        main_page.ndp_filling_first_page('Сидоров', "Анатолий", "",
                                         "01.06.1980", "2910", "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('Перова Поля 3-й проезд')

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

        aistium.fill(place_ent, elements=main_page.ndp_job_place_field)

        main_page.ndp_save_new_donor('success')

        main_page.loading_is_completed()

        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() == place_ent
    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) == 'Сидоров Алексей'
    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) == 'Сидоров Алексей'
    def test_extended_search_a(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        main_page.extended_search_click('open')

        assert main_page.is_extended_search_button_disable() == 'true'
Exemple #27
0
    def test_extended_search_by_gender_a(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        main_page.extended_search_click('open')

        assert main_page.get_genders_listbox_from_extended_search() == [
            'Пол', 'Женский', 'Мужской'
        ]
    def test_simple_search_a(self):
        main_page = DonorsModuleRegistryPage()

        main_page.clear_localstorage()

        main_page.open()

        main_page.quick_search('click')

        main_page.loading_is_completed()

        assert main_page.number_of_entities_at_grid() == 0
	def test_extended_search_by_donation_barcode_a(self, barcode, expected_result, test_data_set_number):
		main_page = DonorsModuleRegistryPage()

		main_page.clear_localstorage()

		main_page.open()

		main_page.extended_search_click('open')

		aistium.fill(barcode, elements=main_page.extended_donation_barcode)

		assert main_page.get_barcode_from_extended_search() == expected_result
Exemple #30
0
    def test_extended_search_by_document_serie_b(self, document_type, query,
                                                 test_data_set_number):
        main_page = DonorsModuleRegistryPage()

        full_query = sql_query(query)

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

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

        ind = sql_query(
            "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and IDoc.Serie = '"
            + document_serie +
            "' and cast(IDoc.DocType as varchar) like case when '" +
            document_type + "' = '' then '%' when '" + document_type +
            "' = 'Паспорт РФ' then '1' when '" + document_type +
            "' = 'Военный билет' then '2' when '" + document_type +
            "' = 'Загранпаспорт РФ' then '3' when '" + document_type +
            "' = 'Паспорт СССР' then '4' when '" + document_type +
            "' = 'Иные документы' then '5' when '" + document_type +
            "' = 'Св-во о рождении' then '6' end) Main where Main.UniqueId = '"
            + donorid + "'")[0][0]

        main_page.clear_localstorage()

        main_page.open()

        main_page.extended_search_click('open')

        main_page.filling_doc_type_in_extended_search(document_type)

        main_page.filling_doc_serie_in_extended_search(document_serie)

        aistium.click_on(elements=main_page.extended_search_button)

        main_page.loading_is_completed()

        assert main_page.get_grid_values(' UniqueId', ind,
                                         main_page.main_grid) == donorid

        assert main_page.number_of_entities_at_grid_including_hidden(
        ) == sql_query(
            "select count ( * ) Q from PersonCards PerC join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and IDoc.Serie = '"
            + document_serie +
            "' and cast(IDoc.DocType as varchar) like case when '" +
            document_type + "' = '' then '%' when '" + document_type +
            "' = 'Паспорт РФ' then '1' when '" + document_type +
            "' = 'Военный билет' then '2' when '" + document_type +
            "' = 'Загранпаспорт РФ' then '3' when '" + document_type +
            "' = 'Паспорт СССР' then '4' when '" + document_type +
            "' = 'Иные документы' then '5' when '" + document_type +
            "' = 'Св-во о рождении' then '6' end")[0][0]