enterText method
Implementation
Future<void> enterText(
String id,
String value, {
bool submit = false,
TestStep? step,
int? timeoutMs,
Future<void> Function()? onBeforeText,
}) async {
return await RunnerBenchmark.async('execution', 'enterText', () async {
var finder = assertions.finderForId(id);
if (finder.evaluate().isEmpty) {
await waitFor(
id: id,
timeoutMs: timeoutMs ?? config.defaultWaitTimeout.inMilliseconds,
);
finder = assertions.finderForId(id);
}
_expectSingleWidget(finder, id, 'enterText');
await _ensureTextTargetReady(finder, 'enterText');
await _emitEvidenceBoundary(step);
await onBeforeText?.call();
await tester.enterText(finder, value);
if (submit) {
await tester.testTextInput.receiveAction(TextInputAction.done);
}
await runtime.settleAfterAction();
});
}