Slow down test? #1549
Replies: 3 comments
-
There isn't any option in config to do so. The only way to globally wait between each actions is to have But it's okay to play with overriding methods like: void patrol(
String description,
Future<void> Function(OwnPatrolTester) callback,
) {
patrolTest(
description,
nativeAutomation: true,
($) async {
final ownPatrolTester$ = OwnPatrolTester(
tester: $.tester,
nativeAutomator: $.nativeAutomator,
config: $.config,
);
await callback(ownPatrolTester$);
},
);
}
class OwnPatrolTester extends PatrolTester {
OwnPatrolTester({
required super.tester,
required super.nativeAutomator,
required super.config,
});
@override
Future<void> tap(
Finder finder, {
bool? andSettle,
SettlePolicy? settlePolicy,
Duration? visibleTimeout,
Duration? settleTimeout,
}) async {
await pumpAndTrySettle(duration: Duration(seconds: 1));
return super.tap(
finder,
andSettle: andSettle,
settlePolicy: settlePolicy,
visibleTimeout: visibleTimeout,
settleTimeout: settleTimeout,
);
}
} |
Beta Was this translation helpful? Give feedback.
-
@pandoras-toolbox You could create your own FYI There's also a thing called timeDilation. You may want to check that out. Disclaimer: I've never tried it with Patrol. |
Beta Was this translation helpful? Give feedback.
-
Thank you! I will try that out and report how it worked. |
Beta Was this translation helpful? Give feedback.
-
Is it possible to slow down a Patrol test without adding lots of sleep statements? It is too fast sometimes to follow it when observing.
I mean is there something in Patrol itself how it can be easily done?
Otherwise I might do it with some frameworking, proxying Patrol functions or something like that and adding the ability to slow down test execution in a generic central way.
Beta Was this translation helpful? Give feedback.
All reactions