WhenFillFieldStep function

StepDefinitionGeneric<World> WhenFillFieldStep()

Enters the given text into the widget with the key provided

Examples: Then I fill the "email" field with "bob@gmail.com" Then I fill the "name" field with "Woody Johnson"

Implementation

StepDefinitionGeneric WhenFillFieldStep() {
  return given2<String, String, FlutterWorld>(
    'I fill the {string} field with {string}',
    (key, value, context) async {
      final finder = context.world.appDriver.findBy(key, FindType.key);
      await context.world.appDriver.scrollIntoView(finder);
      await context.world.appDriver.enterText(
        finder,
        value,
      );

      await context.world.appDriver.waitForAppToSettle();
    },
  );
}