fillForm method
Implementation
Future<void> fillForm(
Map<Key, String> fields, {
Key? submitBtnKey,
String? selectSpaceId,
}) async {
for (final entry in fields.entries) {
final textField = find.byKey(entry.key);
await tester.ensureVisible(textField);
await textField.should(findsOneWidget);
await textField.enterTextWithoutReplace(entry.value);
}
if (selectSpaceId != null) {
await selectSpace(selectSpaceId, SelectSpaceFormField.openKey);
}
if (submitBtnKey != null) {
final submit = find.byKey(submitBtnKey);
await tester.ensureVisible(submit);
await submit.should(findsOneWidget);
await submit.tap();
}
}