flutter_probe_annotation library

Dart annotations for FlutterProbe — declare ProbeScript end-to-end tests as decorators on your Flutter screen classes. Pair with flutter_probe_gen to generate .probe test files at build time.

See flutterprobe.dev for the full ProbeScript language reference.

Classes

Above
Emits: "target" above "anchor".
AllowPermission
Emits: allow permission "name".
Below
Selects a widget positioned spatially relative to another anchor widget.
BiometricMatch
Emits: biometric match. Simulates a successful Face ID / Touch ID / fingerprint capture, satisfying a pending biometric prompt.
BiometricNoMatch
Emits: biometric no match. Simulates a failed Face ID / Touch ID / fingerprint capture so the app's "authentication failed" path can be exercised.
CallHttp
Emits: call METHOD "url" with body "...".
Clear
Emits: clear "X" — clears the value of a field.
ClearAppData
Emits: clear app data. Destructive: wipes app storage and relaunches.
Close
Emits: close the app.
CompareScreenshot
Emits: compare screenshot "name" — visual regression compare.
CopyToClipboard
Emits: copy "text" to clipboard.
DenyPermission
Emits: deny permission "name".
Device
One device entry in a ProbeCompositeTest.devices list. The alias is referenced by OnDevice; target is an optional human-readable device name shown in the generated .probe header and in failure messages.
DontSee
Emits negative assertions:
DoubleTap
Emits: double tap "X".
Drag
Emits: drag "from" to "to".
DumpWidgetTree
Emits: dump widget tree.
EnrollBiometric
Emits: enroll biometric. Sets the simulator/emulator's biometric enrollment state to "enrolled" so subsequent BiometricMatch or BiometricNoMatch satisfy a pending Face ID / Touch ID / fingerprint prompt in the app under test.
Examples
A list of named columns and rows. Used by ProbeTest.examples to expand a test into one execution per row, with <column> references in step arguments substituted to the row's value.
Field
A convenience selector accepted by every step that takes a target. Provide one of text or id (or pass a Selector instance directly).
GoBack
Emits: go back. Equivalent to the platform back gesture.
GrantAllPermissions
Emits: grant all permissions.
IdSel
Selects a widget by its ValueKey or Semantics.identifier.
If
Emits an if "condition" appears block with a body and optional otherwise branch.
InContainer
Selects a widget by text within a named container ("Email" in "LoginForm").
Kill
Emits: kill the app. Force-stops without relaunching.
LeftOf
Emits: "target" left of "anchor".
Log
Emits: log "message".
LongPress
Emits: long press "X".
Mock
Emits a when the app calls METHOD /path mock block.
OnDevice
Scopes a group of steps to a single device in a composite test. The alias must match a Device.alias declared in the enclosing @ProbeCompositeTest.devices.
Open
Emits: open the app.
Emits: open link "url".
Ordinal
Selects the Nth occurrence of a text-matched widget, optionally inside a container.
PasteFromClipboard
Emits: paste from clipboard.
Pause
Emits: pause. Pauses execution until manually resumed.
Pinch
Emits: pinch in / pinch out.
Press
Emits: press home / press back / press <key>.
ProbeCompositeTest
Declares a multi-device composite test. The annotated class becomes a composite test "name" block in the generated .probe file.
ProbeRecipe
Declares a reusable recipe with named parameters. Use RecipeStep inside a test's steps to invoke it.
ProbeSuite
Declares a ProbeScript test suite. Apply to any top-level Dart class (typically a screen or page widget).
ProbeTest
A single test case. Used inside ProbeSuite.tests or as a standalone annotation on a class for one-off tests.
RecipeStep
Invokes a recipe declared via @ProbeRecipe. Emits the recipe name and quoted arguments, e.g. sign in "alice@example.com" "hunter2".
Repeat
Emits a repeat N times block.
Restart
Emits: restart the app. Force-stops and relaunches preserving data.
RevokeAllPermissions
Emits: revoke all permissions.
RightOf
Emits: "target" right of "anchor".
Rotate
Emits: rotate portrait / rotate landscape / rotate <name>.
RunDart
Emits: run dart: block with raw Dart code (verbatim).
SaveLogs
Emits: save logs.
Scroll
Emits: scroll up / scroll down "Container".
See
Emits ProbeScript assertions of the form:
Selector
Base type for all widget selectors.
SetLocation
Emits: set location lat, lng. Simulator/emulator only.
Shake
Emits: shake. Triggers a device shake gesture (simulators only).
Step
Base type for every test step.
Store
Emits: store "value" as varName. Captures a value for later substitution.
Swipe
Emits: swipe up / swipe down "X".
Sync
Cross-device barrier in a composite test. All devices must reach the same Sync label before any device proceeds past it.
TakeScreenshot
Emits: take screenshot "name".
Tap
Emits: tap "Text" or tap #id (with optional if visible suffix).
TextSel
Selects a widget by its visible text content.
Toggle
Emits: toggle "X".
Type
Emits: type "text" or type "text" into #target.
TypeSel
Selects a widget by its Dart type name (e.g. "ElevatedButton").
VerifyExternalBrowser
Emits: verify external browser opened.
Wait
Emits: wait N seconds / wait until "X" appears / wait for the page to load / wait until network is idle / wait for animations to end.
WaitFor
WaitForAnimations
WaitForNetworkIdle
WaitForPageLoad
WaitUntil
Wait until a target widget appears or disappears.

Enums

Direction
Direction for Swipe and Scroll.
HttpMethod
SeeState
State checks for See assertions.