maestro_test 0.1.4 copy "maestro_test: ^0.1.4" to clipboard
maestro_test: ^0.1.4 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.4

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();
  final maestro = Maestro.forTest();

  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 maestro.pressHome();

      await maestro.pressDoubleRecentApps();

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

      await maestro.openNotifications();
      await maestro.pressBack();
    },
  );
}

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