From 8f348d1acd44c302d75dff1d545fef6a36b4d6dd Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 9 Jan 2025 10:44:54 +0100 Subject: [PATCH 01/16] store and restore seeds during onboarding create --- .../pageobject/onboarding_page.dart | 84 ++++++++++++++++--- .../suites/onboarding_test.dart | 29 ++++++- .../integration_test/utils/test_context.dart | 40 +++++++++ .../pages/registration/widgets/next_step.dart | 1 + .../seed_phrase/seed_phrases_sequencer.dart | 1 + .../separators/voices_text_divider.dart | 1 + 6 files changed, 141 insertions(+), 15 deletions(-) create mode 100644 catalyst_voices/apps/voices/integration_test/utils/test_context.dart diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index 5a10edf034b..673508bb245 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -4,6 +4,7 @@ import 'package:patrol_finders/patrol_finders.dart'; import '../types/registration_state.dart'; import '../utils/selector_utils.dart'; +import '../utils/test_context.dart'; import '../utils/translations_utils.dart'; import 'common_page.dart'; @@ -26,6 +27,9 @@ class OnboardingPage { static const seedPhraseStoredCheckbox = Key('SeedPhraseStoredCheckbox'); static const uploadKeyButton = Key('UploadKeyButton'); static const resetButton = Key('ResetButton'); + static const seedPhrasesPicker = Key('SeedPhrasesPicker'); + static const nextStepTitle = Key('NextStepTitle'); + static const nextStepBody = Key('NextStepBody'); static Future writedownSeedPhraseNumber( PatrolTester $, @@ -37,16 +41,16 @@ class OnboardingPage { return int.parse(rawNumber!.split('.').first); } - static Future writedownSeedPhraseWord( + static Future writedownSeedPhraseWord( PatrolTester $, int index, ) async { - final rawNumber = + final rawWord = $(Key('SeedPhrase${index}CellKey')).$(const Key('SeedPhraseWord')).text; - return int.parse(rawNumber!.split('.').first); + return rawWord!; } - static Future inputSeedPhraseCompleterWord( + static Future inputSeedPhraseCompleterText( PatrolTester $, int index, ) async { @@ -57,7 +61,7 @@ class OnboardingPage { return seedWord!; } - static Future inputSeedPhrasePickerWord( + static Future inputSeedPhrasePickerText( PatrolTester $, int index, ) async { @@ -68,6 +72,13 @@ class OnboardingPage { return seedWord!; } + static Future inputSeedPhrasePicker( + PatrolTester $, + String word, + ) async { + return $(seedPhrasesPicker).$(find.text(word)); + } + static Future infoPartHeaderTitleText(PatrolTester $) async { return $(registrationInfoPanel).$(headerTitle).text; } @@ -105,7 +116,7 @@ class OnboardingPage { return child; } - static void voicesFilledButtonIsEnabled( + static void voicesButtonIsEnabled( PatrolTester $, Key button, ) { @@ -116,7 +127,7 @@ class OnboardingPage { SelectorUtils.isEnabled($, $(child)); } - static void voicesFilledButtonIsDisabled( + static void voicesButtonIsDisabled( PatrolTester $, Key button, ) { @@ -226,6 +237,7 @@ class OnboardingPage { ), T.get('Learn More'), ); + break; case RegistrationState.keychainCreateMnemonicInput: expect(await infoPartHeaderTitleText($), T.get('Catalyst Keychain')); expect( @@ -249,7 +261,18 @@ class OnboardingPage { ); break; case RegistrationState.keychainCreateMnemonicVerified: - throw UnimplementedError(); + expect(await infoPartHeaderTitleText($), T.get('Catalyst Keychain')); + //temporary: check for specific picture (green checked icon) + expect(infoPartTaskPicture($), findsOneWidget); + expect($(progressBar), findsOneWidget); + expect( + await getChildNodeText( + $, + $(registrationInfoPanel).$(CommonPage.decoratorData), + ), + T.get('Learn More'), + ); + break; case RegistrationState.keychainRestoreChoice: throw UnimplementedError(); case RegistrationState.keychainRestoreMnemonicInfo: @@ -394,7 +417,33 @@ class OnboardingPage { expect($(nextButton), findsOneWidget); break; case RegistrationState.keychainCreateMnemonicVerified: - throw UnimplementedError(); + await $(registrationDetailsPanel) + .$(registrationDetailsTitle) + .waitUntilVisible(); + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsTitle), + ), + T.get("Nice job! You've successfully verified the seed phrase for " + 'your keychain.'), + ); + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsBody), + ), + isNotEmpty, + ); + expect( + await getChildNodeText($, $(nextStepTitle)), + T.get('Your next step'), + ); + expect($(nextStepBody).text, T.get('Now let’s set your Unlock password ' + 'for this device!'),); + expect($(backButton), findsOneWidget); + expect($(nextButton), findsOneWidget); + break; case RegistrationState.keychainRestoreChoice: throw UnimplementedError(); case RegistrationState.keychainRestoreMnemonicInfo: @@ -437,8 +486,21 @@ class OnboardingPage { static Future inputSeedPhrasesAreDisplayed(PatrolTester $) async { for (var i = 0; i < 12; i++) { - expect(await inputSeedPhrasePickerWord($, i), isNotEmpty); - expect(await inputSeedPhraseCompleterWord($, i), isNotEmpty); + expect(await inputSeedPhrasePickerText($, i), isNotEmpty); + expect(await inputSeedPhraseCompleterText($, i), isNotEmpty); + } + } + + static Future storeSeedPhrases(PatrolTester $) async { + for (var i = 0; i < 12; i++) { + final v1 = await writedownSeedPhraseWord($, i); + TestContext.save(key: 'word$i', value: v1); + } + } + + static Future enterStoredSeedPhrases(PatrolTester $) async { + for (var i = 0; i < 12; i++) { + await inputSeedPhrasePicker($, TestContext.get(key: 'word$i')).tap(); } } } diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 3a520bc4664..294ae92aad3 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -170,10 +170,7 @@ void main() async { $, RegistrationState.keychainCreateMnemonicWritedown, ); - OnboardingPage.voicesFilledButtonIsDisabled( - $, - OnboardingPage.nextButton, - ); + OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); }, ); @@ -254,6 +251,30 @@ void main() async { ); }, ); + + patrolWidgetTest( + 'visitor - create - mnemonic input - correct words unlock next button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.keychainCreateMnemonicVerified, + ); + }, + ); }, ); } diff --git a/catalyst_voices/apps/voices/integration_test/utils/test_context.dart b/catalyst_voices/apps/voices/integration_test/utils/test_context.dart new file mode 100644 index 00000000000..645e01f3bb0 --- /dev/null +++ b/catalyst_voices/apps/voices/integration_test/utils/test_context.dart @@ -0,0 +1,40 @@ +class TestContext { + TestContext._privateConstructor(); + static final TestContext instance = TestContext._privateConstructor(); + Map context = {}; + + static bool has({required String key}) { + return TestContext.instance.context.containsKey(key); + } + + static void save({required String key, required String value}) { + if (has(key: key)) { + throw Exception('You tried to override "$key" property. Its not allowed'); + } + TestContext.instance.context[key] = value; + } + + static void delete({required String key}) { + if (has(key: key)) { + TestContext.instance.context.remove(key); + } + } + + static void saveWithOverride({required String key, required String value}) { + if (has(key: key)) { + delete(key: key); + } + TestContext.instance.context[key] = value; + } + + static String get({required String key}) { + if (has(key: key)) { + return TestContext.instance.context[key]!; + } + throw Exception('You tried to access $key property, but it does not exist.'); + } + + static void clearContext() { + TestContext.instance.context.clear(); + } +} diff --git a/catalyst_voices/apps/voices/lib/pages/registration/widgets/next_step.dart b/catalyst_voices/apps/voices/lib/pages/registration/widgets/next_step.dart index ce7bec1065c..7f2309cab32 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/widgets/next_step.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/widgets/next_step.dart @@ -25,6 +25,7 @@ class NextStep extends StatelessWidget { const SizedBox(height: 12), if (data != null) ...[ Text( + key: const Key('NextStepBody'), data, style: theme.textTheme.bodySmall?.copyWith(color: textColor), textAlign: TextAlign.center, diff --git a/catalyst_voices/apps/voices/lib/widgets/seed_phrase/seed_phrases_sequencer.dart b/catalyst_voices/apps/voices/lib/widgets/seed_phrase/seed_phrases_sequencer.dart index 6126b193ec5..f83f8a736a1 100644 --- a/catalyst_voices/apps/voices/lib/widgets/seed_phrase/seed_phrases_sequencer.dart +++ b/catalyst_voices/apps/voices/lib/widgets/seed_phrase/seed_phrases_sequencer.dart @@ -41,6 +41,7 @@ class SeedPhrasesSequencer extends StatelessWidget { ), const SizedBox(height: 10), SeedPhrasesPicker( + key: const Key('SeedPhrasesPicker'), words: words, selectedWords: selectedWords, onWordTap: _selectWord, diff --git a/catalyst_voices/apps/voices/lib/widgets/separators/voices_text_divider.dart b/catalyst_voices/apps/voices/lib/widgets/separators/voices_text_divider.dart index c9e90b0d1c0..6758fbd6d78 100644 --- a/catalyst_voices/apps/voices/lib/widgets/separators/voices_text_divider.dart +++ b/catalyst_voices/apps/voices/lib/widgets/separators/voices_text_divider.dart @@ -47,6 +47,7 @@ class VoicesTextDivider extends StatelessWidget { Expanded(child: Divider(indent: indent)), SizedBox(width: nameGap), DefaultTextStyle( + key: const Key('NextStepTitle'), style: (theme.textTheme.bodyLarge ?? const TextStyle()) .copyWith(color: theme.colors.textOnPrimary), child: child, From 798d4eaca294a42aad634df1957b9dd8fd3f5b9e Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 9 Jan 2025 10:54:37 +0100 Subject: [PATCH 02/16] style fix --- .../integration_test/pageobject/onboarding_page.dart | 7 +++++-- .../voices/integration_test/suites/onboarding_test.dart | 2 +- .../apps/voices/integration_test/utils/test_context.dart | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index 673508bb245..c5c3ee777f3 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -439,8 +439,11 @@ class OnboardingPage { await getChildNodeText($, $(nextStepTitle)), T.get('Your next step'), ); - expect($(nextStepBody).text, T.get('Now let’s set your Unlock password ' - 'for this device!'),); + expect( + $(nextStepBody).text, + T.get('Now let’s set your Unlock password ' + 'for this device!'), + ); expect($(backButton), findsOneWidget); expect($(nextButton), findsOneWidget); break; diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 294ae92aad3..e3848d309ee 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -254,7 +254,7 @@ void main() async { patrolWidgetTest( 'visitor - create - mnemonic input - correct words unlock next button', - (PatrolTester $) async { + (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) .tap(settleTimeout: const Duration(seconds: 10)); diff --git a/catalyst_voices/apps/voices/integration_test/utils/test_context.dart b/catalyst_voices/apps/voices/integration_test/utils/test_context.dart index 645e01f3bb0..3df8187133a 100644 --- a/catalyst_voices/apps/voices/integration_test/utils/test_context.dart +++ b/catalyst_voices/apps/voices/integration_test/utils/test_context.dart @@ -31,7 +31,8 @@ class TestContext { if (has(key: key)) { return TestContext.instance.context[key]!; } - throw Exception('You tried to access $key property, but it does not exist.'); + throw Exception( + 'You tried to access $key property, but it does not exist.'); } static void clearContext() { From 13b3f93a4efb197c3b87c4e54c8cd39d9eafd665 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 9 Jan 2025 11:12:13 +0100 Subject: [PATCH 03/16] style fix --- .../apps/voices/integration_test/utils/test_context.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/utils/test_context.dart b/catalyst_voices/apps/voices/integration_test/utils/test_context.dart index 3df8187133a..6602fbd1214 100644 --- a/catalyst_voices/apps/voices/integration_test/utils/test_context.dart +++ b/catalyst_voices/apps/voices/integration_test/utils/test_context.dart @@ -32,7 +32,7 @@ class TestContext { return TestContext.instance.context[key]!; } throw Exception( - 'You tried to access $key property, but it does not exist.'); + 'You tried to access $key property, but it does not exist.',); } static void clearContext() { From cd7ea6cb22f9ef49c324f52876a99fa38ff432d0 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 9 Jan 2025 11:13:35 +0100 Subject: [PATCH 04/16] style fix --- .../apps/voices/integration_test/utils/test_context.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/utils/test_context.dart b/catalyst_voices/apps/voices/integration_test/utils/test_context.dart index 6602fbd1214..b3c951aecac 100644 --- a/catalyst_voices/apps/voices/integration_test/utils/test_context.dart +++ b/catalyst_voices/apps/voices/integration_test/utils/test_context.dart @@ -32,7 +32,8 @@ class TestContext { return TestContext.instance.context[key]!; } throw Exception( - 'You tried to access $key property, but it does not exist.',); + 'You tried to access $key property, but it does not exist.', + ); } static void clearContext() { From d515b805e1da0e2e42d3647d7d9e8468de220eb4 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 10 Jan 2025 12:59:05 +0100 Subject: [PATCH 05/16] few more tests --- .../pageobject/common_page.dart | 1 + .../pageobject/onboarding_page.dart | 144 +++++++- .../suites/onboarding_test.dart | 314 +++++++++++++++++- .../types/password_validation_states.dart | 5 + .../utils/selector_utils.dart | 6 +- .../widgets/unlock_password_form.dart | 2 + .../voices_password_strength_indicator.dart | 2 + .../widgets/text_field/voices_text_field.dart | 1 + 8 files changed, 463 insertions(+), 12 deletions(-) create mode 100644 catalyst_voices/apps/voices/integration_test/types/password_validation_states.dart diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart index 6732e683fb6..bef5c1715dc 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart @@ -5,4 +5,5 @@ class CommonPage { static const decoratorIconBefore = Key('DecoratorIconBefore'); static const decoratorIconAfter = Key('DecoratorIconAfter'); static const dialogCloseButton = Key('DialogCloseButton'); + static const voicesTextField = Key('VoicesTextField'); } diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index c5c3ee777f3..eb2090f35f7 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:patrol_finders/patrol_finders.dart'; +import '../types/password_validation_states.dart'; import '../types/registration_state.dart'; import '../utils/selector_utils.dart'; import '../utils/test_context.dart'; @@ -30,6 +31,10 @@ class OnboardingPage { static const seedPhrasesPicker = Key('SeedPhrasesPicker'); static const nextStepTitle = Key('NextStepTitle'); static const nextStepBody = Key('NextStepBody'); + static const passwordInputField = Key('PasswordInputField'); + static const passwordConfirmInputField = Key('PasswordConfirmInputField'); + static const passwordStrengthIndicator = Key('PasswordStrengthIndicator'); + static const passwordStrengthLabel = Key('PasswordStrengthLabel'); static Future writedownSeedPhraseNumber( PatrolTester $, @@ -273,6 +278,42 @@ class OnboardingPage { T.get('Learn More'), ); break; + case RegistrationState.passwordInfo: + expect(await infoPartHeaderTitleText($), T.get('Catalyst Keychain')); + //temporary: check for specific picture (locked icon) + expect(infoPartTaskPicture($), findsOneWidget); + expect($(progressBar), findsOneWidget); + expect( + await getChildNodeText( + $, + $(registrationInfoPanel).$(CommonPage.decoratorData), + ), + T.get('Learn More'), + ); + break; + case RegistrationState.passwordInput: + expect(await infoPartHeaderTitleText($), T.get('Catalyst Keychain')); + expect( + await infoPartHeaderSubtitleText($), + T.get('Catalyst unlock password'), + ); + expect( + await infoPartHeaderBodyText($), + T.get( + 'Please provide a password for your Catalyst Keychain.', + ), + ); + //temporary: check for specific picture (locked icon) + expect(infoPartTaskPicture($), findsOneWidget); + expect($(progressBar), findsOneWidget); + expect( + await getChildNodeText( + $, + $(registrationInfoPanel).$(CommonPage.decoratorData), + ), + T.get('Learn More'), + ); + break; case RegistrationState.keychainRestoreChoice: throw UnimplementedError(); case RegistrationState.keychainRestoreMnemonicInfo: @@ -281,10 +322,6 @@ class OnboardingPage { throw UnimplementedError(); case RegistrationState.keychainRestoreSuccess: throw UnimplementedError(); - case RegistrationState.passwordInfo: - throw UnimplementedError(); - case RegistrationState.passwordInput: - throw UnimplementedError(); case RegistrationState.keychainCreateSuccess: throw UnimplementedError(); case RegistrationState.linkWalletInfo: @@ -447,6 +484,45 @@ class OnboardingPage { expect($(backButton), findsOneWidget); expect($(nextButton), findsOneWidget); break; + case RegistrationState.passwordInfo: + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsTitle), + ), + T.get('Set your Catalyst unlock password 
for this device'), + ); + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsBody), + ), + isNotEmpty, + ); + expect($(backButton), findsOneWidget); + expect($(nextButton), findsOneWidget); + break; + case RegistrationState.passwordInput: + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(passwordInputField), + ), + T.get('Enter password'), + ); + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(passwordConfirmInputField), + ), + T.get('Confirm password'), + ); + expect($(passwordStrengthLabel), findsNothing); + expect($(passwordStrengthIndicator), findsNothing); + expect($(backButton), findsOneWidget); + expect($(nextButton), findsOneWidget); + OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); + break; case RegistrationState.keychainRestoreChoice: throw UnimplementedError(); case RegistrationState.keychainRestoreMnemonicInfo: @@ -455,10 +531,6 @@ class OnboardingPage { throw UnimplementedError(); case RegistrationState.keychainRestoreSuccess: throw UnimplementedError(); - case RegistrationState.passwordInfo: - throw UnimplementedError(); - case RegistrationState.passwordInput: - throw UnimplementedError(); case RegistrationState.keychainCreateSuccess: throw UnimplementedError(); case RegistrationState.linkWalletInfo: @@ -506,4 +578,60 @@ class OnboardingPage { await inputSeedPhrasePicker($, TestContext.get(key: 'word$i')).tap(); } } + + static Future enterPassword(PatrolTester $, String password) async { + await $(passwordInputField).enterText(password); + } + + static Future enterPasswordConfirm( + PatrolTester $, + String password, + ) async { + await $(passwordConfirmInputField).enterText(password); + } + + static Future checkValidationIndicator( + PatrolTester $, + PasswordValidationStatus validationStatus, + ) async { + expect($(passwordStrengthLabel), findsOneWidget); + + switch (validationStatus) { + case PasswordValidationStatus.weak: + expect( + $(passwordStrengthLabel).text, + T.get('Weak password strength'), + ); + break; + case PasswordValidationStatus.normal: + expect( + $(passwordStrengthLabel).text, + T.get('Normal password strength'), + ); + break; + case PasswordValidationStatus.good: + expect( + $(passwordStrengthLabel).text, + T.get('Good password strength'), + ); + break; + } + } + + static Future passwordConfirmErrorIconIsShown( + PatrolTester $, { + bool reverse = false, + }) async { + if (reverse) { + expect( + $(registrationDetailsPanel).$(CommonPage.voicesTextField).$(Icon), + findsNothing, + ); + } else { + expect( + $(registrationDetailsPanel).$(CommonPage.voicesTextField).$(Icon), + findsOneWidget, + ); + } + } } diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index e3848d309ee..ede4bac80a8 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -9,7 +9,10 @@ import 'package:patrol_finders/patrol_finders.dart'; import '../pageobject/app_bar_page.dart'; import '../pageobject/onboarding_page.dart'; import '../pageobject/overall_spaces_page.dart'; +import '../types/password_validation_states.dart'; import '../types/registration_state.dart'; +import '../utils/test_context.dart'; +import '../utils/translations_utils.dart'; void main() async { late final GoRouter router; @@ -25,6 +28,7 @@ void main() async { tearDown(() async { await restartDependencies(); + TestContext.clearContext(); }); group( @@ -105,7 +109,7 @@ void main() async { await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( $, - RegistrationState.createKeychainInfo, + RegistrationState.keychainCreated, ); }, ); @@ -254,6 +258,26 @@ void main() async { patrolWidgetTest( 'visitor - create - mnemonic input - correct words unlock next button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + OnboardingPage.voicesButtonIsEnabled($, OnboardingPage.nextButton); + }, + ); + + patrolWidgetTest( + 'visitor - create - mnemonic input verified screen looks OK', (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) @@ -275,6 +299,294 @@ void main() async { ); }, ); + + patrolWidgetTest( + 'visitor - create - mnemonic input verified screen back button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); + await OnboardingPage.registrationInfoPanelLooksAsExpected( + $, + RegistrationState.keychainCreateMnemonicInputInfo, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - password info screen looks OK', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.passwordInfo, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - password info screen back button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); + expect( + $(OnboardingPage.nextStepBody).text, + T.get('Now let’s set your Unlock password ' + 'for this device!'), + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - password input screen looks OK', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.passwordInput, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - password input screen back button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); + await OnboardingPage.registrationDetailsPanelLooksAsExpected( + $, + RegistrationState.passwordInfo, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - password input - valid minimal length password ' + 'enable next button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.enterPassword($, 'Test1234'); + await OnboardingPage.enterPasswordConfirm($, 'Test1234'); + await OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true); + await OnboardingPage.checkValidationIndicator( + $, + PasswordValidationStatus.normal, + ); + await OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true); + OnboardingPage.voicesButtonIsEnabled($, OnboardingPage.nextButton); + }, + ); + + patrolWidgetTest( + 'visitor - create - password input - valid long password enable next ' + 'button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.enterPassword($, 'Test1234Test1234'); + await OnboardingPage.enterPasswordConfirm($, 'Test1234Test1234'); + await OnboardingPage.checkValidationIndicator( + $, + PasswordValidationStatus.good, + ); + await OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true); + OnboardingPage.voicesButtonIsEnabled($, OnboardingPage.nextButton); + }, + ); + + patrolWidgetTest( + 'visitor - create - password input - too short password disable next ', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.enterPassword($, 'Test123'); + await OnboardingPage.checkValidationIndicator( + $, + PasswordValidationStatus.weak, + ); + await OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true); + OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); + }, + ); + + patrolWidgetTest( + 'visitor - create - password input - valid password, no confirmation ' + 'then next disabled', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.enterPassword($, 'Test1234'); + await OnboardingPage.checkValidationIndicator( + $, + PasswordValidationStatus.normal, + ); + await OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true); + OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); + }, + ); + + patrolWidgetTest( + 'visitor - create - password input - not matching confirmation ' + 'then next button disabled', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.enterPassword($, 'Test1234'); + await OnboardingPage.enterPasswordConfirm($, 'Test123'); + await OnboardingPage.checkValidationIndicator( + $, + PasswordValidationStatus.normal, + ); + await OnboardingPage.passwordConfirmErrorIconIsShown($); + OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); + }, + ); }, ); } diff --git a/catalyst_voices/apps/voices/integration_test/types/password_validation_states.dart b/catalyst_voices/apps/voices/integration_test/types/password_validation_states.dart new file mode 100644 index 00000000000..a0ee5e6297b --- /dev/null +++ b/catalyst_voices/apps/voices/integration_test/types/password_validation_states.dart @@ -0,0 +1,5 @@ +enum PasswordValidationStatus { + weak, + normal, + good; +} diff --git a/catalyst_voices/apps/voices/integration_test/utils/selector_utils.dart b/catalyst_voices/apps/voices/integration_test/utils/selector_utils.dart index 67a0c980078..9ab6c5b57e6 100644 --- a/catalyst_voices/apps/voices/integration_test/utils/selector_utils.dart +++ b/catalyst_voices/apps/voices/integration_test/utils/selector_utils.dart @@ -7,11 +7,11 @@ class SelectorUtils { PatrolFinder widget, { bool? reverse = false, }) { - final widgetProps = $.tester.widget(widget).toString().split('(').last; + final dynamic widgetProps = $.tester.widget(widget); final expectedState = reverse! ? 'enabled' : 'disabled'; expect( - widgetProps.contains('disabled'), - !reverse, + widgetProps.enabled, // ignore: avoid_dynamic_calls + reverse, reason: 'Expected $expectedState (${widget.description})', ); } diff --git a/catalyst_voices/apps/voices/lib/pages/registration/widgets/unlock_password_form.dart b/catalyst_voices/apps/voices/lib/pages/registration/widgets/unlock_password_form.dart index 54bbf18a171..5fb20445671 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/widgets/unlock_password_form.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/widgets/unlock_password_form.dart @@ -55,6 +55,7 @@ class _UnlockPasswordTextField extends StatelessWidget { @override Widget build(BuildContext context) { return VoicesPasswordTextField( + key: const Key('PasswordInputField'), controller: controller, textInputAction: TextInputAction.next, decoration: VoicesTextFieldDecoration( @@ -78,6 +79,7 @@ class _ConfirmUnlockPasswordTextField extends StatelessWidget { @override Widget build(BuildContext context) { return VoicesPasswordTextField( + key: const Key('PasswordConfirmInputField'), controller: controller, decoration: VoicesTextFieldDecoration( labelText: context.l10n.confirmPassword, diff --git a/catalyst_voices/apps/voices/lib/widgets/indicators/voices_password_strength_indicator.dart b/catalyst_voices/apps/voices/lib/widgets/indicators/voices_password_strength_indicator.dart index 41be4d15bd4..92b9126a447 100644 --- a/catalyst_voices/apps/voices/lib/widgets/indicators/voices_password_strength_indicator.dart +++ b/catalyst_voices/apps/voices/lib/widgets/indicators/voices_password_strength_indicator.dart @@ -37,6 +37,7 @@ class _Label extends StatelessWidget { @override Widget build(BuildContext context) { return Text( + key: const Key('PasswordStrengthLabel'), switch (passwordStrength) { PasswordStrength.weak => context.l10n.weakPasswordStrength, PasswordStrength.normal => context.l10n.normalPasswordStrength, @@ -63,6 +64,7 @@ class _Indicator extends StatelessWidget { return SizedBox( height: _foregroundTrackHeight, child: LayoutBuilder( + key: const Key('PasswordStrengthIndicator'), builder: (context, constraints) { final totalWidthOfAllGaps = (PasswordStrength.values.length - 1) * _tracksGap; diff --git a/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart b/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart index cd037a9720f..8c04143f3b5 100644 --- a/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart +++ b/catalyst_voices/apps/voices/lib/widgets/text_field/voices_text_field.dart @@ -210,6 +210,7 @@ class _VoicesTextFieldState extends State { resizableHorizontally: resizable, resizableVertically: resizable, child: TextFormField( + key: const Key('VoicesTextField'), textAlignVertical: TextAlignVertical.top, autofocus: widget.autofocus, expands: resizable, From 8c07d847b8d154dc79238195d955990a0a1648f5 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 10 Jan 2025 14:57:59 +0100 Subject: [PATCH 06/16] add keychain created success test --- .../pageobject/onboarding_page.dart | 56 +++++++++++++++++-- .../suites/onboarding_test.dart | 43 +++++++++++--- .../finish_account_creation_panel.dart | 2 + 3 files changed, 88 insertions(+), 13 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index eb2090f35f7..a92eb6acd73 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -35,6 +35,14 @@ class OnboardingPage { static const passwordConfirmInputField = Key('PasswordConfirmInputField'); static const passwordStrengthIndicator = Key('PasswordStrengthIndicator'); static const passwordStrengthLabel = Key('PasswordStrengthLabel'); + static const finishAccountCreationPanel = Key('FinishAccountCreationPanel'); + static const finishAccountKeychainCreated = + Key('StepRegistrationProgressStepGroup.createKeychainRowKey'); + static const finishAccountLinkWallet = + Key('StepRegistrationProgressStepGroup.linkWalletRowKey'); + static const finishAccountAccountComplete = + Key('StepRegistrationProgressStepGroup.accountCompletedRowKey'); + static const linkWalletAndRolesButton = Key('LinkWalletAndRolesButton'); static Future writedownSeedPhraseNumber( PatrolTester $, @@ -314,6 +322,19 @@ class OnboardingPage { T.get('Learn More'), ); break; + case RegistrationState.keychainCreateSuccess: + expect(await infoPartHeaderTitleText($), T.get('Catalyst Keychain')); + //temporary: check for specific picture (green key locked icon) + expect(infoPartTaskPicture($), findsOneWidget); + expect($(progressBar), findsOneWidget); + expect( + await getChildNodeText( + $, + $(registrationInfoPanel).$(CommonPage.decoratorData), + ), + T.get('Learn More'), + ); + break; case RegistrationState.keychainRestoreChoice: throw UnimplementedError(); case RegistrationState.keychainRestoreMnemonicInfo: @@ -322,8 +343,6 @@ class OnboardingPage { throw UnimplementedError(); case RegistrationState.keychainRestoreSuccess: throw UnimplementedError(); - case RegistrationState.keychainCreateSuccess: - throw UnimplementedError(); case RegistrationState.linkWalletInfo: throw UnimplementedError(); case RegistrationState.linkWalletSelect: @@ -523,6 +542,37 @@ class OnboardingPage { expect($(nextButton), findsOneWidget); OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); break; + case RegistrationState.keychainCreateSuccess: + expect( + await $(finishAccountCreationPanel).$(Text).text, + T.get('Congratulations your Catalyst 
Keychain is created!'), + ); + expect( + await $(finishAccountKeychainCreated).$(Text).text, + T.get('Catalyst Keychain created'), + ); + expect( + await $(finishAccountLinkWallet).$(Text).text, + T.get('Link Cardano Wallet & Roles'), + ); + expect( + await $(finishAccountAccountComplete).$(Text).text, + T.get('Catalyst account creation completed!'), + ); + expect( + await getChildNodeText($, $(nextStepTitle)), + T.get('Your next step'), + ); + expect( + $(nextStepBody).text, + T.get('In the next step you write your Catalyst roles and 
account ' + 'to the Cardano Mainnet.'), + ); + expect( + $(linkWalletAndRolesButton).$(Text).text, + T.get('Link your Cardano Wallet & Roles'), + ); + break; case RegistrationState.keychainRestoreChoice: throw UnimplementedError(); case RegistrationState.keychainRestoreMnemonicInfo: @@ -531,8 +581,6 @@ class OnboardingPage { throw UnimplementedError(); case RegistrationState.keychainRestoreSuccess: throw UnimplementedError(); - case RegistrationState.keychainCreateSuccess: - throw UnimplementedError(); case RegistrationState.linkWalletInfo: throw UnimplementedError(); case RegistrationState.linkWalletSelect: diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index ede4bac80a8..28d1fd6d99a 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -431,8 +431,7 @@ void main() async { ); patrolWidgetTest( - 'visitor - create - password input - valid minimal length password ' - 'enable next button', + 'visitor - create - password input - valid minimum length password', (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) @@ -465,8 +464,7 @@ void main() async { ); patrolWidgetTest( - 'visitor - create - password input - valid long password enable next ' - 'button', + 'visitor - create - password input - valid long password', (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) @@ -497,7 +495,7 @@ void main() async { ); patrolWidgetTest( - 'visitor - create - password input - too short password disable next ', + 'visitor - create - password input - too short password', (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) @@ -527,8 +525,7 @@ void main() async { ); patrolWidgetTest( - 'visitor - create - password input - valid password, no confirmation ' - 'then next disabled', + 'visitor - create - password input - valid password, no confirmation', (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) @@ -558,8 +555,7 @@ void main() async { ); patrolWidgetTest( - 'visitor - create - password input - not matching confirmation ' - 'then next button disabled', + 'visitor - create - password input - not matching confirmation', (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) @@ -587,6 +583,35 @@ void main() async { OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); }, ); + + patrolWidgetTest( + 'visitor - create - keychain created success screen looks OK', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.enterPassword($, 'Test1234'); + await OnboardingPage.enterPasswordConfirm($, 'Test1234'); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.keychainCreateSuccess, + ); + }, + ); }, ); } diff --git a/catalyst_voices/apps/voices/lib/pages/registration/finish_account/finish_account_creation_panel.dart b/catalyst_voices/apps/voices/lib/pages/registration/finish_account/finish_account_creation_panel.dart index 137d69cb600..9e2c3140b1c 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/finish_account/finish_account_creation_panel.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/finish_account/finish_account_creation_panel.dart @@ -13,6 +13,7 @@ class FinishAccountCreationPanel extends StatelessWidget { @override Widget build(BuildContext context) { return Column( + key: const Key('FinishAccountCreationPanel'), crossAxisAlignment: CrossAxisAlignment.stretch, children: [ const SizedBox(height: 24), @@ -78,6 +79,7 @@ class _LinkWalletAndRolesButton extends StatelessWidget { @override Widget build(BuildContext context) { return VoicesFilledButton( + key: const Key('LinkWalletAndRolesButton'), onTap: onTap, leading: VoicesAssets.icons.wallet.buildIcon(size: 18), child: Text(context.l10n.createKeychainLinkWalletAndRoles), From 1a38ce07a4b3ce466e09fbae0bb8388b3387a07e Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 10 Jan 2025 15:25:22 +0100 Subject: [PATCH 07/16] cleanup --- .../pageobject/onboarding_page.dart | 16 +++++----- .../suites/onboarding_test.dart | 32 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index a92eb6acd73..a105b457c54 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -544,19 +544,19 @@ class OnboardingPage { break; case RegistrationState.keychainCreateSuccess: expect( - await $(finishAccountCreationPanel).$(Text).text, + $(finishAccountCreationPanel).$(Text).text, T.get('Congratulations your Catalyst 
Keychain is created!'), ); expect( - await $(finishAccountKeychainCreated).$(Text).text, + $(finishAccountKeychainCreated).$(Text).text, T.get('Catalyst Keychain created'), ); expect( - await $(finishAccountLinkWallet).$(Text).text, + $(finishAccountLinkWallet).$(Text).text, T.get('Link Cardano Wallet & Roles'), ); expect( - await $(finishAccountAccountComplete).$(Text).text, + $(finishAccountAccountComplete).$(Text).text, T.get('Catalyst account creation completed!'), ); expect( @@ -638,10 +638,10 @@ class OnboardingPage { await $(passwordConfirmInputField).enterText(password); } - static Future checkValidationIndicator( + static void checkValidationIndicator( PatrolTester $, PasswordValidationStatus validationStatus, - ) async { + ) { expect($(passwordStrengthLabel), findsOneWidget); switch (validationStatus) { @@ -666,10 +666,10 @@ class OnboardingPage { } } - static Future passwordConfirmErrorIconIsShown( + static void passwordConfirmErrorIconIsShown( PatrolTester $, { bool reverse = false, - }) async { + }) { if (reverse) { expect( $(registrationDetailsPanel).$(CommonPage.voicesTextField).$(Icon), diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 28d1fd6d99a..a3c7182244a 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -451,14 +451,14 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await OnboardingPage.enterPassword($, 'Test1234'); await OnboardingPage.enterPasswordConfirm($, 'Test1234'); - await OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true); - await OnboardingPage.checkValidationIndicator( + OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true,); + OnboardingPage.checkValidationIndicator( $, PasswordValidationStatus.normal, ); - await OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true); + OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true,); OnboardingPage.voicesButtonIsEnabled($, OnboardingPage.nextButton); }, ); @@ -484,12 +484,12 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await OnboardingPage.enterPassword($, 'Test1234Test1234'); await OnboardingPage.enterPasswordConfirm($, 'Test1234Test1234'); - await OnboardingPage.checkValidationIndicator( + OnboardingPage.checkValidationIndicator( $, PasswordValidationStatus.good, ); - await OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true); + OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true,); OnboardingPage.voicesButtonIsEnabled($, OnboardingPage.nextButton); }, ); @@ -514,12 +514,12 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); await OnboardingPage.enterPassword($, 'Test123'); - await OnboardingPage.checkValidationIndicator( + OnboardingPage.checkValidationIndicator( $, PasswordValidationStatus.weak, ); - await OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true); + OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true,); OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); }, ); @@ -544,12 +544,12 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); await OnboardingPage.enterPassword($, 'Test1234'); - await OnboardingPage.checkValidationIndicator( + OnboardingPage.checkValidationIndicator( $, PasswordValidationStatus.normal, ); - await OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true); + OnboardingPage.passwordConfirmErrorIconIsShown($, + reverse: true,); OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); }, ); @@ -575,11 +575,11 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await OnboardingPage.enterPassword($, 'Test1234'); await OnboardingPage.enterPasswordConfirm($, 'Test123'); - await OnboardingPage.checkValidationIndicator( + OnboardingPage.checkValidationIndicator( $, PasswordValidationStatus.normal, ); - await OnboardingPage.passwordConfirmErrorIconIsShown($); + OnboardingPage.passwordConfirmErrorIconIsShown($); OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); }, ); From 7bb40b87fb9dba6a2429da2b42ce2622a868679e Mon Sep 17 00:00:00 2001 From: januszjanus Date: Fri, 10 Jan 2025 15:28:38 +0100 Subject: [PATCH 08/16] formatting fix --- .../suites/onboarding_test.dart | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index a3c7182244a..a04a1ff07ed 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -451,14 +451,18 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await OnboardingPage.enterPassword($, 'Test1234'); await OnboardingPage.enterPasswordConfirm($, 'Test1234'); - OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true,); + OnboardingPage.passwordConfirmErrorIconIsShown( + $, + reverse: true, + ); OnboardingPage.checkValidationIndicator( $, PasswordValidationStatus.normal, ); - OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true,); + OnboardingPage.passwordConfirmErrorIconIsShown( + $, + reverse: true, + ); OnboardingPage.voicesButtonIsEnabled($, OnboardingPage.nextButton); }, ); @@ -488,8 +492,10 @@ void main() async { $, PasswordValidationStatus.good, ); - OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true,); + OnboardingPage.passwordConfirmErrorIconIsShown( + $, + reverse: true, + ); OnboardingPage.voicesButtonIsEnabled($, OnboardingPage.nextButton); }, ); @@ -518,8 +524,10 @@ void main() async { $, PasswordValidationStatus.weak, ); - OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true,); + OnboardingPage.passwordConfirmErrorIconIsShown( + $, + reverse: true, + ); OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); }, ); @@ -548,8 +556,10 @@ void main() async { $, PasswordValidationStatus.normal, ); - OnboardingPage.passwordConfirmErrorIconIsShown($, - reverse: true,); + OnboardingPage.passwordConfirmErrorIconIsShown( + $, + reverse: true, + ); OnboardingPage.voicesButtonIsDisabled($, OnboardingPage.nextButton); }, ); From 648172db29b7f276b36b39ea229fd45068876c78 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Sat, 11 Jan 2025 10:02:04 +0100 Subject: [PATCH 09/16] refactoring --- .../pageobject/common_page.dart | 6 +- .../pageobject/onboarding_page.dart | 173 ++++-------------- .../pageobject/spaces_drawer_page.dart | 19 +- 3 files changed, 47 insertions(+), 151 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart index bef5c1715dc..12296dfb200 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart @@ -1,9 +1,9 @@ import 'package:flutter/material.dart'; class CommonPage { - static const decoratorData = Key('DecoratorData'); - static const decoratorIconBefore = Key('DecoratorIconBefore'); - static const decoratorIconAfter = Key('DecoratorIconAfter'); + static const decorData = Key('DecoratorData'); + static const decorIconBefore = Key('DecoratorIconBefore'); + static const decorIconAfter = Key('DecoratorIconAfter'); static const dialogCloseButton = Key('DialogCloseButton'); static const voicesTextField = Key('VoicesTextField'); } diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index a105b457c54..750c30d8b6d 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -67,10 +67,10 @@ class OnboardingPage { PatrolTester $, int index, ) async { - final seedWord = await getChildNodeText( - $, - $(Key('CompleterSeedPhrase${index}CellKey')).$(CommonPage.decoratorData), - ); + final seedWord = $(Key('CompleterSeedPhrase${index}CellKey')) + .$(CommonPage.decorData) + .$(Text) + .text; return seedWord!; } @@ -78,10 +78,7 @@ class OnboardingPage { PatrolTester $, int index, ) async { - final seedWord = await getChildNodeText( - $, - $(Key('PickerSeedPhrase${index + 1}CellKey')), - ); + final seedWord = $(Key('PickerSeedPhrase${index + 1}CellKey')).$(Text).text; return seedWord!; } @@ -110,33 +107,17 @@ class OnboardingPage { .waitUntilVisible(); } - static Future getChildNodeText( - PatrolTester $, - FinderBase parent, - ) async { - final child = find.descendant( - of: parent, - matching: find.byType(Text), - ); - return $(child).text; - } - static Finder infoPartTaskPicture(PatrolTester $) { - final child = find.descendant( - of: $(registrationInfoPanel).$(registrationInfoPictureContainer), - matching: find.byType(IconTheme), - ); - return child; + return $(registrationInfoPanel) + .$(registrationInfoPictureContainer) + .$(IconTheme); } static void voicesButtonIsEnabled( PatrolTester $, Key button, ) { - final child = find.descendant( - of: $(button), - matching: find.byType(FilledButton), - ); + final child = $(button).$(FilledButton); SelectorUtils.isEnabled($, $(child)); } @@ -144,10 +125,7 @@ class OnboardingPage { PatrolTester $, Key button, ) { - final child = find.descendant( - of: $(button), - matching: find.byType(FilledButton), - ); + final child = $(button).$(FilledButton); SelectorUtils.isDisabled($, $(child)); } @@ -196,10 +174,7 @@ class OnboardingPage { expect(await infoPartHeaderTitleText($), T.get('Get Started')); expect(infoPartTaskPicture($), findsOneWidget); expect( - await getChildNodeText( - $, - $(registrationInfoPanel).$(CommonPage.decoratorData), - ), + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, T.get('Learn More'), ); break; @@ -209,10 +184,7 @@ class OnboardingPage { expect(infoPartTaskPicture($), findsOneWidget); expect($(progressBar), findsOneWidget); expect( - await getChildNodeText( - $, - $(registrationInfoPanel).$(CommonPage.decoratorData), - ), + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, T.get('Learn More'), ); break; @@ -232,10 +204,7 @@ class OnboardingPage { expect(infoPartTaskPicture($), findsOneWidget); expect($(progressBar), findsOneWidget); expect( - await getChildNodeText( - $, - $(registrationInfoPanel).$(CommonPage.decoratorData), - ), + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, T.get('Learn More'), ); break; @@ -244,10 +213,7 @@ class OnboardingPage { expect(infoPartTaskPicture($), findsOneWidget); expect($(progressBar), findsOneWidget); expect( - await getChildNodeText( - $, - $(registrationInfoPanel).$(CommonPage.decoratorData), - ), + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, T.get('Learn More'), ); break; @@ -266,10 +232,7 @@ class OnboardingPage { expect(infoPartTaskPicture($), findsOneWidget); expect($(progressBar), findsOneWidget); expect( - await getChildNodeText( - $, - $(registrationInfoPanel).$(CommonPage.decoratorData), - ), + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, T.get('Learn More'), ); break; @@ -279,10 +242,7 @@ class OnboardingPage { expect(infoPartTaskPicture($), findsOneWidget); expect($(progressBar), findsOneWidget); expect( - await getChildNodeText( - $, - $(registrationInfoPanel).$(CommonPage.decoratorData), - ), + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, T.get('Learn More'), ); break; @@ -292,10 +252,7 @@ class OnboardingPage { expect(infoPartTaskPicture($), findsOneWidget); expect($(progressBar), findsOneWidget); expect( - await getChildNodeText( - $, - $(registrationInfoPanel).$(CommonPage.decoratorData), - ), + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, T.get('Learn More'), ); break; @@ -315,10 +272,7 @@ class OnboardingPage { expect(infoPartTaskPicture($), findsOneWidget); expect($(progressBar), findsOneWidget); expect( - await getChildNodeText( - $, - $(registrationInfoPanel).$(CommonPage.decoratorData), - ), + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, T.get('Learn More'), ); break; @@ -328,10 +282,7 @@ class OnboardingPage { expect(infoPartTaskPicture($), findsOneWidget); expect($(progressBar), findsOneWidget); expect( - await getChildNodeText( - $, - $(registrationInfoPanel).$(CommonPage.decoratorData), - ), + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, T.get('Learn More'), ); break; @@ -369,17 +320,11 @@ class OnboardingPage { switch (step) { case RegistrationState.getStarted: expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsTitle), - ), + $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, T.get('Welcome to Catalyst'), ); expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsBody), - ), + $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, isNotEmpty, ); expect( @@ -391,17 +336,11 @@ class OnboardingPage { break; case RegistrationState.createKeychainInfo: expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsTitle), - ), + $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, T.get('Create your Catalyst Keychain'), ); expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsBody), - ), + $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, isNotEmpty, ); expect(await detailsPartCreateKeychainBtn($), findsOneWidget); @@ -409,17 +348,11 @@ class OnboardingPage { break; case RegistrationState.keychainCreated: expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsTitle), - ), + $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, T.get('Great! Your Catalyst Keychain 
has been created.'), ); expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsBody), - ), + $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, isNotEmpty, ); expect($(backButton), findsOneWidget); @@ -429,15 +362,12 @@ class OnboardingPage { await writedownSeedPhrasesAreDisplayed($); expect($(downloadSeedPhraseButton), findsOneWidget); expect( - await getChildNodeText( - $, - $(downloadSeedPhraseButton).$(CommonPage.decoratorData), - ), + $(downloadSeedPhraseButton).$(CommonPage.decorData).$(Text).text, T.get('Download Catalyst key'), ); expect($(seedPhraseStoredCheckbox), findsOneWidget); expect( - await getChildNodeText($, $(seedPhraseStoredCheckbox)), + $(seedPhraseStoredCheckbox).$(Text).text, T.get('I have written down/downloaded my 12 words'), ); expect($(backButton), findsOneWidget); @@ -445,17 +375,11 @@ class OnboardingPage { break; case RegistrationState.keychainCreateMnemonicInputInfo: expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsTitle), - ), + $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, T.get('Check your Catalyst security keys'), ); expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsBody), - ), + $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, isNotEmpty, ); break; @@ -463,10 +387,7 @@ class OnboardingPage { await inputSeedPhrasesAreDisplayed($); expect($(uploadKeyButton), findsOneWidget); expect( - await getChildNodeText( - $, - $(uploadKeyButton).$(CommonPage.decoratorData), - ), + $(uploadKeyButton).$(CommonPage.decorData).$(Text).text, T.get('Upload Catalyst Key'), ); expect($(backButton), findsOneWidget); @@ -477,22 +398,16 @@ class OnboardingPage { .$(registrationDetailsTitle) .waitUntilVisible(); expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsTitle), - ), + $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, T.get("Nice job! You've successfully verified the seed phrase for " 'your keychain.'), ); expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsBody), - ), + $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, isNotEmpty, ); expect( - await getChildNodeText($, $(nextStepTitle)), + $(nextStepTitle).$(Text).text, T.get('Your next step'), ); expect( @@ -505,17 +420,11 @@ class OnboardingPage { break; case RegistrationState.passwordInfo: expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsTitle), - ), + $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, T.get('Set your Catalyst unlock password 
for this device'), ); expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(registrationDetailsBody), - ), + $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, isNotEmpty, ); expect($(backButton), findsOneWidget); @@ -523,17 +432,11 @@ class OnboardingPage { break; case RegistrationState.passwordInput: expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(passwordInputField), - ), + $(registrationDetailsPanel).$(passwordInputField).$(Text).text, T.get('Enter password'), ); expect( - await getChildNodeText( - $, - $(registrationDetailsPanel).$(passwordConfirmInputField), - ), + $(registrationDetailsPanel).$(passwordConfirmInputField).$(Text).text, T.get('Confirm password'), ); expect($(passwordStrengthLabel), findsNothing); @@ -560,7 +463,7 @@ class OnboardingPage { T.get('Catalyst account creation completed!'), ); expect( - await getChildNodeText($, $(nextStepTitle)), + $(nextStepTitle).$(Text).text, T.get('Your next step'), ); expect( diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/spaces_drawer_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/spaces_drawer_page.dart index b355c211485..2c03468c3f7 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/spaces_drawer_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/spaces_drawer_page.dart @@ -116,11 +116,10 @@ class SpacesDrawerPage { $(userMenuContainer(Space.treasury)).$(userSectionHeader(Space.treasury)), findsOneWidget, ); - final children = find.descendant( - of: $(userMenuContainer(Space.treasury)), - matching: $(userDrawerMenuItem), + expect( + $(userMenuContainer(Space.treasury)).$(userDrawerMenuItem), + findsAtLeast(1), ); - expect($(children), findsAtLeast(1)); } static void userVotingLooksAsExpected(PatrolTester $) { @@ -132,11 +131,10 @@ class SpacesDrawerPage { $(userMenuContainer(Space.voting)).$(userSectionHeader(Space.voting)), findsOneWidget, ); - final children = find.descendant( - of: $(userMenuContainer(Space.voting)), - matching: $(userDrawerMenuItem), + expect( + $(userMenuContainer(Space.voting)).$(userDrawerMenuItem), + findsAtLeast(1), ); - expect($(children), findsAtLeast(1)); } static void userWorkspaceLooksAsExpected(PatrolTester $) { @@ -149,10 +147,5 @@ class SpacesDrawerPage { .$(userSectionHeader(Space.workspace)), findsOneWidget, ); - final children = find.descendant( - of: $(userMenuContainer(Space.workspace)), - matching: $(userDrawerMenuItem), - ); - expect($(children), findsAtLeast(1)); } } From b710201e6caf01111ca3be6b5fa2dcc3e6a71b99 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Mon, 13 Jan 2025 10:12:41 +0100 Subject: [PATCH 10/16] link wallet first two screens tests --- .../pageobject/onboarding_page.dart | 50 +++++++++- .../suites/onboarding_test.dart | 93 +++++++++++++++++++ .../wallet_link/stage/intro_panel.dart | 1 + .../stage/select_wallet_panel.dart | 2 + 4 files changed, 142 insertions(+), 4 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index 750c30d8b6d..108cc5d39f2 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -43,6 +43,9 @@ class OnboardingPage { static const finishAccountAccountComplete = Key('StepRegistrationProgressStepGroup.accountCompletedRowKey'); static const linkWalletAndRolesButton = Key('LinkWalletAndRolesButton'); + static const chooseCardanoWalletButton = Key('ChooseCardanoWalletButton'); + static const seeAllSupportedWalletsBtn = Key('SeeAllSupportedWalletsButton'); + static const walletsLinkBuilder = Key('WalletsLinkBuilder'); static Future writedownSeedPhraseNumber( PatrolTester $, @@ -295,9 +298,23 @@ class OnboardingPage { case RegistrationState.keychainRestoreSuccess: throw UnimplementedError(); case RegistrationState.linkWalletInfo: - throw UnimplementedError(); case RegistrationState.linkWalletSelect: - throw UnimplementedError(); + expect( + await infoPartHeaderTitleText($), + T.get('Link keys to your Catalyst Keychain'), + ); + expect( + await infoPartHeaderSubtitleText($), + T.get('Link your Cardano wallet'), + ); + //temporary: check for specific picture (blue key icon) + expect(infoPartTaskPicture($), findsOneWidget); + expect($(progressBar), findsOneWidget); + expect( + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, + T.get('Learn More'), + ); + break; case RegistrationState.linkWalletSuccess: throw UnimplementedError(); case RegistrationState.rolesSelect: @@ -485,9 +502,34 @@ class OnboardingPage { case RegistrationState.keychainRestoreSuccess: throw UnimplementedError(); case RegistrationState.linkWalletInfo: - throw UnimplementedError(); + expect( + $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, + T.get('Link Cardano Wallet & Catalyst Roles to you Catalyst ' + 'Keychain.'), + ); + expect( + $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, + isNotEmpty, + ); + expect( + $(chooseCardanoWalletButton).$(Text).text, + T.get('Choose Cardano Wallet'), + ); + break; case RegistrationState.linkWalletSelect: - throw UnimplementedError(); + expect( + $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, + T.get( + 'Select the Cardano wallet to link\nto your Catalyst Keychain.'), + ); + expect( + $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, + isNotEmpty, + ); + expect($(walletsLinkBuilder), findsOneWidget); + expect($(backButton), findsOneWidget); + expect($(seeAllSupportedWalletsBtn), findsOneWidget); + break; case RegistrationState.linkWalletSuccess: throw UnimplementedError(); case RegistrationState.rolesSelect: diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index a04a1ff07ed..520e0e2ee99 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -622,6 +622,99 @@ void main() async { ); }, ); + + patrolWidgetTest( + 'visitor - create - link wallet info screen looks OK', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.enterPassword($, 'Test1234'); + await OnboardingPage.enterPasswordConfirm($, 'Test1234'); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.linkWalletAndRolesButton).tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.linkWalletInfo, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - link wallet select screen looks OK', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.enterPassword($, 'Test1234'); + await OnboardingPage.enterPasswordConfirm($, 'Test1234'); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.linkWalletAndRolesButton).tap(); + await $(OnboardingPage.chooseCardanoWalletButton).tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.linkWalletSelect, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - link wallet select screen back button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); + await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.storeSeedPhrases($); + await $(OnboardingPage.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + //temporary: remove reset when seeds are no longer prefilled + await $(OnboardingPage.resetButton).tap(); + await OnboardingPage.enterStoredSeedPhrases($); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.enterPassword($, 'Test1234'); + await OnboardingPage.enterPasswordConfirm($, 'Test1234'); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.linkWalletAndRolesButton).tap(); + await $(OnboardingPage.chooseCardanoWalletButton).tap(); + await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.linkWalletInfo, + ); + }, + ); }, ); } diff --git a/catalyst_voices/apps/voices/lib/pages/registration/wallet_link/stage/intro_panel.dart b/catalyst_voices/apps/voices/lib/pages/registration/wallet_link/stage/intro_panel.dart index 7a1de2efca9..512fe5f4b80 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/wallet_link/stage/intro_panel.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/wallet_link/stage/intro_panel.dart @@ -20,6 +20,7 @@ class IntroPanel extends StatelessWidget { ), const Spacer(), VoicesFilledButton( + key: const Key('ChooseCardanoWalletButton'), leading: VoicesAssets.icons.wallet.buildIcon(), onTap: () { RegistrationCubit.of(context).nextStep(); diff --git a/catalyst_voices/apps/voices/lib/pages/registration/wallet_link/stage/select_wallet_panel.dart b/catalyst_voices/apps/voices/lib/pages/registration/wallet_link/stage/select_wallet_panel.dart index 0a962b81d54..d4520daab78 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/wallet_link/stage/select_wallet_panel.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/wallet_link/stage/select_wallet_panel.dart @@ -60,6 +60,7 @@ class _SelectWalletPanelState extends State { ), const SizedBox(height: 10), VoicesTextButton( + key: const Key('SeeAllSupportedWalletsButton'), trailing: VoicesAssets.icons.externalLink.buildIcon(), onTap: () async => _launchSupportedWalletsLink(), child: Text(context.l10n.seeAllSupportedWallets), @@ -101,6 +102,7 @@ class _BlocWallets extends StatelessWidget { @override Widget build(BuildContext context) { return BlocWalletLinkBuilder, Exception>?>( + key: const Key('WalletsLinkBuilder'), selector: (state) => state.wallets, builder: (context, state) { return _Wallets( From 8a5f74f22f92fb124fa1042ad5b2b3f70ae3e68a Mon Sep 17 00:00:00 2001 From: januszjanus Date: Mon, 13 Jan 2025 13:42:29 +0100 Subject: [PATCH 11/16] styling fix --- .../voices/integration_test/pageobject/onboarding_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index 108cc5d39f2..27fe1a0b0d4 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -520,7 +520,7 @@ class OnboardingPage { expect( $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, T.get( - 'Select the Cardano wallet to link\nto your Catalyst Keychain.'), + 'Select the Cardano wallet to link\nto your Catalyst Keychain.',), ); expect( $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, From 5890542fcf9d609c7833a24c368a54819a9d2592 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Mon, 13 Jan 2025 13:50:50 +0100 Subject: [PATCH 12/16] styling fix --- .../voices/integration_test/pageobject/onboarding_page.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index 27fe1a0b0d4..d015f69a468 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -520,7 +520,8 @@ class OnboardingPage { expect( $(registrationDetailsPanel).$(registrationDetailsTitle).$(Text).text, T.get( - 'Select the Cardano wallet to link\nto your Catalyst Keychain.',), + 'Select the Cardano wallet to link\nto your Catalyst Keychain.', + ), ); expect( $(registrationDetailsPanel).$(registrationDetailsBody).$(Text).text, From 8570c91b6e9f1934cc3f058f12c184132a410908 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Wed, 15 Jan 2025 13:41:55 +0100 Subject: [PATCH 13/16] 2 restore flow tests --- .../pageobject/onboarding_page.dart | 42 +++++++++++++++++- .../suites/onboarding_test.dart | 44 +++++++++++++++++++ .../recover/recover_method_panel.dart | 5 +++ .../widgets/registration_tile.dart | 1 + 4 files changed, 90 insertions(+), 2 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart index d015f69a468..ab8291b3988 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -46,6 +46,14 @@ class OnboardingPage { static const chooseCardanoWalletButton = Key('ChooseCardanoWalletButton'); static const seeAllSupportedWalletsBtn = Key('SeeAllSupportedWalletsButton'); static const walletsLinkBuilder = Key('WalletsLinkBuilder'); + static const recoverKeychainMethodsTitle = Key('RecoverKeychainMethodsTitle'); + static const keychainNotFoundIndicator = Key('KeychainNotFoundIndicator'); + static const onDeviceKeychainsWidget = Key('BlocOnDeviceKeychains'); + static const recoverKeychainMethodsSubtitle = + Key('RecoverKeychainMethodsSubtitle'); + static const recoverKeychainMethodsListTitle = + Key('RecoverKeychainMethodsListTitle'); + static const registrationTileTitle = Key('RegistrationTileTitle'); static Future writedownSeedPhraseNumber( PatrolTester $, @@ -290,7 +298,16 @@ class OnboardingPage { ); break; case RegistrationState.keychainRestoreChoice: - throw UnimplementedError(); + expect( + await infoPartHeaderTitleText($), + T.get('Restore Catalyst keychain'), + ); + expect(infoPartTaskPicture($), findsOneWidget); + expect( + $(registrationInfoPanel).$(CommonPage.decorData).$(Text).text, + T.get('Learn More'), + ); + break; case RegistrationState.keychainRestoreMnemonicInfo: throw UnimplementedError(); case RegistrationState.keychainRestoreMnemonicInput: @@ -494,7 +511,28 @@ class OnboardingPage { ); break; case RegistrationState.keychainRestoreChoice: - throw UnimplementedError(); + expect( + $(recoverKeychainMethodsTitle).text, + T.get('Restore your Catalyst Keychain'), + ); + expect( + $(onDeviceKeychainsWidget).$(keychainNotFoundIndicator).$(Text).text, + T.get('No Catalyst Keychain found
on this device.'), + ); + expect( + $(recoverKeychainMethodsSubtitle).text, + T.get('Not to worry, in the next step you can choose the recovery ' + 'option that applies to you for this device!'), + ); + expect( + $(recoverKeychainMethodsListTitle).text, + T.get('How do you want Restore your Catalyst Keychain?'), + ); + expect( + $(registrationTileTitle).text, + T.get('12 security words'), + ); + break; case RegistrationState.keychainRestoreMnemonicInfo: throw UnimplementedError(); case RegistrationState.keychainRestoreMnemonicInput: diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 520e0e2ee99..4cbd1532705 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -715,6 +715,50 @@ void main() async { ); }, ); + + patrolWidgetTest( + 'visitor - restore - keychain choice screen looks OK', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.keychainRestoreChoice, + ); + }, + ); + + patrolWidgetTest( + 'visitor - restore - keychain choice screen back button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); + await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.getStarted, + ); + }, + ); + }, + skip: true, + ); + + patrolWidgetTest( + 'visitor - restore - keychain choice screen looks OK', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.keychainRestoreChoice, + ); }, ); } diff --git a/catalyst_voices/apps/voices/lib/pages/registration/recover/recover_method_panel.dart b/catalyst_voices/apps/voices/lib/pages/registration/recover/recover_method_panel.dart index eb6b9c49d0c..93697d74aba 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/recover/recover_method_panel.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/recover/recover_method_panel.dart @@ -24,6 +24,7 @@ class RecoverMethodPanel extends StatelessWidget { children: [ const SizedBox(height: 24), Text( + key: const Key('RecoverKeychainMethodsTitle'), context.l10n.recoverKeychainMethodsTitle, style: theme.textTheme.titleMedium?.copyWith(color: colorLvl1), ), @@ -31,11 +32,13 @@ class RecoverMethodPanel extends StatelessWidget { _BlocOnDeviceKeychains(onUnlockTap: _unlockKeychain), const SizedBox(height: 12), Text( + key: const Key('RecoverKeychainMethodsSubtitle'), context.l10n.recoverKeychainMethodsSubtitle, style: theme.textTheme.bodyMedium?.copyWith(color: colorLvl1), ), const SizedBox(height: 32), Text( + key: const Key('RecoverKeychainMethodsListTitle'), context.l10n.recoverKeychainMethodsListTitle, style: theme.textTheme.titleSmall?.copyWith(color: colorLvl0), ), @@ -89,6 +92,7 @@ class _BlocOnDeviceKeychains extends StatelessWidget { @override Widget build(BuildContext context) { return BlocRecoverBuilder( + key: const Key('BlocOnDeviceKeychains'), selector: (state) => state.foundKeychain, builder: (context, state) { return _OnDeviceKeychains( @@ -151,6 +155,7 @@ class _KeychainNotFoundIndicator extends StatelessWidget { @override Widget build(BuildContext context) { return VoicesIndicator( + key: const Key('KeychainNotFoundIndicator'), type: VoicesIndicatorType.error, icon: VoicesAssets.icons.exclamation, message: Text( diff --git a/catalyst_voices/apps/voices/lib/pages/registration/widgets/registration_tile.dart b/catalyst_voices/apps/voices/lib/pages/registration/widgets/registration_tile.dart index 0db8b0ed560..dca3b9d14a6 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/widgets/registration_tile.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/widgets/registration_tile.dart @@ -47,6 +47,7 @@ class RegistrationTile extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ Text( + key: const Key('RegistrationTileTitle'), title, maxLines: 2, overflow: TextOverflow.ellipsis, From eb9732dbee535694e510a9e84a1b31c24570f0e6 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 16 Jan 2025 12:35:37 +0100 Subject: [PATCH 14/16] pr comments --- .../integration_test/suites/account_test.dart | 3 +- .../integration_test/suites/app_test.dart | 15 ++-- .../suites/onboarding_test.dart | 85 ++++++++++++------- .../integration_test/utils/constants.dart | 9 ++ 4 files changed, 71 insertions(+), 41 deletions(-) create mode 100644 catalyst_voices/apps/voices/integration_test/utils/constants.dart diff --git a/catalyst_voices/apps/voices/integration_test/suites/account_test.dart b/catalyst_voices/apps/voices/integration_test/suites/account_test.dart index 6bae0391148..61a460338a9 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/account_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/account_test.dart @@ -9,6 +9,7 @@ import 'package:patrol_finders/patrol_finders.dart'; import '../pageobject/account_dropdown_page.dart'; import '../pageobject/app_bar_page.dart'; import '../pageobject/overall_spaces_page.dart'; +import '../utils/constants.dart'; void main() async { late final GoRouter router; @@ -34,7 +35,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration);; await $(AppBarPage.accountPopupBtn).tap(); await AccountDropdownPage.accountDropdownLooksAsExpected($); await AccountDropdownPage.accountDropdownContainsSpecificData($); diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index 11d0f9a6d30..66816758d69 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -10,6 +10,7 @@ import 'package:patrol_finders/patrol_finders.dart'; import '../pageobject/app_bar_page.dart'; import '../pageobject/overall_spaces_page.dart'; import '../pageobject/spaces_drawer_page.dart'; +import '../utils/constants.dart'; import '../utils/selector_utils.dart'; void main() async { @@ -34,7 +35,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); expect($(AppBarPage.spacesDrawerButton).exists, false); }, ); @@ -46,7 +47,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); SpacesDrawerPage.commonElementsLookAsExpected($); @@ -66,7 +67,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); // iterate thru spaces by clicking next @@ -92,7 +93,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); SpacesDrawerPage.commonElementsLookAsExpected($); for (final space in Space.values) { @@ -107,7 +108,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); await $(SpacesDrawerPage.allSpacesBtn).tap(); expect($(OverallSpacesPage.spacesListView), findsOneWidget); @@ -119,7 +120,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); await $(SpacesDrawerPage.allSpacesBtn).tap(); expect($(OverallSpacesPage.spacesListView), findsOneWidget); @@ -138,7 +139,7 @@ void main() async { }; await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); for (final space in Space.values) { await $(SpacesDrawerPage.chooserItem(space)).tap(); diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 4cbd1532705..9a221afbed8 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -11,6 +11,7 @@ import '../pageobject/onboarding_page.dart'; import '../pageobject/overall_spaces_page.dart'; import '../types/password_validation_states.dart'; import '../types/registration_state.dart'; +import '../utils/constants.dart'; import '../utils/test_context.dart'; import '../utils/translations_utils.dart'; @@ -39,7 +40,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await $(AppBarPage.getStartedBtn).tap(); expect($(OnboardingPage.registrationInfoPanel), findsOneWidget); expect($(OnboardingPage.registrationDetailsPanel), findsOneWidget); @@ -51,7 +52,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.onboardingScreenLooksAsExpected( $, RegistrationState.getStarted, @@ -64,7 +65,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.closeBtn($).tap(); expect($(OnboardingPage.registrationDialog), findsNothing); }, @@ -75,7 +76,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( $, @@ -89,7 +90,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); await OnboardingPage.registrationInfoPanelLooksAsExpected( @@ -104,7 +105,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( @@ -119,7 +120,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); @@ -134,7 +135,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -149,7 +150,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -166,7 +167,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -183,7 +184,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -201,7 +202,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -220,7 +221,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -228,6 +229,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( $, @@ -241,7 +243,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -261,7 +263,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -270,6 +272,8 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531//temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); OnboardingPage.voicesButtonIsEnabled($, OnboardingPage.nextButton); @@ -281,7 +285,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -290,6 +294,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -305,7 +310,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -314,6 +319,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -330,7 +336,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -339,6 +345,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -355,7 +362,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -364,6 +371,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -382,7 +390,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -391,6 +399,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -408,7 +417,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -417,6 +426,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -435,7 +445,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -444,6 +454,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -472,7 +483,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -481,6 +492,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -505,7 +517,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -514,6 +526,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -537,7 +550,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -546,6 +559,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -569,7 +583,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -578,6 +592,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -599,7 +614,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -608,6 +623,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -628,7 +644,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -637,6 +653,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -658,7 +675,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -667,6 +684,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -689,7 +707,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -698,6 +716,7 @@ void main() async { await $(OnboardingPage.nextButton).tap(); await $(OnboardingPage.nextButton).tap(); //temporary: remove reset when seeds are no longer prefilled + //https://github.com/input-output-hk/catalyst-voices/issues/1531 await $(OnboardingPage.resetButton).tap(); await OnboardingPage.enterStoredSeedPhrases($); await $(OnboardingPage.nextButton).tap(); @@ -721,7 +740,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( $, @@ -735,7 +754,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); await OnboardingPage.onboardingScreenLooksAsExpected( @@ -753,7 +772,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); + .tap(settleTimeout: TimeConstants.long.duration); await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( $, diff --git a/catalyst_voices/apps/voices/integration_test/utils/constants.dart b/catalyst_voices/apps/voices/integration_test/utils/constants.dart new file mode 100644 index 00000000000..27fa1d5edb9 --- /dev/null +++ b/catalyst_voices/apps/voices/integration_test/utils/constants.dart @@ -0,0 +1,9 @@ +enum TimeConstants { + veryShort(Duration(milliseconds: 500)), + short(Duration(seconds: 2)), + long(Duration(minutes: 10)); + + final Duration duration; + + const TimeConstants(this.duration); +} From c6501baf4c571c77884a5c3b9604065fe4d3c080 Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 16 Jan 2025 12:37:18 +0100 Subject: [PATCH 15/16] bit --- .../apps/voices/integration_test/suites/account_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalyst_voices/apps/voices/integration_test/suites/account_test.dart b/catalyst_voices/apps/voices/integration_test/suites/account_test.dart index 61a460338a9..59003c6f79a 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/account_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/account_test.dart @@ -35,7 +35,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration);; + .tap(settleTimeout: TimeConstants.long.duration); await $(AppBarPage.accountPopupBtn).tap(); await AccountDropdownPage.accountDropdownLooksAsExpected($); await AccountDropdownPage.accountDropdownContainsSpecificData($); From ea0b1ccbfd68dc7793eee48f509c88392053d9be Mon Sep 17 00:00:00 2001 From: januszjanus Date: Thu, 16 Jan 2025 12:39:41 +0100 Subject: [PATCH 16/16] cleanup --- .../integration_test/suites/account_test.dart | 2 +- .../integration_test/suites/app_test.dart | 14 ++-- .../suites/onboarding_test.dart | 67 +++++++++---------- .../integration_test/utils/constants.dart | 4 +- 4 files changed, 43 insertions(+), 44 deletions(-) diff --git a/catalyst_voices/apps/voices/integration_test/suites/account_test.dart b/catalyst_voices/apps/voices/integration_test/suites/account_test.dart index 59003c6f79a..3ebf83182d4 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/account_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/account_test.dart @@ -35,7 +35,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await $(AppBarPage.accountPopupBtn).tap(); await AccountDropdownPage.accountDropdownLooksAsExpected($); await AccountDropdownPage.accountDropdownContainsSpecificData($); diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart index 66816758d69..b52e4d56bf3 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -35,7 +35,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); expect($(AppBarPage.spacesDrawerButton).exists, false); }, ); @@ -47,7 +47,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); SpacesDrawerPage.commonElementsLookAsExpected($); @@ -67,7 +67,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); // iterate thru spaces by clicking next @@ -93,7 +93,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); SpacesDrawerPage.commonElementsLookAsExpected($); for (final space in Space.values) { @@ -108,7 +108,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); await $(SpacesDrawerPage.allSpacesBtn).tap(); expect($(OverallSpacesPage.spacesListView), findsOneWidget); @@ -120,7 +120,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); await $(SpacesDrawerPage.allSpacesBtn).tap(); expect($(OverallSpacesPage.spacesListView), findsOneWidget); @@ -139,7 +139,7 @@ void main() async { }; await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); for (final space in Space.values) { await $(SpacesDrawerPage.chooserItem(space)).tap(); diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart index 9a221afbed8..62d832c33cc 100644 --- a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -40,7 +40,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await $(AppBarPage.getStartedBtn).tap(); expect($(OnboardingPage.registrationInfoPanel), findsOneWidget); expect($(OnboardingPage.registrationDetailsPanel), findsOneWidget); @@ -52,7 +52,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.onboardingScreenLooksAsExpected( $, RegistrationState.getStarted, @@ -65,7 +65,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.closeBtn($).tap(); expect($(OnboardingPage.registrationDialog), findsNothing); }, @@ -76,7 +76,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( $, @@ -90,7 +90,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); await OnboardingPage.registrationInfoPanelLooksAsExpected( @@ -105,7 +105,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( @@ -120,7 +120,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); @@ -135,7 +135,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -150,7 +150,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -167,7 +167,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -184,7 +184,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -202,7 +202,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -221,7 +221,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -243,7 +243,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -263,7 +263,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -285,7 +285,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -310,7 +310,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -336,7 +336,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -362,7 +362,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -390,7 +390,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -417,7 +417,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -445,7 +445,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -483,7 +483,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -517,7 +517,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -550,7 +550,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -583,7 +583,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -614,7 +614,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -644,7 +644,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -675,7 +675,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -707,7 +707,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedCreateNewBtn($).tap(); await OnboardingPage.detailsPartCreateKeychainBtn($).tap(); await $(OnboardingPage.nextButton).tap(); @@ -740,7 +740,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( $, @@ -754,7 +754,7 @@ void main() async { (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + .tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); await OnboardingPage.onboardingScreenLooksAsExpected( @@ -771,8 +771,7 @@ void main() async { 'visitor - restore - keychain choice screen looks OK', (PatrolTester $) async { await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: TimeConstants.long.duration); + await $(AppBarPage.getStartedBtn).tap(settleTimeout: Time.long.duration); await OnboardingPage.detailsPartGetStartedRecoverBtn($).tap(); await OnboardingPage.onboardingScreenLooksAsExpected( $, diff --git a/catalyst_voices/apps/voices/integration_test/utils/constants.dart b/catalyst_voices/apps/voices/integration_test/utils/constants.dart index 27fa1d5edb9..b03074474cd 100644 --- a/catalyst_voices/apps/voices/integration_test/utils/constants.dart +++ b/catalyst_voices/apps/voices/integration_test/utils/constants.dart @@ -1,9 +1,9 @@ -enum TimeConstants { +enum Time { veryShort(Duration(milliseconds: 500)), short(Duration(seconds: 2)), long(Duration(minutes: 10)); final Duration duration; - const TimeConstants(this.duration); + const Time(this.duration); }