junit - jasmine.JUnitXmlReporter 报告可视化工具

标签 junit jasmine protractor

我在运行 Protractor 测试后生成了此 xml。

<?xml version="1.0" encoding="UTF-8" ?>
<testsuites>
<testsuite name="Spring Webapp Homepage" errors="0" tests="3" failures="0" time="1.508" timestamp="2014-02-14T15:23:27">
  <testcase classname="Spring Webapp Homepage" name="should get title" time="1.309"></testcase>
  <testcase classname="Spring Webapp Homepage" name="Test Header" time="0.098"></testcase>
  <testcase classname="Spring Webapp Homepage" name="Test Simple Button" time="0.101"></testcase>
</testsuite>
</testsuites>

有一个选项可以将测试输出到 XML 输出

  onPrepare: function() {
// The require statement must be down here, since jasmine-reporters
// needs jasmine to be in the global and protractor does not guarantee
// this until inside the onPrepare function.
require('jasmine-reporters');
jasmine.getEnv().addReporter(
  new jasmine.JUnitXmlReporter('jasmine-results/xmloutput', true, true));
}

有没有一种方法可以在浏览器中可视化这些报告,从而比原始 XML 更优雅地呈现它们?

最佳答案

Is there a way to visualize these reports in the browser that would present them more elegantly than raw XML?

其实有nosetest-xunit-xslt .

注意xsltproc来自installed by default在 Mac OSX Mavericks 上。

看看how the results look like

更新:我正在使用 custom reporter that automates the html conversion

require('./jasmine.single_file_junit_reporter.js');
var junitPath = path.join('junitXMLReport/', '0001');
jasmine.getEnv().addReporter(new jasmine.singleFileJUnitXmlReporter(
    junitPath, true, true, './nosetests.xslt')
);

关于junit - jasmine.JUnitXmlReporter 报告可视化工具,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21790204/

相关文章:

angularjs - 尝试在 angular js 教程的第 3 步中运行 Protractor

java - 类似@TestedOn 的理论但可用于字符串?或者单独的参数化类?

java - 针对任意加载的类运行 JUnit 测试

angularjs - karma Jasmine : Executed 0 of 0 Error

css - Protractor 图像没有在对话框中上传?

angularjs - 我应该使用 id 来定位元素吗?

angularjs - 将 Protractor 测试移至 async/await(留下 selenium 控制流)

java.lang.NoClassDefFoundError : org/hamcrest/SelfDescribing

java - 从 JUnit 测试自连接到 Websocket Spring 服务器

javascript - 只有第一个测试实际在 Jasmine 中运行