gpt4 book ai didi

selenium - nightwatchjs 截图 on_error 与 on_failure

转载 作者:行者123 更新时间:2023-12-02 21:37:25 24 4
gpt4 key购买 nike

有人可以解释一下 nightwatchjs 中屏幕截图生成的 on_error 和 on_failure 之间的区别吗?我不清楚下面的解释有什么区别。

来自http://nightwatchjs.org/guide :

screenshots object none Selenium generates screenshots when command errors occur. With on_failure set to true, also generates screenshots for failing or erroring tests. These are saved on the disk.

Since v0.7.5 you can disable screenshots for command errors by setting "on_error" to false.

Example:

"screenshots" : { "enabled" : true, "on_failure" : true, "on_error" : false, "path" : "" }

最佳答案

我研究了 Nightwatch 1.0.19 版本的代码。

on_failure 是在测试结束时,如果测试断言失败。

on_error 是指执行命令时发生错误。

关于selenium - nightwatchjs 截图 on_error 与 on_failure,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39540208/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com