flutter-freaccess-hub/integration_test/module_test.dart

51 lines
1.7 KiB
Dart

part of 'app_test.dart';
class ModularizationTest {
static Future containLicense() async {
_setUpLogged();
testWidgets('Os modulos de licença está sendo processados?',
(WidgetTester tester) async {
await tester.pumpWidget(const App());
await tester.pumpAndSettle();
await Future.delayed(const Duration(seconds: 1));
await tester.pumpAndSettle();
final LicenseRepository licenseRepository = LicenseRepositoryImpl();
final List<String> result = await licenseRepository.getLicense();
expect(result, isNotEmpty);
await tester.pumpAndSettle();
final List<MenuEntry> entries = MenuEntry.entries;
await tester.pumpAndSettle();
final List<String> entriesKey = entries
.where((entry) => entry.types.contains(MenuEntryType.Home))
.map((entry) => '{key: ${entry.key}}')
.toList();
await tester.pumpAndSettle();
expect(result, containsAll(entriesKey));
await Future.delayed(const Duration(milliseconds: 500));
return;
});
_tearDown();
}
static Future switchLicense() async {
_setUpLogged();
testWidgets('Licença está sendo atualizada?', (WidgetTester tester) async {
await tester.pumpWidget(const App());
final Finder profile =
find.byKey(const Key('AsyncLocalProfileComponentWidget_InkWell'));
await tester.pumpAndSettle();
await tester.tap(profile);
await tester.pumpAndSettle();
final Finder local = find.text('FRE ACCESS DEMO');
await tester.pumpAndSettle();
await tester.tap(local);
await tester.pumpAndSettle();
await Future.delayed(const Duration(milliseconds: 500));
return;
});
_tearDown();
}
}