def test_ndp_document_issued_by(self, issued_by, expected_result, 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') main_page.filling_identity_document_issue_date('10.10.2010') aistium.fill(issued_by, elements=main_page.identity_document_issued_by) aistium.click_on(elements=main_page.next_step_ndp) main_page.if_donor_is_in_local_cabinet() main_page.loading_is_completed() main_page.ndp_second_page_loaded() aistium.click_on(elements=main_page.previous_step_ndp) assert aistium.get_value( locators_list=locators, element_name='identity_document_issued_by') == expected_result
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_ndp_validation_of_social_status_and_job_info_c(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("Сидоров", "Станислав", '', "03.06.1980", "8912", "650233") 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('6', elements=main_page.reg_fias_address_house) 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_deferral_type_color_and_type(self, expected_color, expected_type, test_data_set_number): main_page = DonorsModuleRegistryPage() 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() if expected_type == 'Временный': 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]) assert aistium.get_value( locators_list=locators, element_name='ndp_deferral_type') == expected_type assert convert_to_hex( main_page.ndp_get_deferral_type_color()) == expected_color elif expected_type == 'Контроль': 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]) assert aistium.get_value( locators_list=locators, element_name='ndp_deferral_type') == expected_type assert convert_to_hex( main_page.ndp_get_deferral_type_color()) == expected_color elif expected_type == 'Абсолютный': 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]) assert aistium.get_value( locators_list=locators, element_name='ndp_deferral_type') == expected_type assert convert_to_hex( main_page.ndp_get_deferral_type_color()) == expected_color
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) == "Сидоров " + "Дмитрий"
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) == "Сидоров " + "Кирилл"
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
def test_ndp_job_place_verify_list(self): main_page = DonorsModuleRegistryPage() main_page.open() place_ent = str( sql_query( "select top (1) lower(substring(PerC.JobInfo, 2, 3)) Ent from PersonCards PerC where len(PerC.JobInfo) > 5 and PerC.JobInfo not like '%[a-zA-Z0-9?!_+=*\/%()}{<>^%' and substring(PerC.JobInfo, 4, 1) != ' '" ))[3:-5] places_db = [] 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 in sql_query( "select upper(PerC.JobInfo) JobInfo from PersonCards PerC where PerC.JobInfo like '%" + place_ent + "%'"): places_db.append(place[0]) places_db = list(OrderedDict(zip(places_db, repeat(None)))) places_db.sort() for place_s in main_page.ndp_place_list_on_form(): places_s.append(str(place_s).upper()) job_place_need = places_s[0] places_s.sort() assert places_s == places_db
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) == "Сидоров " + "Павел"
def test_ndp_checking_donor_by_fic_fullname_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, PerC.LastName + ' ' + PerC.FirstName + ' ' + PerC.MiddleName OR1 from aistdb_fic.dbo.PersonCards PerC where len(PerC.LastName) > 0 and len(PerC.FirstName) > 0 and len(PerC.MiddleName) > 0 and len(PerC.IdentityDocSerie) > 0 and len(PerC.IdentityDocNumber) > 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.ndp_results_by_fic_is_on_the_page() main_page.ndp_results_by_fic_get_grid_values('ФИО', 0, mode='click') Driver.get().switch_to.window(Driver.get().window_handles[1]) assert main_page.query_to_fic_get_fullname() == expected
def test_ndp_validation_of_donation_type_fourth_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("Сидоров", "Алексей", '', "20.06.1980", "8929", "650250") 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('23', elements=main_page.reg_fias_address_house) main_page.ndp_filling_donation_type(sql_query(query)[0][0]) assert main_page.ndp_get_donation_type() == sql_query(query)[0][0] main_page.ndp_donation_type_clear() main_page.ndp_donation_type_focus_out() main_page.ndp_filling_donation_type("э", mode='first_li') current_donation_type = main_page.ndp_get_donation_type() main_page.ndp_save_new_donor('success') assert main_page.get_donation_type_value_from_minicard( ) == current_donation_type
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_ndp_job_position(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('Перовская ул') aistium.fill('4', elements=main_page.reg_fias_address_house) aistium.fill(job_position, elements=main_page.job_position) 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() == expected_result
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) == 'Сидоров Алексей'
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_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_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_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_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_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_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_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_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_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_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( ) == 'Статус: ' + 'Безработные, в т.ч. домохозяйки'