パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.2.0

flutter_test_robots

人間とコンピュータの相互作用をシミュレートするためのFlutterテストツールおよび拡張機能

30日間ダウンロード
6.4万
いいね数
34
Pub ポイント
150

パッケージをインストール

flutter pub add flutter_test_robots

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutter Test Robots は、Flutter アプリのテストを簡素化し、強化するために設計されたテストキットで、現実的な人間とコンピュータの相互作用をシミュレートする拡張機能を提供します。開発者がタップ、入力、スクロールなどのユーザー操作を模倣するより自然で読みやすいテストスクリプトを書けるようにします。Flutter のテストフレームワークとの統合を目的としており、テストの信頼性と保守性を向上させます。このパッケージはウィジェットテストと統合テストの両方をサポートしており、ボイラープレートコードなしに複雑なUI動作を検証しやすくなります。

用途

  • UIインタラクションテストの自動化
  • テストでのユーザー作業フローのシミュレーション
  • テストの読みやすさと保守性の向上
  • フォーム入力とナビゲーションの検証
  • 動的UIコンポーネントのテスト

主な機能

  • 人間のようなインタラクションのシミュレーション
  • 読みやすく表現力のあるテスト構文
  • Flutter のテストフレームワークとの統合
  • ウィジェットおよび統合テストのサポート
  • 拡張可能で構成可能なアクションチェーン

適している対象

  • Flutter開発者が自動テストを書いている
  • テストの品質と明確さを重視するチーム
  • 複雑なUIインタラクションの検証を必要とするプロジェクト
  • Flutter を使用するテスト自動化エンジニア
  • テストの不安定性を減らしたい開発者

注意事項

  • Flutter テストに精通している必要があります
  • テストスイートのサイズがわずかに増える可能性があります
  • UI以外のテストシナリオには適していません
  • 基本的な例以外のドキュメントは限られている
  • 既存のテストフレームワークと併用するのが最適です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Flutter Test Robots - Easily simulate human behaviors in tests

Built by the Flutter Bounty Hunters



Check out our Usage Guide


Easy keyboard shortcuts

flutter_test_robots adds methods to WidgetTester for many common keyboard shortcuts.

void main() {
  testWidgets("easy shortcuts", (tester) async {
    await tester.pressEnter();

    await tester.pressShiftEnter();
    
    await tester.pressAltLeftArrow();
  });
}

Simulate hardware keyboard text input

flutter_test_robots presses key combos for every character in a given string.

void main() {
  testWidgets("type with a hardware keyboard", (tester) async {
    // Simulate every key press that's needed to type "Hello, world!".
    await tester.typeKeyboardText("Hello, world!");
  });
}

Simulate IME text input

flutter_test_robots breaks strings into text editing deltas and sends the deltas through the standard DeltaTextInputClient API.

void main() {
  testWidgets("type with the IME", (tester) async {
    // Simulate every IME delta needed to type "Hello, world!".
    await tester.ime.typeText("Hello, world!");
  });
}

Simulate popular mobile devices

flutter_test_robots can configure a WidgetTester viewport like popular recent phones.

void main() {
  testWidgets("renders on iPhone 16 Pro Max", (tester) async {
    tester.asIPhone16ProMax();

    await tester.pumpWidget(MyApp());
  });

  testWidgets("renders on every built-in test device", (tester) async {
    for (final device in TestDevices.all) {
      tester.configureForDevice(device);

      await tester.pumpWidget(MyApp());
    }
  });
}

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。

ランキング