preparePlaybookBinding function
Lets a playbook's touches reach the app in an integration test.
The integration test binding drops pointer events that don't come from
the tester, and throws if that setting changes during a test, so call
this before testWidgets:
void main() {
preparePlaybookBinding(IntegrationTestWidgetsFlutterBinding.ensureInitialized());
testWidgets('sign up journey', (tester) async {
app.main();
await tester.pumpAndSettle();
expectPlaybookPassed(await SignUpPlaybook().run());
});
}
Widget tests don't need it.
Implementation
void preparePlaybookBinding(TestWidgetsFlutterBinding binding) {
if (binding is! LiveTestWidgetsFlutterBinding) return;
binding.shouldPropagateDevicePointerEvents = true;
binding.framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fullyLive;
}