patrol_finders_plus 5.0.2 copy "patrol_finders_plus: ^5.0.2" to clipboard
patrol_finders_plus: ^5.0.2 copied to clipboard

Streamlined, high-level API on top of flutter_test.

⚠️ Independent fork — patrol_finders_plus is an independent fork of Patrol, originally created by LeanCode. It is maintained by Bdaya-Dev and is not maintained, supported, or endorsed by LeanCode. Please report issues at https://github.com/Bdaya-Dev/patrol/issues, not to LeanCode. Both the original and this fork are licensed under the Apache License 2.0 (see LICENSE and NOTICE.md).

patrol_finders_plus #

patrol_plus on pub.dev patrol_cli_plus on pub.dev patrol_finders_plus on pub.dev

A powerful, multiplatform E2E UI testing framework for Flutter apps that overcomes the limitations of integration_test by handling native interactions, battle-tested and shaped by production-grade experience.

Patrol finders #

patrol_finders_plus is a streamlined, high-level API on top of flutter_test.

It provides a new custom finder system to make Flutter widget tests more concise and understandable, and writing them – faster and more fun.

Installation #

$ dart pub add patrol_finders_plus --dev

Documentation #

See the upstream Patrol project for full documentation and usage guides.

Custom finders #

import 'package:example/main.dart';
import 'package:flutter/material.dart';
import 'package:patrol_finders_plus/patrol_finders_plus.dart';

void main() {
  patrolWidgetTest(
    'logs in successfully',
    ($) async {
      await $.pumpWidgetAndSettle(const ExampleApp());

      /// Finds widget with Key('emailInput') and enters text into it
      ///
      await $(#emailInput).enterText('user@example.com');

      /// Finds widget with Key('passwordInput') and enters text into it
      await $(#passwordInput).enterText('ny4ncat');

      // Finds all widgets with text 'Log in' which are descendants of widgets
      // with Key('box1'), which are descendants of a Scaffold widget, and taps
      // on the first 'Log in' text.
      await $(Scaffold).$(#box1).$('Log in').tap();

      // Finds all Scrollables which have Text descendant, and taps on the first
      // Scrollable
      await $(Scrollable).containing(Text).tap();

      // Finds all Scrollables which have ElevatedButton descendant and Text
      // descendant, and taps on the first Scrollable
      await $(Scrollable).containing(ElevatedButton).containing(Text).tap();

      // Finds all Scrollables which have TextButton descendant which has Text
      // descendant, and taps on the first Scrollabke
      await $(Scrollable).containing($(TextButton).$(Text)).tap();
    },
  );
}