[e2e] Fix for ermine_intl_test breakage in infra
Based on message in log: http://shortn/_FSyghUvdGq
"This test failed after it had already completed. Make sure to use [expectAsync]
or the [completes] matcher when testing async code."
The ermine_intl_test was not using async for setLocale.
Test: Tested manually on dev workstation.
Change-Id: If152653ecc853a1f3a7ee864666326ee013199f6
diff --git a/tests/e2e/test/ermine_intl_test.dart b/tests/e2e/test/ermine_intl_test.dart
index 308ec7b..23947b9 100644
--- a/tests/e2e/test/ermine_intl_test.dart
+++ b/tests/e2e/test/ermine_intl_test.dart
@@ -14,10 +14,9 @@
FlutterDriverConnector connector;
FlutterDriver driver;
- void setLocale(String localeId) async {
- expect(
- (await sl4f.ssh.run('run setui_client.cm intl -l $localeId')).exitCode,
- 0);
+ Future<void> setLocale(String localeId) async {
+ var result = await sl4f.ssh.run('run setui_client.cm intl -l $localeId');
+ expect(result.exitCode, 0);
}
void findTextOnScreen(String text) {
@@ -45,7 +44,7 @@
});
tearDownAll(() async {
- setLocale('en-US');
+ await setLocale('en-US');
// Any of these may end up being null if the test fails in setup.
await driver?.close();
@@ -55,11 +54,11 @@
});
test('Locale can be switched and takes effect', () async {
- setLocale('en-US');
+ await setLocale('en-US');
findTextOnScreen('MEMORY');
// The text on screen is equivalent to US English "MEMORY".
- setLocale('sr');
+ await setLocale('sr');
findTextOnScreen('МЕМОРИЈА');
});
}