Tha*_*r D 3 selenium reporting cucumberjs allure webdriver-io
我正在使用WebdriverIO/Cucumber(wdio-cucumber-framework)进行测试自动化.我想在HTML文件中获得测试执行结果.截至目前,我正在使用Spec Reporter(wdio-spec-reporter).这有助于在控制台窗口中打印结果.但我希望所有的执行报告都在HTML文件中.
如何在HTML文件中获取WebdriverIO测试执行结果?
谢谢.
iam*_*hiv 11
OK,终于得到了一些空闲时间来解决你的问题@Thangakumar d.WebdriverIO报告是一个广泛的主题(有多种方法可以生成这样的报告),所以我将继续我最喜欢的记者:Allure!
npm install wdio-allure-reporter --save-devnpm install -g allure-commandline --save-devwdio.config.js文件以支持Allure作为记者wdio.config.js:
reporters: ['allure', 'dot', 'spec', 'json'],
reporterOptions: {
outputDir: './wdio-logs/',
allure: {
outputDir: './allure-reports/allure/'
}
}
Run Code Online (Sandbox Code Playgroud)
/allure-results/文件夹已被填充了多个.json,.txt,.png(如果你有截图错误),和.xml文件.Allure CommandLine将使用此文件夹的强大功能来呈现HTML报告./allure-results/文件夹并通过以下方式生成报告:( allure generate <reportsFolderPath>就像这样做allure generate . /allure-reports/文件夹里面/allure-results/)/allure-reports文件夹并打开index.html你选择的浏览器(使用Firefox作为初学者)注意:index.html除非您进行一些调整,否则生成的文件不会在Chrome上加载所有内容.这是由于默认的WebKit无法加载所需的所有AJAX调用.在这里阅读更多相关信息.
如果您已成功完成前面的所有步骤,它应如下所示:
希望这有帮助.干杯!
注意:当我从WebdriverIO记者日志中获取更多时间用其他很棒的方法生成报告时,我会尝试更新这篇文章,特别是如果这篇文章在此过程中获得了一些爱/赞成.
例如:我喜欢使用的另一个组合:wdio-json-reporter/ wdio-junit-reporter加上一个易于使用的模板语言,Jinja2.
| 归档时间: |
|
| 查看次数: |
4243 次 |
| 最近记录: |