Search packages, repositories and app categories

Package detailsv1.2.0

flutter_test_robots

Flutter test tools and extensions to simulate human-computer interactions

30-day downloads
63.5K
Likes
34
Pub points
150

Install package

flutter pub add flutter_test_robots

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Flutter Test Robots is a testing toolkit designed to simplify and enhance Flutter app testing by providing extensions that simulate realistic human-computer interactions. It enables developers to write more natural, readable test scripts that mimic user actions such as tapping, typing, and scrolling. Built for integration with Flutter's testing framework, it improves test reliability and maintainability. The package supports both widget and integration tests, making it easier to verify complex UI behaviors without boilerplate code.

Use cases

  • Automating UI interaction testing
  • Simulating user workflows in tests
  • Improving test readability and maintainability
  • Validating form inputs and navigation
  • Testing dynamic UI components

Key features

  • Human-like interaction simulation
  • Readable and expressive test syntax
  • Integration with Flutter's test framework
  • Support for widget and integration tests
  • Extensible and composable action chains

Suitable for

  • Flutter developers writing automated tests
  • Teams prioritizing test quality and clarity
  • Projects requiring complex UI interaction validation
  • Test automation engineers using Flutter
  • Developers seeking to reduce test flakiness

Considerations

  • Requires familiarity with Flutter testing
  • May increase test suite size slightly
  • Not suitable for non-UI testing scenarios
  • Limited documentation beyond basic examples
  • Best used in conjunction with existing test frameworks

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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());
    }
  });
}

Categories

Source repository

Projects using this package

No data available yet.

Rankings