【问题标题】:Wdio.conf: How to use result object in oncomplete hookWdio.conf:如何在 oncomplete 挂钩中使用结果对象
【发布时间】:2019-08-28 16:14:37
【问题描述】:

如何在 onComplete 钩子中使用 Result 对象。实际上,我想获得通过/失败/跳过的计数,我可以在执行完成后将其保存在文本文件中。我正在将 webdriverIO 与黄瓜一起使用。 任何帮助或示例脚本都非常受欢迎!!!!

【问题讨论】:

    标签: cucumber hook resultset webdriver-io


    【解决方案1】:
    onComplete: function (exitCode, config, capabilities, results) {
    
        const resultString = `Finished tests: ${results.finished} \nPassed tests: ${results.passed} \nRetries: ${results.retries} \nFailed tests: ${results.failed}`;
        fs.writeFileSync('./result.txt',resultString);
    
    },
    

    【讨论】:

      猜你喜欢
      • 2023-02-04
      • 2021-02-13
      • 1970-01-01
      • 2022-11-04
      • 1970-01-01
      • 2017-06-28
      • 1970-01-01
      • 2013-01-29
      • 2020-10-13
      相关资源
      最近更新 更多