PlaybookSpeed class

How fast a playbook performs its steps.

Every wait the actor takes comes from one PlaybookSpeed, so a playbook is written once and replayed at any pace:

await SignUpPlaybook().run(speed: PlaybookSpeed.fast);
await SignUpPlaybook().run(speed: PlaybookSpeed.natural.times(2));

From Metro: metro live:run playbook sign_up --speed fast.

Constructors

PlaybookSpeed({required String name, required Duration betweenSteps, required Duration tapHold, required Duration perCharacter, double typingJitter = 0, required Duration fingerTravel, required Duration swipe, required Duration afterNavigation})
Creates a custom speed.
const

Properties

afterNavigation → Duration
The pause after the page changes.
final
betweenSteps → Duration
The pause after each step.
final
fingerTravel → Duration
How long the finger takes to move to its target.
final
hashCode → int
The hash code for this object.
no setterinherited
name → String
The name shown in reports, e.g. natural or natural×2.
final
perCharacter → Duration
The delay between typed characters.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
swipe → Duration
How long one swipe of a scroll takes.
final
tapHold → Duration
How long the finger stays down for a tap.
final
typingJitter → double
How much perCharacter varies, as a fraction of it.
final

Methods

nextCharacter(Random random) → Duration
The delay before the next typed character, with typingJitter applied.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
times(num factor) → PlaybookSpeed
This speed with every duration multiplied by factor.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

named(String name) → PlaybookSpeed?
The built-in speed called name, or null when there is none.

Constants

fast → const PlaybookSpeed
Quick, but still easy to follow.
instant → const PlaybookSpeed
No waits beyond what scrolling needs. Meant for tests.
natural → const PlaybookSpeed
The pace of a person using the app. The default.
presets → const Map<String, PlaybookSpeed>
The built-in speeds, by name.
slow → const PlaybookSpeed
Slow enough to narrate over, for tutorials and screen recordings.