def test_ndp_validation_of_social_status_and_job_info_d(self): main_page = DonorsModuleRegistryPage() main_page.clear_localstorage() change_general_settings(WorkWithSocialStatus='true') query = sql_query( "select SocSt.Name from ref.SocialStatuses SocSt where SocSt.IsActive = 1 and SocSt.Name like '%ц%'" ) social_statuses_db = [] for s in query: social_statuses_db.append(s[0]) main_page.open() main_page.newdonor_click() main_page.ndp_filling_first_page("Сидоров", "Афанасий", '', "04.06.1980", "8913", "650234") main_page.select_gender('male') aistium.click_on(elements=main_page.next_step_ndp) main_page.loading_is_completed() main_page.if_donor_is_in_local_cabinet() main_page.ndp_filling_region("Москва г") main_page.ndp_filling_street("Перовская ул") aistium.fill('7', elements=main_page.reg_fias_address_house) aistium.click_on(elements=main_page.social_status_select_row) main_page.ndp_choose_social_status_from_list("Рабочие") main_page.ndp_social_status_clear() main_page.ndp_typing_social_status('ц') assert main_page.ndp_social_statuses_list_on_form( ) == social_statuses_db main_page.ndp_choose_social_status_from_list( "Младший медицинский персонал") main_page.ndp_social_status_focusout() assert main_page.ndp_get_job_information( )[2] == 'Младший медицинский персонал' main_page.ndp_save_new_donor('success') assert aistium.get_text( elements=main_page.fio_minicard) == "Сидоров " + "Афанасий"
def test_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
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_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_grid_blood_group_b(self, query, expected_color, test_data_set_number): main_page = DonorsModuleRegistryPage() change_general_settings(UseBloodGroupEuropeanFormat='false') full_query = sql_query(query) donorid = str(full_query[0][0]) blood_group = str(full_query[0][1]) main_page.clear_localstorage() main_page.open() aistium.fill(donorid, elements=main_page.quick_search_field) main_page.quick_search('click') main_page.loading_is_completed() ind = sql_query( "select Main.Nmb from (select row_number() over (order by PerC.BirthDate desc) Nmb, PerC.UniqueId from PersonCards PerC left join IdentityDocs IDoc on PerC.IdentityDocId = IDoc.UniqueId where PerC.IsDeleted != 1 and (PerC.UniqueId = '" + donorid + "' or IDoc.Number = '" + donorid + "')) Main where Main.UniqueId = '" + donorid + "'")[0][0] assert main_page.get_grid_values('BloodGroup', ind, main_page.main_grid) == blood_group assert convert_to_hex( main_page.get_grid_values( 'BloodGroup', ind, main_page.main_grid, mode='background-color')) == expected_color
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( ) == 'Статус: ' + 'Безработные, в т.ч. домохозяйки'