WhenTapWidget function
StepDefinitionGeneric<World>
WhenTapWidget()
Taps the widget found with the given control key.
Parameters: 1 - {string} the control key
Examples:
When I tap "controlKey" button"
When I tap "controlKey" element"
When I tap "controlKey" label"
When I tap "controlKey" icon"
When I tap "controlKey" field"
When I tap "controlKey" text"
When I tap "controlKey" widget"
Implementation
StepDefinitionGeneric WhenTapWidget() {
return when1<String, FlutterWorld>(
RegExp(
r'I tap the {string} (?:button|element|label|icon|field|text|widget)$'),
(key, context) async {
await context.world.appDriver.waitForAppToSettle();
final finder = context.world.appDriver.findBy(key, FindType.key);
await context.world.appDriver.scrollIntoView(
finder,
);
await context.world.appDriver.waitForAppToSettle();
await context.world.appDriver.tap(
finder,
timeout: context.configuration.timeout,
);
await context.world.appDriver.waitForAppToSettle();
},
);
}