testLocaleSetting function

Future<void> testLocaleSetting(
  1. WidgetTester tester, {
  2. required EFUILang l10n,
  3. required LocaleNames l10nNames,
  4. required bool isLefty,
})

For integration testing Test EzLocaleSetting

Implementation

Future<void> testLocaleSetting(
  WidgetTester tester, {
  required EFUILang l10n,
  required LocaleNames l10nNames,
  required bool isLefty,
}) async {
  ezLog('\nTesting language setting button');

  // Activate Spanish localizations
  ezLog('Spanish');
  await touch(tester, find.byType(EzLocaleSetting));
  await touchText(tester, l10nNames.nameOf('es')!);
  await tester.pumpAndSettle();

  // Activate French localizations
  ezLog('French');
  await touch(tester, find.byType(EzLocaleSetting));
  await touchText(tester, l10nNames.nameOf('fr')!);
  await tester.pumpAndSettle();

  // Activate English localizations
  ezLog('English');
  await touch(tester, find.byType(EzLocaleSetting));
  await touchText(tester, l10nNames.nameOf('en')!);
  await tester.pumpAndSettle();

  // Activate English localizations
  ezLog('Close');
  await touch(tester, find.byType(EzLocaleSetting));
  await touchText(tester, l10n.gClose);
  await tester.pumpAndSettle();
}