搜尋分類、套件與程式碼儲存庫

套件詳情v2.0.1

testreport

此程式庫可用於處理 Dart 測試的結果。它會處理 Dart 測試執行器產生的 `json` 輸出資料,並提供一個 API 來存取測試結果。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
34.7萬
喜歡數
3
Pub 分數
160

安裝套件

flutter pub add testreport

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

testreport 套件處理由 Dart 測試執行器產生的 JSON 輸出中的 Dart 測試結果。它提供一個結構化 API,用於解析、分析並從測試結果中提取有意義的資訊,例如通過/失敗狀態、持續時間和錯誤。這對於將測試結果整合至 CI/CD 流程、產生報告或跨平台視覺化測試效能特別有幫助。該程式庫支援所有主要的 Flutter 平台,使其非常適合跨平台測試工作流程。

適用情境

  • CI/CD 結合
  • 測試結果分析
  • 自動報告
  • 跨平台測試
  • 測試儀表板

主要特色

  • JSON 結果解析
  • Platform-agnostic
  • 錯誤與持續時間提取
  • 結構化資料 API
  • 支援所有 Flutter 平台

適合對象

  • CI/CD 系統
  • 測試自動化團隊
  • 品質保證工程師
  • 使用 Flutter 的開發者
  • 報告工具

使用建議

  • 需要來自 dart 測試執行器的 JSON 輸出
  • 限於測試後處理
  • 無即時測試監控
  • 取決於測試執行器輸出格式
  • 不適用於直接執行測試

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Test Report

Introduction

This library can be used to process the results of dart tests.

The goal of this library is to process the data from the json output emitted by the dart test runner and provide an API to the interpreted test results.

Purpose

By running

pub run test simple_test.dart --reporter json

and the contents of simple_test.dart is

import 'package:test/test.dart';

main() {
  test('simple', () {
    expect(true, true);
  });
}

the dart test runner will output the results of the test in json format as a stream of events:

{"protocolVersion":"0.1.0","runnerVersion":"0.12.13+1","type":"start","time":0}
{"count":1,"type":"allSuites","time":0}
{"suite":{"id":0,"platform":"vm","path":"simple_test.dart"},"type":"suite","time":0}
{"test":{"id":1,"name":"loading simple_test.dart","suiteID":0,"groupIDs":[],"metadata":{"skip":false,"skipReason":null}},"type":"testStart","time":0}
{"testID":1,"result":"success","hidden":true,"type":"testDone","time":237}
{"group":{"id":2,"suiteID":0,"parentID":null,"name":null,"metadata":{"skip":false,"skipReason":null},"testCount":1},"type":"group","time":241}
{"test":{"id":3,"name":"simple","suiteID":0,"groupIDs":[2],"metadata":{"skip":false,"skipReason":null}},"type":"testStart","time":242}
{"testID":3,"result":"success","hidden":false,"type":"testDone","time":268}
{"success":true,"type":"done","time":271}

From this json output, it is not easy to see how many tests were executed, how many failed and how much time was spent in each test.

The Processor in this project takes the json events, and turns them into a Report, that is suitable for further processing.

License and contributors

所屬分類

原始碼儲存庫

使用此套件的專案