implementação dos testes de integração fundamentais nas telas de welcome e autenticação, e nas funcionalidades de modularização, menu e locais
This commit is contained in:
parent
1feb33c699
commit
92174836d6
|
@ -15,10 +15,8 @@ class AuthenticationTest {
|
||||||
};
|
};
|
||||||
await _unlogged();
|
await _unlogged();
|
||||||
await $.pumpWidgetAndSettle(const App());
|
await $.pumpWidgetAndSettle(const App());
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
await _navigateToSignIn($);
|
await _navigateToSignIn($);
|
||||||
await _auth(credentials, $, throwsException);
|
await _auth(credentials, $, throwsException);
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -39,8 +37,6 @@ class AuthenticationTest {
|
||||||
await $.pumpWidgetAndSettle(const App());
|
await $.pumpWidgetAndSettle(const App());
|
||||||
await _navigateToSignIn($);
|
await _navigateToSignIn($);
|
||||||
await _auth(credentials, $, throwsException);
|
await _auth(credentials, $, throwsException);
|
||||||
|
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -89,7 +85,6 @@ class AuthenticationTest {
|
||||||
await $.pumpWidgetAndSettle(const App());
|
await $.pumpWidgetAndSettle(const App());
|
||||||
await _navigateToSignUp($);
|
await _navigateToSignUp($);
|
||||||
await _auth(credentials, $, throwsException);
|
await _auth(credentials, $, throwsException);
|
||||||
|
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
await Future.delayed(const Duration(milliseconds: 500));
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
@ -105,7 +100,6 @@ class AuthenticationTest {
|
||||||
|
|
||||||
await _logged();
|
await _logged();
|
||||||
await $.pumpWidget(const App());
|
await $.pumpWidget(const App());
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
|
|
||||||
await $.waitUntilVisible($(MenuStaggeredView));
|
await $.waitUntilVisible($(MenuStaggeredView));
|
||||||
|
|
||||||
|
@ -141,17 +135,23 @@ Future<void> _enterCredentials(
|
||||||
PatrolTester $,
|
PatrolTester $,
|
||||||
) async {
|
) async {
|
||||||
for (var entry in credentials.entries) {
|
for (var entry in credentials.entries) {
|
||||||
await $(ValueKey(entry.key)).enterText(entry.value);
|
await $(ValueKey(entry.key)) //
|
||||||
|
.waitUntilVisible()
|
||||||
|
.enterText(entry.value);
|
||||||
await $.pumpAndSettle();
|
await $.pumpAndSettle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _submit(
|
Future<void> _submit(
|
||||||
String key, PatrolTester $, PatrolFinder throwsException) async {
|
String key, PatrolTester $, PatrolFinder throwsException) async {
|
||||||
await $(ValueKey(key)).tap();
|
await $(ValueKey(key)) //
|
||||||
|
.waitUntilVisible()
|
||||||
|
.tap();
|
||||||
if ($(ValueKey('ThrowExceptionWidget')).exists) {
|
if ($(ValueKey('ThrowExceptionWidget')).exists) {
|
||||||
// expect(throwsException, findsOneWidget);
|
// expect(throwsException, findsOneWidget);
|
||||||
await $(ValueKey('ThrowExceptionWidget')).tap();
|
await $(ValueKey('ThrowExceptionWidget')) //
|
||||||
|
.waitUntilVisible()
|
||||||
|
.tap();
|
||||||
} else {
|
} else {
|
||||||
_navigateBackUsingSystemGesture();
|
_navigateBackUsingSystemGesture();
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,30 +17,33 @@ class LocalsTest {
|
||||||
$(#AsyncLocalProfileComponentWidget_InkWell);
|
$(#AsyncLocalProfileComponentWidget_InkWell);
|
||||||
expect(profileFinder, findsOneWidget);
|
expect(profileFinder, findsOneWidget);
|
||||||
|
|
||||||
await $(profileFinder).tap();
|
await $(profileFinder) //
|
||||||
await $.pump(const Duration(milliseconds: 500));
|
.waitUntilVisible()
|
||||||
|
.tap();
|
||||||
|
|
||||||
final PatrolFinder bottomSheetFinder =
|
final PatrolFinder bottomSheetFinder =
|
||||||
$(BottomArrowLinkedLocalsComponentWidget);
|
await $(BottomArrowLinkedLocalsComponentWidget) //
|
||||||
|
.waitUntilVisible();
|
||||||
expect(bottomSheetFinder, findsOneWidget);
|
expect(bottomSheetFinder, findsOneWidget);
|
||||||
|
|
||||||
await $.pump(const Duration(milliseconds: 500));
|
final PatrolFinder listViewFinder = await $(bottomSheetFinder) //
|
||||||
|
.$(ListView)
|
||||||
final PatrolFinder listViewFinder = $(bottomSheetFinder).$(ListView);
|
.waitUntilVisible();
|
||||||
expect(listViewFinder, findsOneWidget);
|
expect(listViewFinder, findsOneWidget);
|
||||||
|
|
||||||
await $.pump(const Duration(milliseconds: 500));
|
await $.pump(const Duration(milliseconds: 500));
|
||||||
|
|
||||||
final PatrolFinder entriesFinder =
|
final PatrolFinder entriesFinder = await $(listViewFinder) //
|
||||||
$(listViewFinder).$(CardItemTemplateComponentWidget);
|
.$(CardItemTemplateComponentWidget)
|
||||||
|
.waitUntilVisible();
|
||||||
expect(entriesFinder, findsWidgets);
|
expect(entriesFinder, findsWidgets);
|
||||||
|
|
||||||
if (entriesFinder.evaluate().isNotEmpty) {
|
if (entriesFinder.evaluate().isNotEmpty) {
|
||||||
await $.tap(entriesFinder.first);
|
await $(entriesFinder.first) //
|
||||||
|
.waitUntilVisible()
|
||||||
|
.tap();
|
||||||
await $.pumpAndSettle();
|
await $.pumpAndSettle();
|
||||||
}
|
}
|
||||||
|
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -54,7 +57,6 @@ class LocalsTest {
|
||||||
await _logged();
|
await _logged();
|
||||||
await $.pumpWidgetAndSettle(const App());
|
await $.pumpWidgetAndSettle(const App());
|
||||||
await $.waitUntilVisible($(MenuStaggeredView));
|
await $.waitUntilVisible($(MenuStaggeredView));
|
||||||
Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
|
|
||||||
final PatrolFinder gridView = await $(GridView) //
|
final PatrolFinder gridView = await $(GridView) //
|
||||||
.waitUntilVisible();
|
.waitUntilVisible();
|
||||||
|
@ -74,7 +76,9 @@ class LocalsTest {
|
||||||
final PatrolFinder unlinkButton = await $(Symbols.digital_out_of_home) //
|
final PatrolFinder unlinkButton = await $(Symbols.digital_out_of_home) //
|
||||||
.waitUntilVisible();
|
.waitUntilVisible();
|
||||||
expect(unlinkButton, findsOneWidget);
|
expect(unlinkButton, findsOneWidget);
|
||||||
await $(unlinkButton).tap();
|
await $(unlinkButton) //
|
||||||
|
.waitUntilVisible()
|
||||||
|
.tap();
|
||||||
|
|
||||||
final PatrolFinder alertDialog = await $(#AlertDialogKey) //
|
final PatrolFinder alertDialog = await $(#AlertDialogKey) //
|
||||||
.waitUntilVisible();
|
.waitUntilVisible();
|
||||||
|
@ -91,26 +95,19 @@ class LocalsTest {
|
||||||
await $(BottomArrowLinkedLocalsComponentWidget) //
|
await $(BottomArrowLinkedLocalsComponentWidget) //
|
||||||
.waitUntilVisible();
|
.waitUntilVisible();
|
||||||
|
|
||||||
await $.pump(const Duration(seconds: 1));
|
|
||||||
expect(bottomSheetFinder, findsOneWidget);
|
expect(bottomSheetFinder, findsOneWidget);
|
||||||
await $.pump(const Duration(seconds: 1));
|
|
||||||
|
|
||||||
await $.pump(const Duration(seconds: 1));
|
|
||||||
final PatrolFinder listViewFinder = await $(bottomSheetFinder) //
|
final PatrolFinder listViewFinder = await $(bottomSheetFinder) //
|
||||||
.$(ListView)
|
.$(ListView)
|
||||||
.waitUntilVisible();
|
.waitUntilVisible();
|
||||||
|
|
||||||
expect(listViewFinder, findsOneWidget);
|
expect(listViewFinder, findsOneWidget);
|
||||||
|
|
||||||
await $.pump(const Duration(seconds: 1));
|
|
||||||
|
|
||||||
final PatrolFinder entriesFinder = await $(listViewFinder)
|
final PatrolFinder entriesFinder = await $(listViewFinder)
|
||||||
.$(CardItemTemplateComponentWidget)
|
.$(CardItemTemplateComponentWidget)
|
||||||
.waitUntilVisible();
|
.waitUntilVisible();
|
||||||
|
|
||||||
expect(entriesFinder, findsWidgets);
|
expect(entriesFinder, findsWidgets);
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
return;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
patrolWidgetTest(
|
patrolWidgetTest(
|
||||||
|
|
|
@ -43,7 +43,6 @@ class MenuTest {
|
||||||
await $(entriesFinder.first) //
|
await $(entriesFinder.first) //
|
||||||
.waitUntilVisible()
|
.waitUntilVisible()
|
||||||
.tap(settlePolicy: SettlePolicy.noSettle);
|
.tap(settlePolicy: SettlePolicy.noSettle);
|
||||||
// await $.pumpAndSettle();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await $.waitUntilVisible($(MenuStaggeredView));
|
await $.waitUntilVisible($(MenuStaggeredView));
|
||||||
|
@ -58,8 +57,9 @@ class MenuTest {
|
||||||
.map((entry) => entry.name)
|
.map((entry) => entry.name)
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
final LinkedHashMap<String, String> routesTitles =
|
final LinkedHashMap<String, String> routesTitles = LinkedHashMap //
|
||||||
LinkedHashMap.fromIterables(routes, titles);
|
.fromIterables(routes, titles);
|
||||||
|
|
||||||
late String route;
|
late String route;
|
||||||
late String title;
|
late String title;
|
||||||
|
|
||||||
|
@ -79,10 +79,10 @@ class MenuTest {
|
||||||
if (route == '/packageOrder') continue;
|
if (route == '/packageOrder') continue;
|
||||||
if (route == '/provisionalHistoryPage') continue;
|
if (route == '/provisionalHistoryPage') continue;
|
||||||
if (route == '/scheduleCompleteVisitPage') continue;
|
if (route == '/scheduleCompleteVisitPage') continue;
|
||||||
|
if (route == '/preferencesSettings') continue;
|
||||||
|
|
||||||
ff.navigatorKey.currentContext!.go(route);
|
ff.navigatorKey.currentContext!.go(route);
|
||||||
|
|
||||||
Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
final PatrolFinder appBar = await $(AppBar) //
|
final PatrolFinder appBar = await $(AppBar) //
|
||||||
.waitUntilExists();
|
.waitUntilExists();
|
||||||
final PatrolFinder titleAppBar = await appBar //
|
final PatrolFinder titleAppBar = await appBar //
|
||||||
|
@ -90,7 +90,6 @@ class MenuTest {
|
||||||
.waitUntilVisible();
|
.waitUntilVisible();
|
||||||
expect(titleAppBar, findsOneWidget);
|
expect(titleAppBar, findsOneWidget);
|
||||||
}
|
}
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -104,12 +103,12 @@ class MenuTest {
|
||||||
|
|
||||||
await _logged();
|
await _logged();
|
||||||
await $.pumpWidgetAndSettle(const App());
|
await $.pumpWidgetAndSettle(const App());
|
||||||
await $.waitUntilVisible($(MenuStaggeredView));
|
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
|
||||||
|
|
||||||
await $.waitUntilVisible($(MenuStaggeredView));
|
await $.waitUntilVisible($(MenuStaggeredView));
|
||||||
await $.waitUntilVisible($(GridView));
|
await $.waitUntilVisible($(GridView));
|
||||||
final PatrolFinder gridEntries = $(GridView).$(ButtonMenuItem);
|
final PatrolFinder gridEntries = await $(GridView) //
|
||||||
|
.$(ButtonMenuItem)
|
||||||
|
.waitUntilVisible();
|
||||||
expect(gridEntries, findsWidgets);
|
expect(gridEntries, findsWidgets);
|
||||||
|
|
||||||
final List<String?> menuKeys = gridEntries
|
final List<String?> menuKeys = gridEntries
|
||||||
|
@ -133,7 +132,6 @@ class MenuTest {
|
||||||
.toList();
|
.toList();
|
||||||
await $.pumpAndSettle();
|
await $.pumpAndSettle();
|
||||||
expect(entriesKey, containsAll(menuKeys));
|
expect(entriesKey, containsAll(menuKeys));
|
||||||
await Future.delayed(const Duration(milliseconds: 500));
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -145,17 +143,19 @@ class MenuTest {
|
||||||
|
|
||||||
await _logged();
|
await _logged();
|
||||||
await $.pumpWidgetAndSettle(const App());
|
await $.pumpWidgetAndSettle(const App());
|
||||||
await $.waitUntilVisible($(MenuStaggeredView));
|
|
||||||
await Future.delayed(const Duration(seconds: 1));
|
|
||||||
|
|
||||||
await $.waitUntilVisible($(MenuStaggeredView));
|
await $.waitUntilVisible($(MenuStaggeredView));
|
||||||
await $.waitUntilVisible($(GridView));
|
await $.waitUntilVisible($(GridView));
|
||||||
final PatrolFinder gridEntries = $(GridView).$(ButtonMenuItem);
|
final PatrolFinder gridEntries = await $(GridView) //
|
||||||
|
.$(ButtonMenuItem)
|
||||||
|
.waitUntilVisible();
|
||||||
expect(gridEntries, findsWidgets);
|
expect(gridEntries, findsWidgets);
|
||||||
|
|
||||||
await $(Icons.menu_rounded).waitUntilVisible().tap();
|
await $(Icons.menu_rounded).waitUntilVisible().tap();
|
||||||
await $.waitUntilVisible($(ListView));
|
await $.waitUntilVisible($(ListView));
|
||||||
final PatrolFinder listEntries = $(ListView).$(CardMenuItem);
|
final PatrolFinder listEntries = await $(ListView) //
|
||||||
|
.$(CardMenuItem)
|
||||||
|
.waitUntilVisible();
|
||||||
expect(listEntries, findsWidgets);
|
expect(listEntries, findsWidgets);
|
||||||
|
|
||||||
final List<String?> menuKeys = listEntries
|
final List<String?> menuKeys = listEntries
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
import 'dart:isolate';
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart';
|
import 'package:hub/components/templates_components/change_passs_qr_code_pass_key_template_component/change_pass_widget.dart';
|
||||||
import 'package:hub/features/auth/index.dart';
|
import 'package:hub/features/auth/index.dart';
|
||||||
import 'package:hub/features/backend/index.dart';
|
import 'package:hub/features/backend/index.dart';
|
||||||
|
import 'package:hub/features/local/index.dart';
|
||||||
import 'package:hub/features/storage/index.dart';
|
import 'package:hub/features/storage/index.dart';
|
||||||
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
import 'package:hub/flutter_flow/flutter_flow_util.dart';
|
||||||
import 'package:hub/flutter_flow/nav/nav.dart';
|
import 'package:hub/flutter_flow/nav/nav.dart';
|
||||||
import 'package:hub/features/local/index.dart';
|
|
||||||
|
|
||||||
import 'package:hub/shared/utils/path_util.dart';
|
import 'package:hub/shared/utils/path_util.dart';
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue