/when_I_press.dart Secret
Created
August 5, 2022 17:22
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StepDefinitionGeneric whenIPressNumber() { | |
return when1<int, FlutterWidgetTesterWorld>( | |
'I press number {int}', | |
(number, context) async { | |
final tester = context.world.rawAppDriver; | |
await tester.pumpAndSettle(); | |
final finder = context.world.appDriver.findBy('btn$number', FindType.key); | |
await tester.tap(finder); | |
await tester.pump(); | |
}, | |
); | |
} | |
StepDefinitionGeneric whenIPressOperation() { | |
return when1<String, FlutterWidgetTesterWorld>( | |
'I press operation {string}', | |
(operation, context) async { | |
final tester = context.world.rawAppDriver; | |
await tester.pumpAndSettle(); | |
final finder = context.world.appDriver.findBy(operation, FindType.text); | |
await tester.tap(finder); | |
await tester.pump(); | |
}, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment