Wdio.conf:如何在oncomplete挂钩中使用结果对象

问题描述 投票:1回答:1

如何在onComplete挂钩中使用Result对象。实际上,我想获取通过/失败/跳过的计数,可以在执行完成后保存在文本文件中。我正在将webdriverIO与黄瓜一起使用。高度重视任何帮助或示例脚本!!!

cucumber hook resultset webdriver-io
1个回答
0
投票
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);

},
© www.soinside.com 2019 - 2024. All rights reserved.