def step_impl(context): # zjisti, zda se objevi alert (skupina se nepridala) try: helpers.wait_for_alert_and_accept(context.browser) except TimeoutException: # alert se neobjevil, zmizel formular? try: WebDriverWait(context.browser, helpers.WAIT_TIME_SHORT).until_not( EC.presence_of_element_located( (By.CSS_SELECTOR, "[data-qa=form_group]"))) except TimeoutException: # formular nezmizel form_group_visible = True else: # formular zmizel form_group_visible = False else: # alert se objevil, takze formular je stale videt form_group_visible = True # pokud nedoslo k problemu pri zadavani clenu do react-selectu, vse prover # pokud k problemu doslo, lekce se pridala, ale to neni chyba - prida se bez neexistujicich clenu if context.react_select_success: assert form_group_visible # zavri formular helpers.close_modal(context.browser) # pockej az bude mozne prepinat mezi ne/aktivnimi klienty wait_switching_available(context.browser) assert groups_cnt(context.browser) == context.old_groups_cnt # over, ze je modalni okno kompletne zavrene assert not helpers.is_modal_class_attr_present(context.browser)
def step_impl(context, full_name): # nacti jmeno klienta do kontextu context.full_name = full_name # klikni v menu na klienty open_clients(context.browser) # pockej na nacteni helpers.wait_loading_ends(context.browser) # uloz puvodni pocet klientu save_old_clients_cnt_to_context(context) # najdi klienta a klikni u nej na Upravit client_to_delete = helpers.find_client(context, full_name) assert client_to_delete button_edit_client = client_to_delete.find_element_by_css_selector( "[data-qa=button_edit_client]" ) button_edit_client.click() # pockej az bude viditelny formular wait_form_visible(context.browser) # klikni na smazat button_delete_client = context.browser.find_element_by_css_selector( "[data-qa=button_delete_client]" ) button_delete_client.click() # a potvrd smazani helpers.wait_for_alert_and_accept(context.browser)
def step_impl(context, client, date, time): # nacti timestamp lekce do kontextu load_id_data_to_context(context, date, time) # otevri kartu prislusneho klienta open_client_card(context, client) # pockej na nacteni helpers.wait_loading_ends(context.browser) # najdi lekci a klikni u ni na Upravit lecture_to_update = find_lecture(context, date, time) assert lecture_to_update button_edit_lecture = lecture_to_update.find_element_by_css_selector( "[data-qa=button_edit_lecture]") button_edit_lecture.click() # pockej na nacteni helpers.wait_loading_ends(context.browser) # uloz puvodni pocet lekci save_old_lectures_cnt_to_context(context) # pockej az bude viditelny formular wait_form_visible(context.browser) # klikni na smazat button_delete_lecture = context.browser.find_element_by_css_selector( "[data-qa=button_delete_lecture]") button_delete_lecture.click() # a potvrd smazani helpers.wait_for_alert_and_accept(context.browser)
def step_impl(context, full_name, course): assert showed_applications_cnts_for_courses_matches(context.browser) # nacti jmeno zadosti do kontextu load_id_data_to_context(context, full_name, course) # klikni v menu na zadosti open_applications(context.browser) # pockej na nacteni helpers.wait_loading_ends(context.browser) # najdi zadost application_to_update = find_application(context, context.client, context.course) assert application_to_update # uloz puvodni pocet zadosti save_old_applications_cnt_to_context(context) # klikni na smazat button_delete_application = context.browser.find_element_by_css_selector( "[data-qa=button_delete_application]") button_delete_application.click() # a potvrd smazani helpers.wait_for_alert_and_accept(context.browser)
def step_impl(context): # zjisti, zda se objevi alert (zadost se nepridala) try: helpers.wait_for_alert_and_accept(context.browser) except TimeoutException: # alert se neobjevil, zmizel formular? try: WebDriverWait(context.browser, helpers.WAIT_TIME_SHORT).until_not( EC.presence_of_element_located( (By.CSS_SELECTOR, "[data-qa=form_application]"))) except TimeoutException: # formular nezmizel form_application_visible = True else: # formular zmizel form_application_visible = False else: # alert se objevil, takze formular je stale videt form_application_visible = True assert form_application_visible assert applications_cnt(context.browser) == context.old_applications_cnt assert showed_applications_cnts_for_courses_matches(context.browser)
def step_impl(context, name): # nacti jmeno skupiny do kontextu load_id_data_to_context(context, name) # klikni v menu na skupiny helpers.open_groups(context.browser) # pockej na nacteni helpers.wait_loading_ends(context.browser) # uloz puvodni pocet skupin save_old_groups_cnt_to_context(context) # najdi skupinu a klikni u ni na Upravit group_to_update = helpers.find_group(context, context.name) assert group_to_update button_edit_group = group_to_update.find_element_by_css_selector( "[data-qa=button_edit_group]") button_edit_group.click() # pockej az bude viditelny formular wait_form_visible(context.browser) # klikni na smazat button_delete_group = context.browser.find_element_by_css_selector( "[data-qa=button_delete_group]") button_delete_group.click() # a potvrd smazani helpers.wait_for_alert_and_accept(context.browser)
def step_impl(context, name): # nacti jmeno kurzu do kontextu load_id_data_to_context(context, name) # klikni v menu na nastaveni helpers.open_settings(context.browser) # pockej na nacteni helpers.wait_loading_ends(context.browser) # najdi kurz a klikni u nej na Upravit course_to_update = find_course(context, context.name) assert course_to_update button_edit_course = course_to_update.find_element_by_css_selector( "[data-qa=button_edit_course]") button_edit_course.click() # uloz puvodni pocet kurzu save_old_courses_cnt_to_context(context) # pockej az bude viditelny formular helpers.wait_form_settings_visible(context.browser) # klikni na smazat button_delete_course = context.browser.find_element_by_css_selector( "[data-qa=settings_button_delete]") button_delete_course.click() # a potvrd smazani helpers.wait_for_alert_and_accept(context.browser)