This commit is contained in:
J. A. Messias 2025-01-29 16:04:57 -03:00
parent 3a3c0d74f4
commit a595e86444
3 changed files with 18 additions and 18 deletions

View File

@ -43,7 +43,7 @@ class AuthenticationTest {
final credentials = fuzzer.fuzz(concat); final credentials = fuzzer.fuzz(concat);
await _unlogged($); await _unlogged();
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
await _navigateToSignIn($); await _navigateToSignIn($);
@ -72,7 +72,7 @@ class AuthenticationTest {
'passwordTextFormField': '12345678', 'passwordTextFormField': '12345678',
}; };
await _unlogged($); await _unlogged();
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
await _navigateToSignIn($); await _navigateToSignIn($);
await _auth(credentials, $, throwsException); await _auth(credentials, $, throwsException);
@ -94,7 +94,7 @@ class AuthenticationTest {
'emailTextFormField': 'email_app@exemplo.com', 'emailTextFormField': 'email_app@exemplo.com',
'passwordTextFormField': '12345678', 'passwordTextFormField': '12345678',
}; };
await _unlogged($); await _unlogged();
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
await _navigateToSignUp($); await _navigateToSignUp($);
await _auth(credentials, $, throwsException); await _auth(credentials, $, throwsException);
@ -151,7 +151,7 @@ class AuthenticationTest {
final credentials = fuzzer.fuzz(concat); final credentials = fuzzer.fuzz(concat);
await _unlogged($); await _unlogged();
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
@ -177,7 +177,7 @@ class AuthenticationTest {
$.tester.printToConsole( $.tester.printToConsole(
'Authentication Test - Sign-Out: Deslogar da Conta'); 'Authentication Test - Sign-Out: Deslogar da Conta');
await _loggedWithMultiLocalsAccount($); await _loggedWithMultiLocalsAccount();
await $.pumpWidget(const App()); await $.pumpWidget(const App());
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));
@ -197,7 +197,7 @@ class AuthenticationTest {
static void recovery() async { static void recovery() async {
patrol('Open url in the app', ($) async { patrol('Open url in the app', ($) async {
await _loggedWithMultiLocalsAccount($); await _loggedWithMultiLocalsAccount();
await $.pumpWidget(const App()); await $.pumpWidget(const App());
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));

View File

@ -52,7 +52,7 @@ class LocalsTest {
$ = tester; $ = tester;
$.tester.printToConsole('Locals Test - Selecionar um local disponível'); $.tester.printToConsole('Locals Test - Selecionar um local disponível');
await _loggedWithSomeoneLocalAccount($, false); await _loggedWithSomeoneLocalAccount(false);
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));
await $.waitUntilVisible($(LocalProfileComponentWidget)); await $.waitUntilVisible($(LocalProfileComponentWidget));
@ -191,7 +191,7 @@ class LocalsTest {
$.tester.printToConsole( $.tester.printToConsole(
'Locals Test - Desvincular do local selecionado com multiplos locais disponiveis'); 'Locals Test - Desvincular do local selecionado com multiplos locais disponiveis');
await _loggedWithSomeoneLocalAccount($); await _loggedWithSomeoneLocalAccount();
await $.pumpWidgetAndSettle(const App()); await $.pumpWidgetAndSettle(const App());
await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(MenuStaggeredView));
@ -253,7 +253,7 @@ class LocalsTest {
$ = tester; $ = tester;
$.tester.printToConsole('Locals Test - Vincular um local desvinculado'); $.tester.printToConsole('Locals Test - Vincular um local desvinculado');
await _loggedWithSomeoneLocalAccount($, false); await _loggedWithSomeoneLocalAccount(false);
await $.pumpWidget(const App()); await $.pumpWidget(const App());
final PatrolFinder bottomSheetFinder = final PatrolFinder bottomSheetFinder =
@ -306,7 +306,7 @@ class LocalsTest {
'Selecionar um local disponível com multíplos locais disponíveis', // 'Selecionar um local disponível com multíplos locais disponíveis', //
(PatrolTester tester) async { (PatrolTester tester) async {
$ = tester; $ = tester;
await _loggedWithMultiLocalsAccount($); await _loggedWithMultiLocalsAccount();
await $.pumpWidget(const App()); await $.pumpWidget(const App());
late Map<String, String> credentials; late Map<String, String> credentials;
final PatrolFinder throwsException = $(''); final PatrolFinder throwsException = $('');
@ -341,7 +341,7 @@ class LocalsTest {
'Selecionar um local disponível com somente um local disponível', // 'Selecionar um local disponível com somente um local disponível', //
(PatrolTester tester) async { (PatrolTester tester) async {
$ = tester; $ = tester;
await _loggedWithSomeoneLocalAccount($); await _loggedWithSomeoneLocalAccount();
await $.pumpWidget(const App()); await $.pumpWidget(const App());
late Map<String, String> credentials; late Map<String, String> credentials;
final PatrolFinder throwsException = $(''); final PatrolFinder throwsException = $('');

View File

@ -1,8 +1,8 @@
part of 'app_test.dart'; part of 'app_test.dart';
Future<void> _loggedWithMultiLocalsAccount(PatrolTester $, Future<void> _loggedWithMultiLocalsAccount(
[bool forceLinkedLocal = true]) async { [bool forceLinkedLocal = true]) async {
await _init($); await _init();
await StorageHelper() // await StorageHelper() //
.set(SecureStorageKey.isLogged.value, 'true'); .set(SecureStorageKey.isLogged.value, 'true');
await StorageHelper() // await StorageHelper() //
@ -29,9 +29,9 @@ Future<void> _loggedWithMultiLocalsAccount(PatrolTester $,
} }
} }
Future<void> _loggedWithSomeoneLocalAccount(PatrolTester $, Future<void> _loggedWithSomeoneLocalAccount(
[bool forceLinkedLocal = true]) async { [bool forceLinkedLocal = true]) async {
await _init($); await _init();
await StorageHelper() // await StorageHelper() //
.set(SecureStorageKey.isLogged.value, 'true'); .set(SecureStorageKey.isLogged.value, 'true');
await StorageHelper() // await StorageHelper() //
@ -58,8 +58,8 @@ Future<void> _loggedWithSomeoneLocalAccount(PatrolTester $,
} }
} }
Future<void> _unlogged(PatrolTester $) async { Future<void> _unlogged() async {
await _init($); await _init();
await StorageHelper() // await StorageHelper() //
.set(SecureStorageKey.isLogged.value, 'false'); .set(SecureStorageKey.isLogged.value, 'false');
await StorageHelper() // await StorageHelper() //
@ -78,7 +78,7 @@ Future<void> _unlogged(PatrolTester $) async {
.set(LocalsStorageKey.isNewVersion.key, true); .set(LocalsStorageKey.isNewVersion.key, true);
} }
Future<void> _init(PatrolTester $) async { Future<void> _init() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await _initializeTracking(); await _initializeTracking();
await _initializeStorage(); await _initializeStorage();