PlaybookActor class
Performs a playbook's steps on the running app, like a person would.
Every verb a playbook's steps use is here too, as a method returning a
future, for Playbook.setUp, Playbook.tearDown and step():
step('Dismiss the promo if it shows', (actor) async {
if (await actor.exists('Not now')) await actor.tap('Not now');
}),
Constructors
-
PlaybookActor({required PlaybookSession session, required PlaybookSpeed speed, required Map<
String, dynamic> data, Duration timeout = const Duration(seconds: 10)}) -
Creates an actor for one playbook in
session.
Properties
-
data
→ Map<
String, dynamic> -
The playbook's data: its defaults, overridden by what the run passed.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- ignoreStop ↔ bool
-
While true, a stop request doesn't interrupt waits, so tearDown can
finish.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- session → PlaybookSession
-
What the whole run shares.
final
- speed → PlaybookSpeed
-
The pace of this playbook's steps.
final
- timeout ↔ Duration
-
How long a step waits for its target to show up.
getter/setter pair
Methods
-
back(
) → Future< void> - Goes back a page, tapping the back button when one is on screen.
-
currentRouteName(
) → String? - The name of the page on screen, from Nylo's router when the app uses it, otherwise from the root navigator.
-
dontSee(
Object target, {Duration? timeout}) → Future< void> -
Waits for
targetto be off the screen. -
exists(
Object target) → Future< bool> -
Whether
targetis on screen right now. Doesn't wait. -
longPress(
Object target) → Future< void> -
Presses and holds
targetlong enough to count as a long press. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pause(
{num seconds = 1}) → Future< void> -
Holds still for
seconds. -
scrollTo(
Object target, {Object? within}) → Future< void> -
Scrolls until
targetis on screen, swiping the largest scrollable on screen, or the onewithinfinds. -
see(
Object target) → Future< void> -
Waits for
targetto be on screen. -
settle(
) → Future< void> - Waits for the screen to settle after a step.
-
tap(
Object target) → Future< void> -
Taps
target. -
toString(
) → String -
A string representation of this object.
inherited
-
type(
Object target, String text, {bool clear = true, bool submit = false}) → Future< void> -
Taps the text field
target, then typestextone character at a time. -
visit(
String path, {Object? data}) → Future< void> -
Opens the page at
path, passingdatato it. -
wait(
Duration duration) → Future< void> -
Waits for
duration, stopping early when the run is stopped. -
waitFor(
Object target, {Duration? timeout}) → Future< void> -
Waits up to
timeout(the actor'stimeoutby default) fortargetto be on screen. -
waitForPage(
String path, {Duration? timeout}) → Future< void> -
Waits for the current page to be
path.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited