如果在NightwatchJS中断言失败,则停止组测试

时间:2014-09-17 12:04:44

标签: testing nightwatch.js

如果断言失败,有没有办法停止测试执行,那么其他测试组将不会被执行?

2 个答案:

答案 0 :(得分:4)

来自documentation

Nightwatch.js instance has two objects containing the same methods to perform
assertions on elements:

  .assert - when an assertion fails, the test ends, skipping all other assertions.
  .verify - when an assertion fails, the test logs the failure and continues with
            other assertions.

所以我想使用assert?除非你是,那不适合你?

答案 1 :(得分:1)

使用assert将停止当前测试,但要停止整个套件,您需要设置设置' skip_testcases_on_fail'在你的nightwatch.json配置文件中为true。

相关问题