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

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

问题描述

是否可以将量角器测试结果输出到文件,以便在运行测试后在命令行之外查看该文件,包括查看详细的故障?

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:

安装茉莉花记者:

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天全站免登陆