【发布时间】:2018-01-15 13:36:06
【问题描述】:
@then('I should be able to able to print with id "{el_id}"')
def step_impl(context, el_id):
if is_element_id_there(context, 'el_id'):
print(get_element_text_id(context, 'el_id'))
else:
raise Exception('Element with id: ' + el_id + ' not found')
我还通过定义变量使用了其他打印方式
@then('I should be able to able to print with id "{el_id}"')
def step_impl(context, el_id):
if is_element_id_there(context, 'el_id'):
var = get_element_text_id(context, 'el_id')
print(var)
else:
raise Exception('Element with id: ' + el_id + ' not found')
注意:我已经在我的 bash 个人资料中添加了 --no-colors 和 --no-capture
【问题讨论】:
-
你添加了behaviour.ini文件吗? stackoverflow.com/a/25291321/3838981
标签: python python-behave