def test_simple(self): main_page = DonorsModuleRegistryPage() donor_number = 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(donor_number, elements=main_page.quick_search_field) main_page.quick_search('click') main_page.loading_is_completed() assert main_page.get_grid_values('UniqueId', 'active_cell', main_page.main_grid) == donor_number
def test_birthdate_validation_confirm_yes(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_yes_btn') main_page.if_donor_is_in_local_cabinet() main_page.ndp_second_page_loaded()
def test_gender_validation(self, middlename, gender, expected_result, test_data_set_number): main_page = DonorsModuleRegistryPage() main_page.open() main_page.newdonor_click() main_page.ndp_filling_first_page("Сидоров", "Кирилл", middlename, "01.06.1980", "8910", "650231") main_page.select_gender(gender) 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.check_saved_gender(expected_result) == expected_result
def test_grid_address_reg(self, query, test_data_set_number): main_page = DonorsModuleRegistryPage() full_query = sql_query(query) donorid, address_reg = 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('RegAddress', ind, main_page.main_grid) == address_reg
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')
def test_extended_search_by_document_type_c(self, document_type, 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 join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and IDoc.DocType = case 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) 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.DocType = case 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]
def test_simple_search_c(self): main_page = DonorsModuleRegistryPage() donorid = str( sql_query( "select top (1) PerC.UniqueId Ent from PersonCards PerC where PerC.IsDeleted = '1' and convert(nvarchar(10), PerC.UniqueId) not in (select IDoc.Number Nb from IdentityDocs IDoc)" )[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() assert main_page.get_alert_text() == 'Донор не найден.' assert main_page.number_of_entities_at_grid() == 0
def test_extended_search_by_birthdate_validation_messages( self, birthdate_from, birthdate_to, expected_result, test_data_set_number): main_page = DonorsModuleRegistryPage() main_page.clear_localstorage() main_page.open() main_page.extended_search_click('open') aistium.fill(birthdate_from, elements=main_page.extended_birthdate_from) aistium.fill(birthdate_to, elements=main_page.extended_birthdate_to) aistium.click_on(elements=main_page.extended_search_button) main_page.loading_is_completed() assert main_page.get_alert_text() == expected_result
def test_ndp_validation_of_donation_type_third_case(self): 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%'" main_page.newdonor_click() main_page.ndp_filling_first_page("Сидоров", "Вадим", '', "19.06.1980", "8928", "650249") 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('22', elements=main_page.reg_fias_address_house) main_page.ndp_filling_donation_type(sql_query(query)[0][0]) main_page.ndp_donation_type_clear() main_page.ndp_donation_type_focus_out() assert main_page.ndp_get_donation_type() == '' main_page.ndp_save_new_donor('success') assert main_page.get_donation_type_value_from_minicard( ) == 'ДОНАЦИЯ НЕ УКАЗАНА'
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_ndp_checking_donor_by_fic_b(self): main_page = DonorsModuleRegistryPage() main_page.clear_localstorage() change_donor_settings(UseFicDonorSearch='true') main_page.open() query = sql_query( '''select top (1) PerC.IdentityDocSerie, PerC.IdentityDocNumber, substring(ltrim(PerC.RegNodeId), 1, 2) as OR1 from aistdb_fic.dbo.PersonCards PerC where len(PerC.RegNodeId) != 5 and len(PerC.LastName) > 0 and len(PerC.FirstName) > 0 and len(PerC.MiddleName) > 0 and len(PerC.IdentityDocType) > 0 and len(PerC.IdentityDocSerie) > 0''', stand='DRIVER={SQL Server};SERVER=10.36.200.79;DATABASE=aistdb_fic;UID=sa;PWD=Mos111222' ) 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.
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) == "Сидоров " + "Никита"
def test_donor_minicard_gender(self, query, expected_result, test_data_set_number): main_page = DonorsModuleRegistryPage() donorid = str(sql_query(query)[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] main_page.get_grid_values('UniqueId', ind, main_page.main_grid, 'click') main_page.loading_is_completed() assert main_page.get_gender_from_minicard() == expected_result
def test_document_number_validation(self, document_type, document_serie, document_number, expected_result, test_data_set_number): main_page = DonorsModuleRegistryPage() main_page.open() main_page.newdonor_click() main_page.ndp_select_document_type(document_type) main_page.ndp_filling_first_page("Сидоров", "Кирилл", '', "01.06.1980", document_serie, document_number) main_page.select_gender('male') assert aistium.get_value(locators_list=locators, element_name='document_number_field_ndp') == expected_result 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()
def test_firstname_validation_message(self, firstname, expected_result, test_data_set_number): main_page = DonorsModuleRegistryPage() main_page.open() main_page.newdonor_click() main_page.ndp_filling_first_page("Сидоров", firstname, "", "01.06.1980", "8910", "650231") main_page.select_gender('male') assert aistium.get_value( locators_list=locators, element_name='first_name_field_ndp') == expected_result aistium.click_on(elements=main_page.next_step_ndp) main_page.if_donor_is_in_local_cabinet() main_page.ndp_second_page_loaded()
def test_extended_search_by_birthdate_a(self, birthdate, expected_result, test_data_set_number): main_page = DonorsModuleRegistryPage() main_page.clear_localstorage() main_page.open() main_page.extended_search_click('open') if 'today' in birthdate: aistium.fill(date_calculation(birthdate), elements=main_page.extended_birthdate_from) aistium.fill(date_calculation(birthdate), elements=main_page.extended_birthdate_to) else: aistium.fill(birthdate, elements=main_page.extended_birthdate_from) aistium.fill(birthdate, elements=main_page.extended_birthdate_to) if 'today' in expected_result: assert main_page.get_birth_date_from_from_extended_search( ) == date_calculation(expected_result) assert main_page.get_birth_date_to_from_extended_search( ) == date_calculation(expected_result) else: assert main_page.get_birth_date_from_from_extended_search( ) == expected_result assert main_page.get_birth_date_to_from_extended_search( ) == expected_result
def test_reset_search_filters_b(self): main_page = DonorsModuleRegistryPage() query = "select top (1) PerC.UniqueId Ent from PersonCards PerC where PerC.Gender = '1' and PerC.IsDeleted != '1'" donorid = str(sql_query(query)[0][0]) main_page.clear_localstorage() main_page.open() aistium.fill(donorid, elements=main_page.quick_search_field) main_page.quick_search('press_enter') main_page.loading_is_completed() main_page.reset_filters_click() main_page.loading_is_completed() assert main_page.number_of_entities_at_grid() == 0
def test_donor_minicard_diseases_grid_revoke_date_b( 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() if main_page.get_diseases_only_active_value() == 'true': aistium.click_on(elements=main_page.diseases_only_active) assert main_page.get_grid_values( 'RevokeDate', 1, main_page.diseases_grid) == expected_result
def test_ndp_checking_donor_by_fic_fullname_a(self, query, row_index): main_page = DonorsModuleRegistryPage() main_page.clear_localstorage() change_donor_settings(UseFicDonorSearch='true') main_page.open() query = sql_query( query, stand= "DRIVER={SQL Server};SERVER=10.36.200.79;DATABASE=aistdb_fic;UID=sa;PWD=Mos111222" ) 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_simple_search_e(self): main_page = DonorsModuleRegistryPage() lastname = str( sql_query( "select top (1) PerC.LastName Ent from PersonCards PerC join (select PerC.LastName, count ( * ) Q from PersonCards PerC where PerC.IsDeleted != 1 group by PerC.LastName) GL on PerC.LastName = Gl.LastName where PerC.IsDeleted != 1 and PerC.LastName not like '%[a-zA-Z0-9?!_+=*\/%()}{<>^]%' and Gl.Q > 1" )[0][0]) main_page.clear_localstorage() main_page.open() aistium.fill(lastname, elements=main_page.quick_search_field) main_page.quick_search('click') main_page.loading_is_completed() assert main_page.number_of_entities_at_grid() > 1 assert main_page.is_element_positioned('SimpleSearchText') == True assert main_page.is_simple_search_text_selected() == lastname
def test_document_serie_validation_messages(self, document_type, document_serie, document_number, expected_result, test_data_set_number): main_page = DonorsModuleRegistryPage() main_page.open() main_page.newdonor_click() main_page.ndp_select_document_type(document_type) 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() assert main_page.get_validation_message_text() == expected_result
def test_simple(self): main_page = DonorsModuleRegistryPage() Sel1 = 1 Sel2 = 1 I = 1 while (Sel1 > 0 or Sel2 > 0): donor_number = str( sql_query( "select ls.Nm from (select row_number() over (order by PerC.UniqueId desc) as rank, replace(str(PerC.UniqueId), ' ','') + replace(str(" + str(I) + "), ' ','') Nm from PersonCards PerC where PerC.IsDeleted != 1) ls where ls.rank = " + str(I))[0][0]) Sel1 = len( sql_query( "select top (1) replace(IdDoc.Number, ' ','') Ent from IdentityDocs IdDoc where replace(IdDoc.Number, ' ','') = '" + donor_number + "'")) Sel2 = len( sql_query( "select top (1) replace(str(PerC.UniqueId), ' ','') Ent from PersonCards PerC where replace(str(PerC.UniqueId), ' ','') = '" + donor_number + "'")) I = I + 1 main_page.clear_localstorage() main_page.open() aistium.fill(donor_number, elements=main_page.quick_search_field) main_page.quick_search('click') main_page.loading_is_completed() assert main_page.get_snils_alert_text() == "Донор не найден."
def test_job_place_select_value(self): main_page = DonorsModuleRegistryPage() main_page.open() place_ent = str(sql_query("select top (1) lower(substring(PerC.JobInfo, 2, 6)) Ent from PersonCards PerC where len(PerC.JobInfo) > 10 and PerC.JobInfo not like '%[a-zA-Z0-9?!_+=*\/%()}{<>^%]'"))[3:-5] places_s = [] 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() aistium.fill(place_ent, elements=main_page.ndp_job_place_field) for place_s in main_page.ndp_place_list_on_form(): places_s.append(str(place_s)) job_place_need = places_s[0] aistium.fill(Keys.ENTER, elements=main_page.ndp_job_place_field) job_place = aistium.get_value(locators_list=locators, element_name='job_place') assert job_place == job_place_need
def test_transfer_from_quick_search_to_ndpr(self, search_line, expected_result1, expected_result2, expected_result3, test_data_set_number): main_page = DonorsModuleRegistryPage() main_page.open() aistium.fill(search_line, elements=main_page.quick_search_field) main_page.newdonor_click() assert aistium.get_value( locators_list=locators, element_name='last_name_field_ndp') == expected_result1 assert aistium.get_value( locators_list=locators, element_name='first_name_field_ndp') == expected_result2 assert aistium.get_value( locators_list=locators, element_name='middle_name_field_ndp') == expected_result3
def test_donor_minicard_job_place_b(self): main_page = DonorsModuleRegistryPage() donorid = str(sql_query("select top(1) PerC.UniqueId Ent from PersonCards PerC where PerC.IsDeleted != 1 and len(PerC.JobInfo) > 0")[0][0]) change_donor_settings(ShowJobInfo='false') 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.element_is_on_the_page(locators_list='minicard_job_place_label',element_name='minicard_job_place_label') == False
def test_ndp_job_position_message(self, job_position, 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_region('Москва г') main_page.ndp_filling_street('Перовская ул') main_page.ndp_filling_house('4') aistium.fill(job_position, elements=main_page.job_position) main_page.ndp_save_new_donor('success') main_page.loading_is_completed() assert main_page.get_validation_message_text() == expected_result
def test_donors_registry_simple_search_filters(self): main_page = DonorsModuleRegistryPage() main_page.clear_localstorage() main_page.open() assert main_page.get_title() == 'Регистратура донорского отделения' aistium.fill(sql_query("select top (1) PerC.LastName + ' ' + PerC.FirstName from PersonCards PerC where PerC.Gender = '1' and PerC.LastName not like '%[a-zA-Z0-9]%' and PerC.FirstName not like '%[a-zA-Z0-9]%'")[0][0], elements=main_page.quick_search_field) main_page.quick_search('click') main_page.loading_is_completed() quantity = main_page.number_of_entities_at_grid() main_page.open() main_page.loading_is_completed() assert aistium.get_value(locators_list=locators, element_name='quick_search_field') == sql_query("select top (1) PerC.LastName + ' ' + PerC.FirstName from PersonCards PerC where PerC.Gender = '1' and PerC.LastName not like '%[a-zA-Z0-9]%' and PerC.FirstName not like '%[a-zA-Z0-9]%'")[0][0] assert quantity == main_page.number_of_entities_at_grid()
def test_donor_minicard_fio_c(self): main_page = DonorsModuleRegistryPage() donorid = str( sql_query( "select top(1) PerC.UniqueId Ent from PersonCards PerC where PerC.IsDeleted != 1 and PerC.LastName not like '%[a-zA-Z0-9.- ,:;?!_+=*\/|%()}{<>`~@#$^&№«»]%' and PerC.FirstName not like '%[a-zA-Z0-9.- ,:;?!_+=*\/|%()}{<>`~@#$^&№«»]%' and PerC.MiddleName not like '%[a-zA-Z0-9.- ,:;?!_+=*\/|%()}{<>`~@#$^&№«»]%' and len(PerC.LastName) > 0 and len(PerC.FirstName) > 0 and len(PerC.MiddleName) > 0" )[0][0]) donors_card_title_page = DonorsCardTitle(donorid) 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() main_page.fio_minicard.click() donors_card_title_page.loading_is_completed() assert donors_card_title_page.get_url( ) == BaseTest.stand + '/Donor/Registration/Edit/' + donorid + '?showDeleted=False'
def test_grid_kell(self, query, expected_color, expected_text_color, test_data_set_number): main_page = DonorsModuleRegistryPage() full_query = sql_query(query) donorid, kell = 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('Kell', ind) == kell assert convert_to_hex(main_page.get_grid_values('Kell', ind, main_page.main_grid, mode='background-color')) == expected_color assert convert_to_hex(main_page.get_grid_values('Kell', ind, main_page.main_grid, mode='color')) == expected_text_color