thenLast () 隐藏了 webdriverjs 中的断言错误

thenFinally() hides the assertion error in webdriverjs

本文关键字:断言 错误 webdriverjs 隐藏 thenLast      更新时间:2023-09-26

>我有测试用例

  1. 浏览到网址
  2. 签到
  3. 断言某事
  4. 注销

如果断言失败,测试不会执行注销。

所以我决定使用 thenFinally() ,但它的问题是它隐藏了断言错误。我看到我的测试通过而不是失败。

有人可以帮助我做错什么或任何解决方法吗?

听起来你想使用then()而不是thenFinally(),并传递一个注销的回调函数和另一个断言错误的回调函数。

async().then( 
  function(success) {
    signout();
  }, 
  function(error) {
    console.log(error);
  });