intl_phone_number_input
intl_phone_number_input copied to clipboard
Number field can't be selected by integration test
Describe the bug Within my integration tests, I can not manage to find the input field of the phone field. I ran following code:
var phoneInput = find.byKey(const Key("intl_text_input_key"));
await tester.pumpUntilFound(tester, phoneInput);
await tester.tap(phoneInput);
Future<void> pumpUntilFound(
WidgetTester tester,
Finder finder, {
Duration timeout = const Duration(seconds: 20),
}) async {
final end = DateTime.now().add(timeout);
do {
if (DateTime.now().isAfter(end)) {
throw Exception('Timed out waiting for $finder');
}
await tester.pumpAndSettle();
await Future.delayed(const Duration(milliseconds: 100));
} while (finder.evaluate().isEmpty);
}
The documention is sadly still using flutter_driver and is thus outdated.
Package version 0.7.1
Flutter version 3.3.10
To Reproduce Steps to reproduce the behavior:
- Run integration test
- Navigate to screen with text input
- Widget will not be found by key
Expected behavior The input field should be selected correctly.
Targeted platforms (please complete the following information):
- Android