【问题标题】:Frisby Jasmine html ReportFrisby Jasmine html 报告
【发布时间】:2015-12-03 00:27:06
【问题描述】:

谁能告诉我如何为我通过 Jasmine 运行的测试用例生成报告。我使用 Frisby 和 Jasmine 作为框架,测试用例是用咖啡脚本编写的。我已经浏览了由 Frisby 框架生成的 JUnit 报告,但这对我来说并不奏效。因此,如果有人对如何创建报告有任何了解,将不胜感激。

【问题讨论】:

  • @slavo 回答了这个问题吗?如果是,请接受他的回答。

标签: coffeescript jasmine report


【解决方案1】:

要生成 JUnit 格式的测试报告,请在 jasmine-node 命令中使用 --junitreport 参数。

例如,

运行命令jasmine-node spec/ --junitreport会在/reports下生成一个xml文件。

可以使用--output 参数更改生成报告的文件夹。例如,

jasmine-node spec/ --junitreport --output reportfolder/new-test-report.xml

将在reportfolder目录中生成一个名为new-test-report的测试报告。

--autotest 参数在每次更改后自动执行规范。 结合--watch参数可以使jasmine-node只有在指定文件夹下的文件发生变化时才重新运行测试。

source

【讨论】:

  • 带有 .xml 的错误文件夹名称
【解决方案2】:

安装使用:

npm install junit-viewer -g

使用以下命令执行测试用例:

jasmine-node <filename_spec.js> --junitreport

要生成 html 格式的报告,请执行以下命令:
junit-viewer --results=file_or_folder_location --save=file_location.html

或者,要开始托管报告,请执行:
junit-viewer --results=file_or_folder_location --port=port_number

【讨论】:

  • 这与上一个答案有何不同?
  • @alexanderbird 生成的报告是基于 xml 的。要查看报告 junit-viewer 将按上述方式使用。
  • 我认为这不是 OP 所要求的内容
猜你喜欢
  • 1970-01-01
  • 2019-01-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-02-17
  • 2015-06-21
  • 2012-11-13
  • 1970-01-01
相关资源
最近更新 更多