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