Пример #1
0
def create_or_replace_certificate(info):
    common.remove_all_elements('certificat', info['name'])

    common.open_url('certificat', 'add')

    input_name = world.browser.find_element_by_id('it-name')
    input_name.send_keys(info['name'])

    if 'autosigned' in info:
        checked = info['autosigned'] == "yes"
        Checkbox.from_id('it-autosigned').set_checked(checked)

    if 'certificate authority' in info:
        checked = info['certificate authority'] == "yes"
        Checkbox.from_id('it-is_ca').set_checked(checked)

    input_date = world.browser.find_element_by_id('it-validity-end')
    input_date.clear()

    date = datetime.datetime.now()
    if info['valid date in the future'] == "yes":
        date += datetime.timedelta(days=31)
    else:
        date -= datetime.timedelta(days=1)

    input_date.send_keys(date.strftime("%m/%d/%Y"))

    input_email = world.browser.find_element_by_id('it-subject-emailAddress')
    input_email.clear()
    input_email.send_keys(info['email'])
Пример #2
0
def create_or_replace_certificate(info):
    common.remove_all_elements('certificat', info['name'])

    common.open_url('certificat', 'add')

    input_name = world.browser.find_element_by_id('it-name')
    input_name.send_keys(info['name'])

    if 'autosigned' in info:
        checked = info['autosigned'] == "yes"
        Checkbox.from_id('it-autosigned').set_checked(checked)

    if 'certificate authority' in info:
        checked = info['certificate authority'] == "yes"
        Checkbox.from_id('it-is_ca').set_checked(checked)

    input_date = world.browser.find_element_by_id('it-validity-end')
    input_date.clear()

    date = datetime.datetime.now()
    if info['valid date in the future'] == "yes":
        date += datetime.timedelta(days=31)
    else:
        date -= datetime.timedelta(days=1)

    input_date.send_keys(date.strftime("%m/%d/%Y"))

    input_email = world.browser.find_element_by_id('it-subject-emailAddress')
    input_email.clear()
    input_email.send_keys(info['email'])
Пример #3
0
def update_sip_configuration(info):
    common.open_url('general_sip')
    common.go_to_tab('Security')

    checked = info['allow tls connections'] == "yes"
    Checkbox.from_label("Allow TLS connections").set_checked(checked)

    form.input.set_text_field_with_label("Listening address", info['listening address'])
    form.select.set_select_field_with_label("Server certificate", info['server certificate'])
    form.select.set_select_field_with_label("CA certificate", info['ca certificate'])
    form.submit.submit_form()
Пример #4
0
def update_sip_configuration(info):
    common.open_url('general_sip')
    common.go_to_tab('Security')

    checked = info['allow tls connections'] == "yes"
    Checkbox.from_label("Allow TLS connections").set_checked(checked)

    form.input.set_text_field_with_label("Listening address",
                                         info['listening address'])
    form.select.set_select_field_with_label("Server certificate",
                                            info['server certificate'])
    form.select.set_select_field_with_label("CA certificate",
                                            info['ca certificate'])
    form.submit.submit_form()
Пример #5
0
def _toggle_live_reload(state):
    common.open_url('general_settings')
    option = Checkbox.from_label('Live reload configuration')
    if state == 'enable':
        option.check()
    else:
        option.uncheck()
    form.submit.submit_form()
def _toggle_live_reload(state):
    common.open_url("general_settings")
    option = Checkbox.from_label("Live reload configuration")
    if state == "enable":
        option.check()
    else:
        option.uncheck()
    form.submit.submit_form()
Пример #7
0
class CodecWidget(object):
    '''Wraps the "codecs" customization widget'''

    DEFAULT_FIELDSET_ID = 'fld-codeclist'

    def __init__(self, fieldset_id=DEFAULT_FIELDSET_ID):
        base = world.browser.find_element_by_id(fieldset_id)
        self._checkbox = Checkbox(base.find_element_by_id('it-codec-active'))
        self._pane = ListPane(base.find_element_by_id('codeclist'))

    def customize(self, codecs):
        self._checkbox.check()
        self._pane.remove_all()
        for codec in codecs:
            self._pane.add(codec)

    def uncustomize(self):
        self._pane.remove_all()
        self._checkbox.uncheck()

    def add(self, codec):
        self._checkbox.check()
        self._pane.add(codec)

    def remove(self, codec):
        self._pane.remove(codec)
Пример #8
0
def given_there_is_group1_activated_in_extensions_page(step, option_label):
    common.open_url("extenfeatures")
    option = Checkbox.from_label(option_label)
    option.check()
    form.submit.submit_form()
Пример #9
0
def check_switchboard():
    switchboard_element = world.browser.find_element_by_id(
        'it-device-switchboard-id')
    checkbox = Checkbox(switchboard_element)
    checkbox.check()
def _get_srv_lookup_option():
    common.open_url('general_iax')
    common.go_to_tab('Default')
    option = Checkbox.from_label('SRV lookup')

    return option
def _get_shrink_caller_id_option():
    common.open_url('general_iax')
    common.go_to_tab('Advanced')
    option = Checkbox.from_label('Shrink CallerID')

    return option
Пример #12
0
def type_reload_dialplan(reload_dialplan):
    input_reload_dialplan = Checkbox(
        world.browser.find_element_by_id('it-configfile-reload-dialplan'))
    input_reload_dialplan.set_checked(reload_dialplan)
Пример #13
0
def _set_exten(exten_name, enabled):
    common.open_url(_exten_url_map[exten_name])
    Checkbox.from_label(exten_name).set_checked(enabled)
    form.submit.submit_form()
Пример #14
0
 def __init__(self, fieldset_id=DEFAULT_FIELDSET_ID):
     base = world.browser.find_element_by_id(fieldset_id)
     self._checkbox = Checkbox(base.find_element_by_id('it-codec-active'))
     self._pane = ListPane(base.find_element_by_id('codeclist'))
def _get_shrink_caller_id_option():
    common.open_url('general_iax')
    common.go_to_tab('Advanced')
    option = Checkbox.from_label('Shrink CallerID')

    return option
Пример #16
0
def check_switchboard():
    switchboard_element = world.browser.find_element_by_id('it-device-switchboard-id')
    checkbox = Checkbox(switchboard_element)
    checkbox.check()
Пример #17
0
def when_i_disable_the_sccp_directmedia(step):
    common.open_url('sccpgeneralsettings')
    directmedia_checkbox = Checkbox.from_id(
        "it-sccpgeneralsettings-directmedia")
    directmedia_checkbox.uncheck()
    submit.submit_form()
def _get_sip_option_from_label(label):
    option = Checkbox.from_label(label)
    return option
Пример #19
0
def type_reload_dialplan(reload_dialplan):
    input_reload_dialplan = Checkbox(world.browser.find_element_by_id('it-configfile-reload-dialplan'))
    input_reload_dialplan.set_checked(reload_dialplan)
def when_i_disable_the_sccp_directmedia(step):
    common.open_url('sccpgeneralsettings')
    directmedia_checkbox = Checkbox.from_id("it-sccpgeneralsettings-directmedia")
    directmedia_checkbox.uncheck()
    submit.submit_form()
Пример #21
0
def when_i_desactivate_dhcpd_server(step):
    common.open_url('dhcp')
    Checkbox.from_id('it-active').uncheck()
    form.submit.submit_form()
    commonconf_action_webi.webi_exec_commonconf()
Пример #22
0
def when_i_disable_custom_codecs_for_this_line(step):
    line_action_webi.search_line_number(world.id)
    common.edit_line(world.id)
    _open_codec_page()
    Checkbox.from_label("Customize codecs:").uncheck()
    form.submit.submit_form()
Пример #23
0
def when_i_activate_dhcpd_server(step):
    common.open_url('dhcp')
    Checkbox.from_id('it-active').check()
    dhcpd_action_webi.type_pool_start_end('192.168.32.20', '192.168.32.21')
    form.submit.submit_form()
    commonconf_action_webi.webi_exec_commonconf()
def _get_srv_lookup_option():
    common.open_url('general_iax')
    common.go_to_tab('Default')
    option = Checkbox.from_label('SRV lookup')

    return option
Пример #25
0
def given_there_is_group1_activated_in_extensions_page(step, option_label):
    common.open_url('extenfeatures')
    option = Checkbox.from_label(option_label)
    option.check()
    form.submit.submit_form()
Пример #26
0
def when_i_disable_line_codecs_customization_for_line(step, number):
    line_id = line_helper.find_line_id_with_exten_context(number, 'default')
    common.open_url('line', 'edit', {'id': line_id})
    _open_codec_page()
    Checkbox.from_label("Customize codecs:").uncheck()
    form.submit.submit_form()