如何在waitUntil函数中使测试用例失败

时间:2018-08-17 08:14:47

标签: javascript webdriver automated-tests webdriver-io

我正在编写测试,但我不知道如何在特定的地方无法通过测试。我的代码说明:

Some promises
.waitUntil(() => isSynchronizationBusy(client).then(function(isBusy) {
  if(isBusy.value.busy === false) {
    if (isBusy.value.lastError !== null) {
      //** in this place I want to failed a whole test case, 
      //   but it have to failed a promise like when the timeout 
      //   of waitUntil function occurrs **
    }
    return true;
  }
}), 2 * 60 * 1000,'timeout occured while waiting for synchronization end')

0 个答案:

没有答案