From e5dccdbb917593090892eb1049385ca16270de65 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 13 Dec 2023 12:54:44 +0100 Subject: [PATCH] fix being unable to interact with the running app with a finger --- packages/patrol/lib/src/binding.dart | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/patrol/lib/src/binding.dart b/packages/patrol/lib/src/binding.dart index 990c554af0..471bab95ee 100644 --- a/packages/patrol/lib/src/binding.dart +++ b/packages/patrol/lib/src/binding.dart @@ -40,8 +40,6 @@ class PatrolBinding extends LiveTestWidgetsFlutterBinding { /// You most likely don't want to call it yourself. PatrolBinding(NativeAutomatorConfig config) : _serviceExtensions = DevtoolsServiceExtensions(config) { - shouldPropagateDevicePointerEvents = true; - final oldTestExceptionReporter = reportTestException; reportTestException = (details, testDescription) { final currentDartTest = _currentDartTest; @@ -154,6 +152,20 @@ class PatrolBinding extends LiveTestWidgetsFlutterBinding { /// See https://github.com/flutter/devtools/issues/6719 TargetPlatform? workaroundDebugDefaultTargetPlatformOverride; + /// Allows for gestures made with human finger to be percevied as gestures + /// made with [WidgetTester], allowing to interact with a running test. + /// + /// We thought we may replace this override by setting + /// [shouldPropagateDevicePointerEvents] to true but it doesn't work. + /// + /// See also: + /// + /// * https://github.com/leancodepl/patrol/issues/1956 + @override + TestBindingEventSource get pointerEventSource { + return TestBindingEventSource.test; + } + @override void initInstances() { super.initInstances();