我找到了一个很好的清洁方式,使用Jasmine记者以有序的方式保存测试结果.
如何安装和配置Jasmine记者:
安装Jasmine记者:
npm install -g jasmine-reporters
Run Code Online (Sandbox Code Playgroud)
将以下内容添加到protractor-config.js文件中:
onPrepare: function() {
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmineReporters.JUnitXmlReporter('outputxmldir', true, true));
}
Run Code Online (Sandbox Code Playgroud)
创建outputxmldir文件夹(这是放置所有测试输出的位置).
运行量角器,现在结果将导出到outputxmldir文件夹中的XML文件.
您还可以在配置文件中设置resultJsonOutputFile选项:
export.config = {
(...)
// If set, protractor will save the test output in json format at this path.
// The path is relative to the location of this config.
resultJsonOutputFile:'./result.json',
(...)
}
Run Code Online (Sandbox Code Playgroud)
有关配置文件的更多详细信息,请访问:
https://raw.githubusercontent.com/angular/protractor/master/docs/referenceConf.js
| 归档时间: |
|
| 查看次数: |
10724 次 |
| 最近记录: |