簡體   English   中英

有沒有辦法可以在 Testcafe 中輸出每個測試的持續時間?

[英]Is there a way where I can output the duration of each test in Testcafe?

我有一個 testcafe 套件,里面有 6 個測試。 在 Testcafe 會話結束時,它輸出所有測試一起花費的時間。 我想要的是分別為每個測試和結束總時間。

我看着這個; https://github.com/DevExpress/testcafe/issues/2217但看起來報告者最后還是輸出總數?

對於每個測試,顯示測試通過或失敗需要多長時間

  1. 測試一(0m 13s)
  2. 測試二(1m 15s)

2 通過 (1m 28s)

您需要創建一個自定義報告器,以所需格式輸出測試結果。 查看此問題以了解如何創建一個。

到目前為止,我發現的最新且有效的插件是https://github.com/Raynos/testcafe-reporter-spec-time

testcafe-reporter-spec-time 日志截圖

你可以安裝這個reporter插件: https : //www.npmjs.com/package/testcafe-reporter-time

以下是安裝和使用說明: https : //devexpress.github.io/testcafe/documentation/guides/concepts/reporters.html#use-the-reporters

安裝記者

您可以像安裝任何其他插件一樣從 npm 安裝報告程序包。 請參閱安裝插件。

使用記者

運行測試時,您可以選擇一個報告器來生成測試報告。 您可以使用 -r (--reporter) 命令行選項或 runner.reporter API 方法來執行此操作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM