def then_the_line_1_has_the_following_line_options(step, line_number): line_id = line_helper.find_line_id_with_exten_context( line_number, 'default') common.open_url('line', 'edit', {'id': line_id}) for line_data in step.hashes: for key, value in line_data.iteritems(): if key == 'Call limit': common.go_to_tab('IPBX Infos') assert line_action_webi.get_value_from_ipbx_infos_tab( 'call_limit') == value elif key == 'NAT': common.go_to_tab('General') nat_select = world.browser.find_element_by_label('NAT') nat_value = Select(nat_select).first_selected_option.text assert nat_value == value elif key == 'IP addressing type': common.go_to_tab('Advanced') ip_addressing_type_select = world.browser.find_element_by_label( 'IP Addressing type') ip_addressing_type_value = Select( ip_addressing_type_select).first_selected_option.text assert ip_addressing_type_value == value elif key == 'IP address': common.go_to_tab('Advanced') ip_address_input = world.browser.find_element_by_label( 'IP address') ip_address_value = ip_address_input.get_attribute('value') assert ip_address_value == value elif key == 'Caller ID': common.go_to_tab('IPBX Infos') assert line_action_webi.get_value_from_ipbx_infos_tab( 'callerid') == value else: raise Exception('%s is not a valid key' % key)
def when_i_remove_the_codec_from_the_line_with_number(step, codec, linenumber): line_id = line_helper.find_line_id_with_exten_context( linenumber, 'default') common.open_url('line', 'edit', {'id': line_id}) _open_codec_page() codec_widget = CodecWidget() codec_widget.remove(codec) form.submit.submit_form()
def given_i_set_the_following_options_in_line_1(step, line_number): line_id = line_helper.find_line_id_with_exten_context( line_number, 'default') common.open_url('line', 'edit', {'id': line_id}) for line_data in step.hashes: for key, value in line_data.iteritems(): if key == 'NAT': common.go_to_tab('General') form.select.set_select_field_with_label('NAT', value) elif key == 'IP addressing type': common.go_to_tab('Advanced') form.select.set_select_field_with_label( 'IP Addressing type', value) elif key == 'IP address': common.go_to_tab('Advanced') form.select.set_select_field_with_label( 'IP Addressing type', 'Static') form.input.set_text_field_with_label('IP address', value) else: raise Exception('%s is not a valid key' % key) form.submit.submit_form()
def _add_codec_list_to_line(codecs, exten): line_id = line_helper.find_line_id_with_exten_context(exten, 'default') common.open_url('line', 'edit', {'id': line_id}) for codec in codecs: _add_custom_codec(codec) form.submit.submit_form()
def when_i_edit_the_line_1(step, linenumber): line_id = line_helper.find_line_id_with_exten_context( linenumber, 'default') common.open_url('line', 'edit', {'id': line_id})
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()