playbook library

Nylo Playbooks: scripted walkthroughs your app performs on itself.

Import this in playbooks (lib/app/playbooks/) and in lib/bootstrap/playbooks.dart. While the app runs in debug mode, metro live:run playbook <name> (or playbook <name> inside metro live) plays one, and Playbook.run() plays it from Dart or a test.

Classes

Find
Precise targets for playbook steps, for when a plain string is ambiguous.
LivePlaybookClock
A PlaybookClock that waits in real time, for running apps and integration tests.
Playbook
A user journey your app performs on itself: taps, typing, scrolling and page changes, at a natural, fast or slow pace. Override showFinger and caption to show a finger and a caption for each step.
PlaybookActor
Performs a playbook's steps on the running app, like a person would.
PlaybookCamera
Takes a playbook run's screenshots once each step settles.
PlaybookClock
Where a playbook's time comes from.
PlaybookFinder
Finds widgets on screen for a playbook step.
PlaybookGroupStep
A step made of other steps, like scene() and play(), whose results nest under it in the report.
PlaybookRegistry
The playbooks registered with Nylo, and the names they run by.
PlaybookReport
The result of running a playbook: whether it passed, and each step.
PlaybookRunner
Runs registered playbooks by name, for Metro and PLAYBOOK_ON_BOOT.
PlaybookScreenshotStep
A screenshot() step: the screen to capture, by name, in each of locales and themes.
PlaybookSession
What one run shares across nested playbooks: the clock, the overlay, the finger, and whether it's been asked to stop.
PlaybookShot
One capture taken during a playbook run.
PlaybookSpeed
How fast a playbook performs its steps.
PlaybookStep
One step of a playbook: a title, and what the actor does.
PlaybookStepContext
Where a step list runs: its caption prefix, its depth, and the chain of playbooks around it.
PlaybookStepResult
What happened in one step of a playbook run.
PlaybookTree
A snapshot of the elements on screen, taken once per lookup.

Enums

PlaybookCaption
Where a playbook's step caption is shown.
PlaybookScreenshots
Which screens a playbook run captures.
PlaybookShotKind
Why a PlaybookShot was taken.
PlaybookStepStatus
How a playbook step ended.

Functions

playbookVisibleRect(Element element) → Rect?
The part of element that is on screen, in global coordinates, or null when none of it is.

Typedefs

PlaybookLook = Future<Future<void> Function()> Function({String? locale, String? theme})
Shows the app in a locale and theme and returns a function that puts back the ones before, like ScreenshotLook.show.
PlaybookNative = Future<void> Function({required String id, String? locale, required String name, String? theme})
Asks Metro to capture the whole screen for the shot id, and completes once it has. Throws with the reason when it can't.

Exceptions / Errors

PlaybookFailure
A step that couldn't do what it says, with what was on screen.
PlaybookStopped
Thrown inside a run that was asked to stop.