PatrolIntegrationTester is the main testing interface provided to your patrolTest() callback. It extends PatrolTester with native automation capabilities through the platform property.
Class Definition
Properties
Provides access to native automation features for interacting with Android, iOS, and Web platforms.This is the primary interface for native automation.
Alternative name for
platform. Both provide the same functionality.The underlying Flutter
WidgetTester instance. Use this when you need direct access to Flutter’s testing APIs.Configuration object controlling timeouts, settle policies, and logging behavior.
Methods
Finder Methods
Creates a custom Patrol finder. This is a callable method that makes the tester instance itself callable.Accepts:
Type, Key, Symbol, String, Pattern, IconData, Widget, Finder, or PatrolFinder.Logs a message to the Patrol log output.
Widget Interaction Methods
Waits for a widget to be visible and taps it.Parameters:
settlePolicy- How to pump frames after tappingvisibleTimeout- How long to wait for visibilitysettleTimeout- Timeout for settlingalignment- Where to tap within the widget
Waits for a widget to be visible and performs a long press.
Waits for a text field to be visible and enters text.
Waiting Methods
Waits until the finder locates at least one visible widget.Parameters:
timeout- Maximum time to wait (defaults toconfig.visibleTimeout)alignment- Point to check for visibility
Waits until the finder locates at least one widget (doesn’t need to be visible).
Scrolling Methods
Scrolls a view until the target widget becomes visible.Parameters:
finder- The widget to scroll toview- The scrollable widget (defaults to first Scrollable)delta- Distance to scroll per iterationscrollDirection- Direction to scrollmaxScrolls- Maximum scroll attempts
Similar to
scrollUntilVisible, but scrolls until the widget exists (not necessarily visible).Pump Methods
Renders a widget in the test environment. See
WidgetTester.pumpWidget.Renders a widget and waits for all animations to complete.
Triggers a single frame. See
WidgetTester.pump.Repeatedly pumps frames until there are no more pending frames.
Like
pumpAndSettle, but doesn’t throw if it times out (useful for infinite animations).Usage Examples
Basic Widget Testing
Scrolling to Elements
Combined Flutter + Native Testing
Using Custom Configuration
Logging
See Also
- patrolTest() - Function that creates test and provides this tester
- PatrolFinder - Custom finder returned by
$() - PlatformAutomator - Native automation interface