JSL Hamcrest 报告@贾斯汀_奇尔顿,我希望你(或其他人)能够帮助我解决 jsl hamcrest 问题。 我正在寻找扩展测试人员的报告,但我不太确定如何导航类来做到这一点。
我找到了 UtCollectiongReporter 并且能够通过在末尾添加以下行来在测试结束时得到一个空白报告:
UtCollectingReporter:show report();
但是,没有包括任何成功/失败/等。 如何调整工具以使该报告工具充满信息?
谢谢!
回复:JSL Hamcrest 报告你好@内森克拉克,
打电话UtCollectingReporter:显示报告();将调用展示报告类定义上的函数,而不是收集成功和失败的实例。
首先,您需要设置ut全球记者对象以更改报告结果的方式。 这可能是收集记者或图书馆中的任何其他记者。
// set the reporter to the UtCollectingReporter
ut global reporter = ut collecting reporter();
// run some tests here
// show the report at the end
ut global reporter:show report();
此外,我在我们的 GitHub 存储库中添加了一个问题,以添加更多关于使用不同类型报告器的文档: https://github.com/sassoftware/jsl-hamcrest/issues/95