From 1b06c57ef2295a4cd1b9a3864c2cd3be50801d6e Mon Sep 17 00:00:00 2001 From: "J. A. Messias" Date: Wed, 29 Jan 2025 15:37:06 -0300 Subject: [PATCH] WIP --- integration_test/app_test.dart | 3 +- integration_test/auth_test.dart | 58 +++++++++--------- integration_test/common.dart | 3 +- integration_test/locals_test.dart | 63 +++++++------------- integration_test/menu_test.dart | 94 +++++++++++------------------- integration_test/module_test.dart | 27 +++------ integration_test/utils_test.dart | 17 +++--- integration_test/welcome_test.dart | 8 +-- 8 files changed, 107 insertions(+), 166 deletions(-) diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index b234bcdc..e242bdd3 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -29,6 +29,7 @@ import 'package:integration_test/integration_test.dart'; import 'package:material_symbols_icons/symbols.dart'; import 'package:patrol/patrol.dart'; import 'package:flutter_web_plugins/url_strategy.dart'; +import 'package:patrol_finders/patrol_finders.dart'; import 'app_test.dart'; import 'fuzzer/fuzzer.dart'; @@ -50,7 +51,7 @@ part 'storage_test.dart'; part 'utils_test.dart'; part 'welcome_test.dart'; -late PatrolIntegrationTester $; +late PatrolTester $; void main() { //init integration test diff --git a/integration_test/auth_test.dart b/integration_test/auth_test.dart index e18a3916..241e84f5 100644 --- a/integration_test/auth_test.dart +++ b/integration_test/auth_test.dart @@ -2,9 +2,9 @@ part of 'app_test.dart'; class AuthenticationTest { static Future signIn() async { - patrol( + patrolWidgetTest( 'Sign-In with fuzzed emails', - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Authentication Test - Sign-In with fuzzed emails'); final PatrolFinder throwsException = $(Dialog).$(ThrowExceptionWidget); @@ -57,9 +57,9 @@ class AuthenticationTest { }, ); - patrol( + patrolWidgetTest( 'Sign-In with email_app@exemplo.com', - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Authentication Test - Sign-In with email_app@exemplo.com'); @@ -78,9 +78,9 @@ class AuthenticationTest { } static Future signUp() async { - patrol( + patrolWidgetTest( 'Sign Up - credenciais já registradas', - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Authentication Test - Sign-Up: credenciais já registradas'); @@ -98,9 +98,9 @@ class AuthenticationTest { }, ); - patrol( + patrolWidgetTest( 'Sign Up - credenciais novas', - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Authentication Test - Sign-Up: credenciais novas'); @@ -164,9 +164,9 @@ class AuthenticationTest { } static Future signOut() async { - patrol( + patrolWidgetTest( 'Deslogar da Conta', - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Authentication Test - Sign-Out: Deslogar da Conta'); @@ -187,31 +187,31 @@ class AuthenticationTest { } static void recovery() async { - patrol('Open url in the app', ($) async { - await _loggedWithMultiLocalsAccount($); - await $.pumpWidget(const App()); + // patrolWidgetTest('Open url in the app', ($) async { + // await _loggedWithMultiLocalsAccount($); + // await $.pumpWidget(const App()); - await $.waitUntilVisible($(MenuStaggeredView)); + // await $.waitUntilVisible($(MenuStaggeredView)); - // await $.native.pressHome(); - // final String browserId = 'com.android.chrome'; - // await $.native.openApp(appId: browserId); - await $.native.openUrl(// - 'https://freaccess.com.br/freaccess/alterarSenha.php?email=freaccesshub@gmail.com&token=67939240e12c31.10412525'); + // // await $.native.pressHome(); + // // final String browserId = 'com.android.chrome'; + // // await $.native.openApp(appId: browserId); + // await $.native.openUrl(// + // 'https://freaccess.com.br/freaccess/alterarSenha.php?email=freaccesshub@gmail.com&token=67939240e12c31.10412525'); - await $.pumpAndSettle(); - Future.delayed(Duration(seconds: 3)); - await $.pump(Duration(seconds: 3)); - await $.pumpAndSettle(); - final PatrolFinder forgotPassword = await $(#ForgotPasswordScreen).waitUntilVisible(); - expect(forgotPassword, findsOneWidget); - }); + // await $.pumpAndSettle(); + // Future.delayed(Duration(seconds: 3)); + // await $.pump(Duration(seconds: 3)); + // await $.pumpAndSettle(); + // final PatrolFinder forgotPassword = await $(#ForgotPasswordScreen).waitUntilVisible(); + // expect(forgotPassword, findsOneWidget); + // }); } } Future _auth( Map credentials, - PatrolIntegrationTester $, + PatrolTester $, PatrolFinder throwsException, ) async { await _enterCredentials(credentials, $); @@ -220,7 +220,7 @@ Future _auth( Future _enterCredentials( Map credentials, - PatrolIntegrationTester $, + PatrolTester $, ) async { for (var entry in credentials.entries) { await $(ValueKey(entry.key)) // @@ -230,7 +230,7 @@ Future _enterCredentials( } } -Future _submit(String key, PatrolIntegrationTester $, PatrolFinder throwsException) async { +Future _submit(String key, PatrolTester $, PatrolFinder throwsException) async { await $(ValueKey(key)) // .waitUntilVisible() .tap(); diff --git a/integration_test/common.dart b/integration_test/common.dart index 87825994..295d56bc 100644 --- a/integration_test/common.dart +++ b/integration_test/common.dart @@ -16,8 +16,7 @@ void patrol( bool? skip, List tags = const [], NativeAutomatorConfig? nativeAutomatorConfig, - LiveTestWidgetsFlutterBindingFramePolicy framePolicy = - LiveTestWidgetsFlutterBindingFramePolicy.fadePointers, + LiveTestWidgetsFlutterBindingFramePolicy framePolicy = LiveTestWidgetsFlutterBindingFramePolicy.fadePointers, }) { patrolTest( description, diff --git a/integration_test/locals_test.dart b/integration_test/locals_test.dart index 50c9cb3c..a7337e20 100644 --- a/integration_test/locals_test.dart +++ b/integration_test/locals_test.dart @@ -46,9 +46,9 @@ class LocalsTest { // } // }, // ); - patrol( + patrolWidgetTest( 'Selecionar um local disponível com somente um local disponivel', // - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Locals Test - Selecionar um local disponível'); @@ -57,8 +57,7 @@ class LocalsTest { await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(LocalProfileComponentWidget)); - final PatrolFinder profileFinder = - $(#AsyncLocalProfileComponentWidget_InkWell); + final PatrolFinder profileFinder = $(#AsyncLocalProfileComponentWidget_InkWell); expect(profileFinder, findsOneWidget); await $(profileFinder) // @@ -184,12 +183,10 @@ class LocalsTest { // // } // }, // ); - patrol( - 'Desvincular do local selecionado com somente um local disponivel', // - (PatrolIntegrationTester tester) async { + patrolWidgetTest('Desvincular do local selecionado com somente um local disponivel', // + (PatrolTester tester) async { $ = tester; - $.tester.printToConsole( - 'Locals Test - Desvincular do local selecionado com multiplos locais disponiveis'); + $.tester.printToConsole('Locals Test - Desvincular do local selecionado com multiplos locais disponiveis'); await _loggedWithSomeoneLocalAccount($); await $.pumpWidgetAndSettle(const App()); @@ -228,9 +225,8 @@ class LocalsTest { await $.pump(const Duration(seconds: 1)); await $.pump(); - final PatrolFinder bottomSheetFinder = - await $(BottomArrowLinkedLocalsComponentWidget) // - .waitUntilVisible(); + final PatrolFinder bottomSheetFinder = await $(BottomArrowLinkedLocalsComponentWidget) // + .waitUntilVisible(); expect(bottomSheetFinder, findsOneWidget); @@ -240,25 +236,22 @@ class LocalsTest { expect(listViewFinder, findsOneWidget); - final PatrolFinder entriesFinder = await $(listViewFinder) - .$(CardItemTemplateComponentWidget) - .waitUntilVisible(); + final PatrolFinder entriesFinder = await $(listViewFinder).$(CardItemTemplateComponentWidget).waitUntilVisible(); expect(entriesFinder, findsWidgets); }); - patrol( + patrolWidgetTest( 'Vincular um local desvinculado com somente um local disponivel', // - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Locals Test - Vincular um local desvinculado'); await _loggedWithSomeoneLocalAccount($, false); await $.pumpWidget(const App()); - final PatrolFinder bottomSheetFinder = - await $(BottomArrowLinkedLocalsComponentWidget) // - .waitUntilVisible(); + final PatrolFinder bottomSheetFinder = await $(BottomArrowLinkedLocalsComponentWidget) // + .waitUntilVisible(); expect(bottomSheetFinder, findsOneWidget); await $.pump(const Duration(milliseconds: 500)); @@ -302,9 +295,9 @@ class LocalsTest { } static Future attachLocal() async { - patrol( + patrolWidgetTest( 'Selecionar um local disponível com multíplos locais disponíveis', // - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; await _loggedWithMultiLocalsAccount($); await $.pumpWidget(const App()); @@ -314,19 +307,12 @@ class LocalsTest { var name = ff.randomString(7, 7, true, true, true); var email = '$name@example.com'; var password = '12345678'; - credentials = { - 'nameTextFormField': name, - 'emailTextFormField': email, - 'passwordTextFormField': password - }; + credentials = {'nameTextFormField': name, 'emailTextFormField': email, 'passwordTextFormField': password}; await $.pumpWidget(const App()); await _navigateToSignUp($); await _auth(credentials, $, throwsException); - credentials = { - 'emailTextFormField': email, - 'passwordTextFormField': password - }; + credentials = {'emailTextFormField': email, 'passwordTextFormField': password}; await _auth(credentials, $, throwsException); await $.pumpAndSettle(); @@ -337,9 +323,9 @@ class LocalsTest { return; }, ); - patrol( + patrolWidgetTest( 'Selecionar um local disponível com somente um local disponível', // - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; await _loggedWithSomeoneLocalAccount($); await $.pumpWidget(const App()); @@ -349,19 +335,12 @@ class LocalsTest { var name = ff.randomString(7, 7, true, true, true); var email = '$name@example.com'; var password = '12345678'; - credentials = { - 'nameTextFormField': name, - 'emailTextFormField': email, - 'passwordTextFormField': password - }; + credentials = {'nameTextFormField': name, 'emailTextFormField': email, 'passwordTextFormField': password}; await $.pumpWidget(const App()); await _navigateToSignUp($); await _auth(credentials, $, throwsException); - credentials = { - 'emailTextFormField': email, - 'passwordTextFormField': password - }; + credentials = {'emailTextFormField': email, 'passwordTextFormField': password}; await _auth(credentials, $, throwsException); await $.pumpAndSettle(); diff --git a/integration_test/menu_test.dart b/integration_test/menu_test.dart index 1dd315d1..28c3c125 100644 --- a/integration_test/menu_test.dart +++ b/integration_test/menu_test.dart @@ -2,13 +2,12 @@ part of 'app_test.dart'; class MenuTest { static Future labels2AppbarConsistency() async { - patrol( + patrolWidgetTest( 'As labels dos menuItems correspondem aos títulos das AppBars? (MultiLocais)', // - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; - $.tester.printToConsole( - 'Menu Test - As labels dos menuItems correspondem aos títulos das AppBars?'); + $.tester.printToConsole('Menu Test - As labels dos menuItems correspondem aos títulos das AppBars?'); await _loggedWithMultiLocalsAccount($); await $.pumpWidgetAndSettle(const App()); @@ -16,18 +15,15 @@ class MenuTest { await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(LocalProfileComponentWidget)); - final PatrolFinder profileFinder = - await $(#AsyncLocalProfileComponentWidget_InkWell) - .waitUntilVisible(); + final PatrolFinder profileFinder = await $(#AsyncLocalProfileComponentWidget_InkWell).waitUntilVisible(); expect(profileFinder, findsOneWidget); await $(profileFinder) // .waitUntilVisible() .tap(); - final PatrolFinder bottomSheetFinder = - await $(BottomArrowLinkedLocalsComponentWidget) // - .waitUntilVisible(); + final PatrolFinder bottomSheetFinder = await $(BottomArrowLinkedLocalsComponentWidget) // + .waitUntilVisible(); expect(bottomSheetFinder, findsOneWidget); final PatrolFinder listViewFinder = await $(bottomSheetFinder) // @@ -49,14 +45,10 @@ class MenuTest { await $.waitUntilVisible($(MenuStaggeredView)); await $.waitUntilVisible($(LocalProfileComponentWidget)); - final List routes = MenuEntry.entries - .where((entry) => entry.key != 'FRE-HUB-LOGOUT') - .map((entry) => entry.route) - .toList(); - final List titles = MenuEntry.entries - .where((entry) => entry.key != 'FRE-HUB-LOGOUT') - .map((entry) => entry.name) - .toList(); + final List routes = + MenuEntry.entries.where((entry) => entry.key != 'FRE-HUB-LOGOUT').map((entry) => entry.route).toList(); + final List titles = + MenuEntry.entries.where((entry) => entry.key != 'FRE-HUB-LOGOUT').map((entry) => entry.name).toList(); final LinkedHashMap routesTitles = LinkedHashMap // .fromIterables(routes, titles); @@ -96,9 +88,9 @@ class MenuTest { } static Future containEntries() async { - patrol( + patrolWidgetTest( 'HomeMenu contém seus itens? (MultiLocais)', // - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Menu Test - HomeMenu contém seus itens?'); @@ -127,17 +119,15 @@ class MenuTest { await $.pumpAndSettle(); final List entries = MenuEntry.entries; await $.pumpAndSettle(); - final List entriesKey = entries - .where((entry) => entry.types.contains(MenuEntryType.Home)) - .map((entry) => entry.key) - .toList(); + final List entriesKey = + entries.where((entry) => entry.types.contains(MenuEntryType.Home)).map((entry) => entry.key).toList(); await $.pumpAndSettle(); expect(entriesKey, containsAll(menuKeys)); }, ); - patrol( + patrolWidgetTest( 'HomeMenu contém seus itens? (MonoLocal)', // - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Menu Test - HomeMenu contém seus itens?'); @@ -166,18 +156,16 @@ class MenuTest { await $.pumpAndSettle(); final List entries = MenuEntry.entries; await $.pumpAndSettle(); - final List entriesKey = entries - .where((entry) => entry.types.contains(MenuEntryType.Home)) - .map((entry) => entry.key) - .toList(); + final List entriesKey = + entries.where((entry) => entry.types.contains(MenuEntryType.Home)).map((entry) => entry.key).toList(); await $.pumpAndSettle(); expect(entriesKey, containsAll(menuKeys)); }, ); - patrol( + patrolWidgetTest( 'DrawerMenu contém seus itens? (MultiLocais)', // - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Menu Test - DrawerMenu contém seus itens?'); @@ -213,18 +201,16 @@ class MenuTest { await $.pumpAndSettle(); final List entries = MenuEntry.entries; await $.pumpAndSettle(); - final List entriesKey = entries - .where((entry) => entry.types.contains(MenuEntryType.Drawer)) - .map((entry) => entry.key) - .toList(); + final List entriesKey = + entries.where((entry) => entry.types.contains(MenuEntryType.Drawer)).map((entry) => entry.key).toList(); await $.pumpAndSettle(); expect(entriesKey, containsAll(menuKeys)); await Future.delayed(const Duration(milliseconds: 500)); }, ); - patrol( + patrolWidgetTest( 'DrawerMenu contém seus itens? (MonoLocal)', // - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Menu Test - DrawerMenu contém seus itens?'); @@ -260,10 +246,8 @@ class MenuTest { await $.pumpAndSettle(); final List entries = MenuEntry.entries; await $.pumpAndSettle(); - final List entriesKey = entries - .where((entry) => entry.types.contains(MenuEntryType.Drawer)) - .map((entry) => entry.key) - .toList(); + final List entriesKey = + entries.where((entry) => entry.types.contains(MenuEntryType.Drawer)).map((entry) => entry.key).toList(); await $.pumpAndSettle(); expect(entriesKey, containsAll(menuKeys)); await Future.delayed(const Duration(milliseconds: 500)); @@ -272,9 +256,9 @@ class MenuTest { } static Future navToEntries() async { - patrol( + patrolWidgetTest( 'Navegação entre items do Menu (MultiLocais)', - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Menu Test - Navegação entre items do Menu'); @@ -282,17 +266,12 @@ class MenuTest { await $.pumpWidgetAndSettle(const App()); await $.waitUntilVisible($(MenuStaggeredView)); - final PatrolFinder profile = - $(const Key('AsyncLocalProfileComponentWidget_InkWell')); - await $(profile) - .waitUntilVisible() - .tap(settlePolicy: SettlePolicy.noSettle); + final PatrolFinder profile = $(const Key('AsyncLocalProfileComponentWidget_InkWell')); + await $(profile).waitUntilVisible().tap(settlePolicy: SettlePolicy.noSettle); await $.waitUntilVisible($(BottomArrowLinkedLocalsComponentWidget)); final PatrolFinder local = $('FRE ACCESS DEMO'); - await $(local) - .waitUntilVisible() - .tap(settlePolicy: SettlePolicy.noSettle); + await $(local).waitUntilVisible().tap(settlePolicy: SettlePolicy.noSettle); await $.waitUntilVisible($(MenuStaggeredView)); @@ -321,8 +300,7 @@ class MenuTest { timeout: Duration(seconds: 1), ); - final ButtonMenuItem entry = - $.tester.widget(gridEntries.at(i)); + final ButtonMenuItem entry = $.tester.widget(gridEntries.at(i)); final Key? widgetKey = entry.key; expect(widgetKey, isNotNull); @@ -332,18 +310,14 @@ class MenuTest { if (widgetKey == ValueKey('FRE-HUB-RESERVATIONS')) continue; if (widgetKey == ValueKey('FRE-HUB-SETTINGS')) continue; - await $(gridEntries.at(i)) - .waitUntilVisible(timeout: const Duration(seconds: 1)) - .tap( + await $(gridEntries.at(i)).waitUntilVisible(timeout: const Duration(seconds: 1)).tap( settleTimeout: const Duration(seconds: 1), settlePolicy: SettlePolicy.noSettle, ); await $.pumpAndSettle(duration: Duration(milliseconds: 500)); - await $(Icons.keyboard_arrow_left) - .waitUntilVisible(timeout: const Duration(seconds: 1)) - .tap( + await $(Icons.keyboard_arrow_left).waitUntilVisible(timeout: const Duration(seconds: 1)).tap( settleTimeout: const Duration(seconds: 1), settlePolicy: SettlePolicy.noSettle, ); diff --git a/integration_test/module_test.dart b/integration_test/module_test.dart index 80c0aa4b..10556084 100644 --- a/integration_test/module_test.dart +++ b/integration_test/module_test.dart @@ -2,11 +2,9 @@ part of 'app_test.dart'; class ModularizationTest { static Future containLicense() async { - patrol('Os modulos de licença está sendo processados? (MultiLocais)', - (PatrolIntegrationTester tester) async { + patrolWidgetTest('Os modulos de licença está sendo processados? (MultiLocais)', (PatrolTester tester) async { $ = tester; - $.tester.printToConsole( - 'Modularization Test - Os modulos de licença está sendo processados?'); + $.tester.printToConsole('Modularization Test - Os modulos de licença está sendo processados?'); await _loggedWithMultiLocalsAccount($); await $.pumpWidgetAndSettle(const App()); @@ -27,11 +25,9 @@ class ModularizationTest { return; }); - patrol('Os modulos de licença está sendo processados? (MonoLocal)', - (PatrolIntegrationTester tester) async { + patrolWidgetTest('Os modulos de licença está sendo processados? (MonoLocal)', (PatrolTester tester) async { $ = tester; - $.tester.printToConsole( - 'Modularization Test - Os modulos de licença está sendo processados?'); + $.tester.printToConsole('Modularization Test - Os modulos de licença está sendo processados?'); await _loggedWithSomeoneLocalAccount($); await $.pumpWidgetAndSettle(const App()); @@ -55,9 +51,9 @@ class ModularizationTest { } static Future switchLicense() async { - patrol( + patrolWidgetTest( 'Licença está sendo atualizada?', - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Licença está sendo atualizada?'); @@ -66,17 +62,12 @@ class ModularizationTest { await $.pumpWidgetAndSettle(const App()); await $.waitUntilVisible($(MenuStaggeredView)); - final PatrolFinder profile = - $(const Key('AsyncLocalProfileComponentWidget_InkWell')); - await $(profile) - .waitUntilVisible() - .tap(settlePolicy: SettlePolicy.noSettle); + final PatrolFinder profile = $(const Key('AsyncLocalProfileComponentWidget_InkWell')); + await $(profile).waitUntilVisible().tap(settlePolicy: SettlePolicy.noSettle); await $.waitUntilVisible($(BottomArrowLinkedLocalsComponentWidget)); final PatrolFinder local = $('FRE ACCESS DEMO'); - await $(local) - .waitUntilVisible() - .tap(settlePolicy: SettlePolicy.trySettle); + await $(local).waitUntilVisible().tap(settlePolicy: SettlePolicy.trySettle); }, ); } diff --git a/integration_test/utils_test.dart b/integration_test/utils_test.dart index 309c0923..c60cf29d 100644 --- a/integration_test/utils_test.dart +++ b/integration_test/utils_test.dart @@ -1,7 +1,6 @@ part of 'app_test.dart'; -Future _loggedWithMultiLocalsAccount(PatrolIntegrationTester $, - [bool forceLinkedLocal = true]) async { +Future _loggedWithMultiLocalsAccount(PatrolTester $, [bool forceLinkedLocal = true]) async { await _init($); await StorageHelper() // .set(SecureStorageKey.isLogged.value, 'true'); @@ -29,8 +28,7 @@ Future _loggedWithMultiLocalsAccount(PatrolIntegrationTester $, } } -Future _loggedWithSomeoneLocalAccount(PatrolIntegrationTester $, - [bool forceLinkedLocal = true]) async { +Future _loggedWithSomeoneLocalAccount(PatrolTester $, [bool forceLinkedLocal = true]) async { await _init($); await StorageHelper() // .set(SecureStorageKey.isLogged.value, 'true'); @@ -58,7 +56,7 @@ Future _loggedWithSomeoneLocalAccount(PatrolIntegrationTester $, } } -Future _unlogged(PatrolIntegrationTester $) async { +Future _unlogged(PatrolTester $) async { await _init($); await StorageHelper() // .set(SecureStorageKey.isLogged.value, 'false'); @@ -78,7 +76,7 @@ Future _unlogged(PatrolIntegrationTester $) async { .set(LocalsStorageKey.isNewVersion.key, true); } -Future _init(PatrolIntegrationTester $) async { +Future _init(PatrolTester $) async { WidgetsFlutterBinding.ensureInitialized(); await _initializeTracking(); await _initializeStorage(); @@ -90,19 +88,18 @@ Future _init(PatrolIntegrationTester $) async { await _initializeNav(); } -Future _navigateToSignIn(PatrolIntegrationTester $) async { +Future _navigateToSignIn(PatrolTester $) async { final signInButton = $(#toggleSignInPage).waitUntilVisible(); await signInButton.tap(); } -Future _navigateToSignUp(PatrolIntegrationTester $) async { +Future _navigateToSignUp(PatrolTester $) async { final signUpButton = $(#toggleSignUpPage).waitUntilVisible(); await signUpButton.tap(); } Future _navigateBackUsingSystemGesture() async => - IntegrationTestWidgetsFlutterBinding.instance.keyboard - .isLogicalKeyPressed(LogicalKeyboardKey.escape); + IntegrationTestWidgetsFlutterBinding.instance.keyboard.isLogicalKeyPressed(LogicalKeyboardKey.escape); Future _initializeTracking() async { print('Requesting tracking authorization...'); diff --git a/integration_test/welcome_test.dart b/integration_test/welcome_test.dart index 29c308c8..e5d1a3f2 100644 --- a/integration_test/welcome_test.dart +++ b/integration_test/welcome_test.dart @@ -2,9 +2,9 @@ part of 'app_test.dart'; class WelcomeTest { static Future signInToSignUp() async { - patrol( + patrolWidgetTest( 'Sign-In to Sign-Up', - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Welcome Test - Sign-In to Sign-Up'); await _unlogged($); @@ -17,9 +17,9 @@ class WelcomeTest { } static Future signUpToSignIn() async { - patrol( + patrolWidgetTest( 'Sign-Up to Sign-In', - (PatrolIntegrationTester tester) async { + (PatrolTester tester) async { $ = tester; $.tester.printToConsole('Welcome Test - Sign-Up to Sign-In'); await _unlogged($);