Selenium Behave Python,如果失败,如何将场景设置为跳过或未测试
使用 Selenium Behave Python,
如果某个步骤失败,是否可以强制将场景状态重置为已跳过或未经测试?
我知道我可以使用 @Skip 标签跳过一个场景,但我需要运行该场景并检查,如果一个步骤失败,我希望在报告中显示此场景已被跳过或未经测试或其他内容,但不是失败或通过。
example:
Feature test
Scenario: test something
Given the situation A
When the user presses the button
Then the page show something
And something else should happen
@then('the page show something')
def step_page_show_something(context):
try:
do something
#here the step can fail
except:
# if I use 'pass' the test will be Pass
# if I use an exception if will Failed
# there is any way to skip or set it as Untested or something else but not Failed and not Passed
感谢您的所有提示。
with Selenium Behave Python,
Is possible to force and reset the status of a scenario as skipped or untested if a step on it fails?
I know I can skip a scenario with @Skip tag, but I need to run the scenario and check, if one step fails I would like to have in the report that this scenario is skipped or Untested or something else but not as Failed or Passed.
example:
Feature test
Scenario: test something
Given the situation A
When the user presses the button
Then the page show something
And something else should happen
@then('the page show something')
def step_page_show_something(context):
try:
do something
#here the step can fail
except:
# if I use 'pass' the test will be Pass
# if I use an exception if will Failed
# there is any way to skip or set it as Untested or something else but not Failed and not Passed
Thanks for all the tips.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到的唯一解决方案正是在帖子 Skip a Bee step in步骤实施
在我的
The only solution that I found was exactly in the post Skip a behave step in the step implementation
On my