Scala 显示缩放测试结果的其他方法

Scala 显示缩放测试结果的其他方法,scala,scalatest,Scala,Scalatest,我正在考虑使用Scalatest设置一个自动验收测试套件,并将结果输出到一个简单的web仪表板中(比如打印每个场景文本,并在其旁边打上复选标记或十字)。是否有一个内置功能可用于显示普通输出的替代方法,或者我需要自己输出和解析日志?考虑创建一个自定义: 其实例收集正在运行的测试套件的结果的特性 并以某种方式向用户展示这些结果 覆盖应用方法来处理: 通过-C参数将SBT配置为像这样使用自定义报告器: Test / testOptions += Tests.Argument("-C", "exampl

我正在考虑使用Scalatest设置一个自动验收测试套件,并将结果输出到一个简单的web仪表板中(比如打印每个场景文本,并在其旁边打上复选标记或十字)。是否有一个内置功能可用于显示普通输出的替代方法,或者我需要自己输出和解析日志?

考虑创建一个自定义:

其实例收集正在运行的测试套件的结果的特性 并以某种方式向用户展示这些结果

覆盖
应用
方法来处理:

通过
-C
参数将SBT配置为像这样使用自定义报告器:

Test / testOptions += Tests.Argument("-C", "example.MyReporter")

这是一个有效的例子。

在Mario的回答之后,我再次查看了文档,似乎事实上像我这样的用例有内置的功能

使用报告器
通过指定将以下参数传递给ScalaTest,可以使用ScalaTest的报告器:
-f[configs…]-导致将测试结果写入指定文件
-u-导致将测试结果写入命名目录中的junit样式的xml文件
-h[-Y]-导致将测试结果写入命名目录中的HTML文件,可选地包括指定的CSS文件
-a-导致为dashboard reporter归档指定数量的旧摘要和持续时间文件(在摘要/和持续时间/子目录中)(默认为两个)
-o[configs…]-导致将测试结果写回sbt,sbt通常在标准输出上显示测试结果
-e[configs…]-导致将测试结果写入标准错误
-k-使用XML格式,将测试结果以指定的主机和端口号写入套接字
-K-使用Java对象二进制格式,将测试结果以指定的主机和端口号写入套接字
-C[configs…]-导致将测试结果报告给指定的完全限定报告器类名的实例

这对于导入多个speclike的混搭套件尤其适用
Test / testOptions += Tests.Argument("-C", "example.MyReporter")
Using Reporters
You can use ScalaTest's reporters by specifying the passing the following arguments to ScalaTest:

-f[configs...] <filename> - causes test results to be written to the named file
-u <directory> - causes test results to be written to junit-style xml files in the named directory
-h <directory> [-Y ] - causes test results to be written to HTML files in the named directory, optionally included the specified CSS file
-a <number of files to archive> - causes specified number of old summary and durations files to be archived (in summaries/ and durations/ subdirectories) for dashboard reporter (default is two)
-o[configs...] - causes test results to be written back to sbt, which usually displays it on the standard output
-e[configs...] - causes test results to be written to the standard error
-k <host> <port> - causes test results to be written to socket in the named host and port number, using XML format
-K <host> <port> - causes test results to be written to socket in the named host and port number, using Java object binary format
-C[configs...] <reporterclass> - causes test results to be reported to an instance of the specified fully qualified Reporter class name