Beispiel #1
0
def open_group_card(context, name):
    # otevri skupiny z menu
    helpers.open_groups(context.browser)
    # pockej na nacteni
    helpers.wait_loading_ends(context.browser)
    # najdi skupinu s danym nazvem a otevri jeji kartu
    found_group = helpers.find_group(context, name, True)
    return found_group
Beispiel #2
0
def step_impl(context, name, course, active, member_full_name1,
              member_full_name2):
    # nacti data skupiny do kontextu
    load_data_to_context(context, name, course, active, member_full_name1,
                         member_full_name2)
    # 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)
    # klikni na Pridat skupinu
    button_add_group = context.browser.find_element_by_css_selector(
        "[data-qa=button_add_group]")
    button_add_group.click()
    # vloz vsechny udaje do formulare
    insert_to_form(context)
    # odesli formular
    helpers.submit_form(context, "button_submit_group")
Beispiel #3
0
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)
Beispiel #4
0
def step_impl(
    context,
    cur_name,
    new_name,
    new_course,
    new_active,
    new_member_full_name1,
    new_member_full_name2,
    new_member_full_name3,
):
    # nacti data skupiny do kontextu
    load_data_to_context(
        context,
        new_name,
        new_course,
        new_active,
        new_member_full_name1,
        new_member_full_name2,
        new_member_full_name3,
    )
    # 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, cur_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()
    # over spravne zobrazene udaje ve formulari a vloz do nej vsechny udaje
    insert_to_form(context, True)
    # odesli formular
    helpers.submit_form(context, "button_submit_group")