예제 #1
0
def remove_whitelisted_ips(context):
    whitelisted_ips_tag = context.browser.find_element_by_tag_name(
        'multi-inputs')
    whitelisted_ips = whitelisted_ips_tag.find_elements_by_class_name('input')
    for whitelisted_ip in whitelisted_ips:
        remove_btn = whitelisted_ip.find_element_by_class_name('remove')
        clicketi_click(context, remove_btn)
예제 #2
0
def select_option_from_radiogroup(context, option_to_select, resource_type):
    form = get_add_form(context, 'schedule')
    form_shadow = expand_shadow_root(context, form)
    button = get_button_from_form(context, form_shadow, option_to_select, tag_name='paper-radio-button')
    if button:
        clicketi_click(context, button)
        return
    assert False, 'Could not find "%s" radio button in "%s" add form' % (option_to_select, resource_type)
예제 #3
0
def select_checkbox(context, option_to_select, resource_type):
    if context.mist_config.get(option_to_select):
        option_to_select = context.mist_config.get(option_to_select)
    form = get_add_form(context, 'schedule')
    form_shadow = expand_shadow_root(context, form)
    button = get_button_from_form(context, form_shadow, option_to_select, tag_name='paper-checkbox')
    if button:
        clicketi_click(context, button)
        return
    assert False, 'Could not find "%s" checkbox in "%s" add form' % (option_to_select, resource_type)
예제 #4
0
def select_option_from_radiogroup(context, option_to_select, resource_type):
    form = get_add_form(context, 'schedule')
    form_shadow = expand_shadow_root(context, form)
    button = get_button_from_form(context,
                                  form_shadow,
                                  option_to_select,
                                  tag_name='paper-radio-button')
    if button:
        clicketi_click(context, button)
        return
    assert False, 'Could not find "%s" radio button in "%s" add form' % (
        option_to_select, resource_type)
예제 #5
0
def select_checkbox(context, option_to_select, resource_type):
    if context.mist_config.get(option_to_select):
        option_to_select = context.mist_config.get(option_to_select)
    form = get_add_form(context, 'schedule')
    form_shadow = expand_shadow_root(context, form)
    button = get_button_from_form(context,
                                  form_shadow,
                                  option_to_select,
                                  tag_name='paper-checkbox')
    if button:
        clicketi_click(context, button)
        return
    assert False, 'Could not find "%s" checkbox in "%s" add form' % (
        option_to_select, resource_type)
예제 #6
0
def remove_whitelisted_ips(context):
    whitelisted_ips_tag = context.browser.find_element_by_tag_name('multi-inputs')
    whitelisted_ips = whitelisted_ips_tag.find_elements_by_class_name('input')
    for whitelisted_ip in whitelisted_ips:
        remove_btn = whitelisted_ip.find_element_by_class_name('remove')
        clicketi_click(context, remove_btn)
예제 #7
0
def click_forbidden_link(context):
    forbidden_error = get_forbidden_error_element(context)
    forbidden_link = forbidden_error.find_element_by_id('forbiddenlink')
    clicketi_click(context,forbidden_link)
예제 #8
0
def upgrate_to_small_plan(context):
    plans = context.browser.find_elements_by_tag_name('plan-item')
    small_plan = plans[1].find_element_by_tag_name('paper-button')
    clicketi_click(context, small_plan)