如何保存量角器测试结果 [英] How can I save protractor test results

查看:26
本文介绍了如何保存量角器测试结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在测试运行后将量角器测试结果输出到一个文件中,以便在命令行之外查看,包括查看详细的失败?

Is there a way to output protractor test results to a file to be viewed outside of the command line after a test is run, including seeing detailed failures?

推荐答案

我找到了一种使用 Jasmine 报告器以有序方式保存测试结果的好方法.

I found a nice clean way of saving the test results in a orderly fashion using Jasmine reporter.

如何安装和配置 Jasmine 报告器:

How to install and configure Jasmine reporter:

安装 Jasmine 报告器:

Install Jasmine reporter:

npm install -g jasmine-reporters

将以下内容添加到 protractor-config.js 文件中:

Add the following to the protractor-config.js file:

  onPrepare: function() {
    require('jasmine-reporters');
    jasmine.getEnv().addReporter(
      new jasmineReporters.JUnitXmlReporter('outputxmldir', true, true));
  }

创建 outputxmldir 文件夹(这是放置所有测试输出的地方).

Create the outputxmldir folder (This is where all the test outputs will be placed).

运行量角器,现在结果将导出到 outputxmldir 文件夹中的 XML 文件中.

Run protractor and now the results will be exported to an XML file in the outputxmldir folder.

这篇关于如何保存量角器测试结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆