maestro_test 0.1.2 copy "maestro_test: ^0.1.2" to clipboard
maestro_test: ^0.1.2 copied to clipboard

discontinuedreplaced by: patrol
outdated

Simple, easy-to-learn, Flutter-native UI testing framework eliminating limitations of flutter_driver

maestro_test #

maestro_test on pub.dev code style

maestro_test package builds on top of flutter_driver to make it easy to control the native device from Dart. It does this by using Android's UIAutomator library.

Installation #

Add maestro_test as a dev dependency in pubspec.yaml:

dev_dependencies:
  maestro_test: ^0.1.2

Usage #

// integration_test/app_test.dart
import 'package:example/app.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:maestro_test/maestro_test.dart';

void main() {
  IntegrationTestWidgetsFlutterBinding.ensureInitialized();
  Automator.init(verbose: true);
  final automator = Automator.instance;

  testWidgets(
    "counter state is the same after going to Home and switching apps",
    (WidgetTester tester) async {
      Text findCounterText() {
        return tester
            .firstElement(find.byKey(const ValueKey('counterText')))
            .widget as Text;
      }

      await tester.pumpWidget(const MyApp());
      await tester.pumpAndSettle();

      await tester.tap(find.byType(FloatingActionButton));
      await tester.pumpAndSettle();
      expect(findCounterText().data, '1');

      await automator.pressHome();

      await automator.pressDoubleRecentApps();

      expect(findCounterText().data, '1');
      await tester.tap(find.byType(FloatingActionButton));
      await tester.pumpAndSettle();
      expect(findCounterText().data, '2');

      await automator.openNotifications();
    },
  );
}

8
likes
0
pub points
0%
popularity

Publisher

verified publisherleancode.pl

Simple, easy-to-learn, Flutter-native UI testing framework eliminating limitations of flutter_driver

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

freezed_annotation, http, json_annotation, logging

More

Packages that depend on maestro_test