select method
Implementation
Future<void> select(
String id,
String? value, {
TestStep? step,
int? timeoutMs,
Future<void> Function()? onBeforeSelection,
}) async {
if (value == null || value.isEmpty) {
throw EnsembleTestFailure('select requires "value"');
}
try {
await tap(
id,
timeoutMs: timeoutMs,
onBeforeTap: () async {
if (step != null) await _emitEvidenceBoundary(step);
await onBeforeSelection?.call();
},
);
} on TestExecutionError catch (error) {
throw EnsembleTestFailure(error.message);
}
final option = find.text(value);
if (option.evaluate().isEmpty) {
throw EnsembleTestFailure('select could not find option "$value"');
}
await tester.tap(option);
await runtime.settleAfterAction();
}