How to stop protractor from running further testcases on failure?(如何阻止量角器在失败时运行进一步的测试用例?)
问题描述
如果测试用例在量角器中失败,有没有办法退出测试套件并停止执行进一步的测试用例?
Is there a way of quitting test suite and stop executing further test cases, if a test case fails in protractor?
推荐答案
如果是 jasmine
测试框架,你不是第一个问它的.
In case of jasmine
testing framework, you are not the first asking about it.
第一次失败后退出有相关的公开讨论/问题,--fail-fast
选项:
There are relevant open discussions/issues on exiting after a first failure, --fail-fast
option:
- 第一次失败时保释
- --fail-fast 选项?
- 请添加--fail-fast支持
长话短说,这是一个未解决的问题,有一天 jasmine
会内置该功能.目前,使用第三方 jasmine-bail-fast
模块.
Long story short, this is an open issue and some day jasmine
would have the functionality built-in. Currently, use a third-party jasmine-bail-fast
module.
除此之外,还有一个方便的 realtimeFailure
jasmine 设置.如果您将其设置为 true
它不会使整个测试运行失败,但它会实时显示错误 - 在发生后立即显示 - 这可能会涵盖您的用例.在jasmineNodeOpts
中设置:
Aside from that, there is a handy realtimeFailure
jasmine setting. If you set it to true
it would not fail the whole test run, but it would show errors in a real time - immediately after happening - this can possibly cover your use case. Set it in jasmineNodeOpts
:
exports.config = {
seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
...
jasmineNodeOpts: {
realtimeFailure: true
}
}
这篇关于如何阻止量角器在失败时运行进一步的测试用例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何阻止量角器在失败时运行进一步的测试用例


- 使用 iframe URL 的 jQuery UI 对话框 2022-01-01
- 为什么悬停在委托事件处理程序中不起作用? 2022-01-01
- 在不使用循环的情况下查找数字数组中的一项 2022-01-01
- 如何调试 CSS/Javascript 悬停问题 2022-01-01
- 从原点悬停时触发 translateY() 2022-01-01
- 如何显示带有换行符的文本标签? 2022-01-01
- 是否可以将标志传递给 Gulp 以使其以不同的方式 2022-01-01
- 我不能使用 json 使用 react 向我的 web api 发出 Post 请求 2022-01-01
- 如何向 ipc 渲染器发送添加回调 2022-01-01
- 为什么我的页面无法在 Github 上加载? 2022-01-01