diff --git a/catalyst_voices/apps/voices/integration_test/all_test.dart b/catalyst_voices/apps/voices/integration_test/all_test.dart index 550f5872a25..ea42d30f7bc 100644 --- a/catalyst_voices/apps/voices/integration_test/all_test.dart +++ b/catalyst_voices/apps/voices/integration_test/all_test.dart @@ -2,8 +2,8 @@ import 'package:catalyst_voices/configs/bootstrap.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; -import 'app_test.dart' as app_test; -import 'onboarding_test.dart' as onboarding_test; +import 'suites/app_test.dart' as app_test; +import 'suites/onboarding_test.dart' as onboarding_test; void main() async { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); diff --git a/catalyst_voices/apps/voices/integration_test/app_test.dart b/catalyst_voices/apps/voices/integration_test/app_test.dart deleted file mode 100644 index 3aabd9b930b..00000000000 --- a/catalyst_voices/apps/voices/integration_test/app_test.dart +++ /dev/null @@ -1,163 +0,0 @@ -import 'package:catalyst_voices/app/view/app.dart'; -import 'package:catalyst_voices/configs/bootstrap.dart'; -import 'package:catalyst_voices/routes/routes.dart'; -import 'package:catalyst_voices_models/catalyst_voices_models.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:go_router/go_router.dart'; -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/selector_utils.dart'; - -void main() async { - late final GoRouter router; - - setUpAll(() async { - router = buildAppRouter(); - }); - - setUp(() async { - await registerDependencies(config: const AppConfig()); - router.go(const DiscoveryRoute().location); - }); - - tearDown(() async { - await restartDependencies(); - }); - - group( - 'Spaces drawer -', - () { - patrolWidgetTest( - 'visitor - no drawer button', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); - expect($(AppBarPage.spacesDrawerButton).exists, false); - }, - ); - - patrolWidgetTest( - 'guest - chooser - clicking on icons works correctly', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - SpacesDrawerPage.commonElementsLookAsExpected($); - - // iterate thru spaces by clicking on spaces icons directly - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await SpacesDrawerPage.guestLooksAsExpected($, space); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - }, - ); - - patrolWidgetTest( - 'guest - chooser - next,previous buttons work correctly', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - - // iterate thru spaces by clicking next - for (final space in Space.values) { - await SpacesDrawerPage.guestLooksAsExpected($, space); - await $(SpacesDrawerPage.chooserNextBtn).tap(); - SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); - - // iterate thru spaces by clicking previous - for (final space in Space.values.reversed) { - await SpacesDrawerPage.guestLooksAsExpected($, space); - await $(SpacesDrawerPage.chooserPrevBtn).tap(); - SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); - } - SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); - }, - ); - - patrolWidgetTest( - 'user - chooser - clicking on icons works correctly', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - SpacesDrawerPage.commonElementsLookAsExpected($); - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await SpacesDrawerPage.userLooksAsExpected($, space); - } - }, - ); - - patrolWidgetTest( - 'guest - chooser - all spaces button works', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.guestShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - await $(SpacesDrawerPage.allSpacesBtn).tap(); - expect($(OverallSpacesPage.spacesListView), findsOneWidget); - }, - ); - - patrolWidgetTest( - 'user - chooser - all spaces button works', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - await $(SpacesDrawerPage.allSpacesBtn).tap(); - expect($(OverallSpacesPage.spacesListView), findsOneWidget); - }, - ); - }, - ); - - patrolWidgetTest( - 'Drawer tooltip - check tooltip text', - (PatrolTester $) async { - final spaceToTooltipText = { - Space.discovery: 'Discovery space', - Space.workspace: 'Workspace', - Space.voting: 'Voting space', - Space.fundedProjects: 'Funded project space', - Space.treasury: 'Treasury space', - }; - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.userShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); - await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); - for (final space in Space.values) { - await $(SpacesDrawerPage.chooserItem(space)).tap(); - await $(SpacesDrawerPage.chooserIcon(space)).longPress(); - await Future.delayed(const Duration(seconds: 1)); - final expectedText = spaceToTooltipText[space]; - final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); - final tooltipElement = find.descendant( - of: chooserItem, - matching: find.byKey(SpacesDrawerPage.tooltipElement), - ); - final tooltipTextElement = find.descendant( - of: tooltipElement, - matching: find.byType(Text), - ); - - final tooltipText = $(tooltipTextElement).text; - expect(tooltipText, expectedText); - } - }, - ); -} diff --git a/catalyst_voices/apps/voices/integration_test/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/onboarding_test.dart deleted file mode 100644 index af666e9739c..00000000000 --- a/catalyst_voices/apps/voices/integration_test/onboarding_test.dart +++ /dev/null @@ -1,52 +0,0 @@ -import 'package:catalyst_voices/app/view/app.dart'; -import 'package:catalyst_voices/configs/bootstrap.dart'; -import 'package:catalyst_voices/routes/routes.dart'; -import 'package:catalyst_voices_models/catalyst_voices_models.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:go_router/go_router.dart'; -import 'package:patrol_finders/patrol_finders.dart'; - -import 'pageobject/app_bar_page.dart'; -import 'pageobject/onboarding_page.dart'; -import 'pageobject/overall_spaces_page.dart'; - -void main() async { - late final GoRouter router; - - setUpAll(() async { - router = buildAppRouter(); - }); - - setUp(() async { - await registerDependencies(config: const AppConfig()); - router.go(const DiscoveryRoute().location); - }); - - tearDown(() async { - await restartDependencies(); - }); - - group('Onboarding -', () { - patrolWidgetTest( - 'visitor - get started button works', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(OverallSpacesPage.visitorShortcutBtn) - .tap(settleTimeout: const Duration(seconds: 10)); - await $(AppBarPage.getStartedBtn).tap(); - expect($(OnboardingPage.registrationInfoPanel), findsOneWidget); - expect($(OnboardingPage.registrationDetailsPanel), findsOneWidget); - }, - ); - - patrolWidgetTest( - 'visitor - get started screen looks as expected', - (PatrolTester $) async { - await $.pumpWidgetAndSettle(App(routerConfig: router)); - await $(AppBarPage.getStartedBtn) - .tap(settleTimeout: const Duration(seconds: 10)); - await OnboardingPage.getStartedScreenLooksAsExpected($); - }, - ); - }); -} diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/app_bar_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/app_bar_page.dart index ab5528f9136..7c24a975f07 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/app_bar_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/app_bar_page.dart @@ -1,5 +1,3 @@ -library dashboard_page; - import 'package:flutter/material.dart'; class AppBarPage { 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 8581d62e1a4..6732e683fb6 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/common_page.dart @@ -1,5 +1,3 @@ -library dashboard_page; - import 'package:flutter/material.dart'; class CommonPage { 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 8b27bbfe509..5a10edf034b 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/onboarding_page.dart @@ -1,14 +1,14 @@ -library dashboard_page; - import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:patrol_finders/patrol_finders.dart'; import '../types/registration_state.dart'; +import '../utils/selector_utils.dart'; import '../utils/translations_utils.dart'; import 'common_page.dart'; class OnboardingPage { + static const registrationDialog = Key('RegistrationDialog'); static const registrationInfoPanel = Key('RegistrationInfoPanel'); static const registrationDetailsPanel = Key('RegistrationDetailsPanel'); static const registrationInfoLearnMoreButton = Key('LearnMoreButton'); @@ -19,6 +19,54 @@ class OnboardingPage { static const registrationInfoTaskPicture = Key('TaskPictureIconBox'); static const registrationDetailsTitle = Key('RegistrationDetailsTitle'); static const registrationDetailsBody = Key('RegistrationDetailsBody'); + static const backButton = Key('BackButton'); + static const nextButton = Key('NextButton'); + static const progressBar = Key('ProgressBar'); + static const downloadSeedPhraseButton = Key('DownloadSeedPhraseButton'); + static const seedPhraseStoredCheckbox = Key('SeedPhraseStoredCheckbox'); + static const uploadKeyButton = Key('UploadKeyButton'); + static const resetButton = Key('ResetButton'); + + static Future writedownSeedPhraseNumber( + PatrolTester $, + int index, + ) async { + final rawNumber = $(Key('SeedPhrase${index}CellKey')) + .$(const Key('SeedPhraseNumber')) + .text; + return int.parse(rawNumber!.split('.').first); + } + + static Future writedownSeedPhraseWord( + PatrolTester $, + int index, + ) async { + final rawNumber = + $(Key('SeedPhrase${index}CellKey')).$(const Key('SeedPhraseWord')).text; + return int.parse(rawNumber!.split('.').first); + } + + static Future inputSeedPhraseCompleterWord( + PatrolTester $, + int index, + ) async { + final seedWord = await getChildNodeText( + $, + $(Key('CompleterSeedPhrase${index}CellKey')).$(CommonPage.decoratorData), + ); + return seedWord!; + } + + static Future inputSeedPhrasePickerWord( + PatrolTester $, + int index, + ) async { + final seedWord = await getChildNodeText( + $, + $(Key('PickerSeedPhrase${index + 1}CellKey')), + ); + return seedWord!; + } static Future infoPartHeaderTitleText(PatrolTester $) async { return $(registrationInfoPanel).$(headerTitle).text; @@ -32,9 +80,18 @@ class OnboardingPage { return $(registrationInfoPanel).$(headerBody).text; } - static Future infoPartLearnMoreButtonText(PatrolTester $) async { + static Future closeBtn(PatrolTester $) async { + return $(registrationDialog) + .$(CommonPage.dialogCloseButton) + .waitUntilVisible(); + } + + static Future getChildNodeText( + PatrolTester $, + FinderBase parent, + ) async { final child = find.descendant( - of: $(registrationInfoPanel).$(CommonPage.decoratorData), + of: parent, matching: find.byType(Text), ); return $(child).text; @@ -48,20 +105,26 @@ class OnboardingPage { return child; } - static String? detailsPartGetStartedTitle(PatrolTester $) { + static void voicesFilledButtonIsEnabled( + PatrolTester $, + Key button, + ) { final child = find.descendant( - of: $(registrationDetailsPanel).$(registrationDetailsTitle), - matching: find.byType(Text), + of: $(button), + matching: find.byType(FilledButton), ); - return $(child).text; + SelectorUtils.isEnabled($, $(child)); } - static String? detailsPartGetStartedBody(PatrolTester $) { + static void voicesFilledButtonIsDisabled( + PatrolTester $, + Key button, + ) { final child = find.descendant( - of: $(registrationDetailsPanel).$(registrationDetailsBody), - matching: find.byType(Text), + of: $(button), + matching: find.byType(FilledButton), ); - return $(child).text; + SelectorUtils.isDisabled($, $(child)); } static String? detailsPartGetStartedQuestionText(PatrolTester $) { @@ -72,7 +135,8 @@ class OnboardingPage { PatrolTester $, ) async { return $(registrationDetailsPanel) - .$(const Key('CreateAccountType.createNew')); + .$(const Key('CreateAccountType.createNew')) + .waitUntilVisible(); } static Future detailsPartGetStartedRecoverBtn( @@ -82,12 +146,21 @@ class OnboardingPage { .$(const Key('CreateAccountType.recover')); } - static Future getStartedScreenLooksAsExpected(PatrolTester $) async { - await registrationInfoPanelLooksAsExpected($, RegistrationState.getStarted); - await registrationDetailsPanelLooksAsExpected( - $, - RegistrationState.getStarted, - ); + static Future detailsPartCreateKeychainBtn( + PatrolTester $, + ) async { + return $(registrationDetailsPanel) + .$(const Key('CreateKeychainButton')) + .waitUntilVisible(); + } + + static Future onboardingScreenLooksAsExpected( + PatrolTester $, + RegistrationState step, + ) async { + await registrationInfoPanelLooksAsExpected($, step); + await registrationDetailsPanelLooksAsExpected($, step); + expect(await closeBtn($), findsOneWidget); } static Future registrationInfoPanelLooksAsExpected( @@ -97,63 +170,275 @@ class OnboardingPage { switch (step) { case RegistrationState.getStarted: expect(await infoPartHeaderTitleText($), T.get('Get Started')); - expect(await infoPartLearnMoreButtonText($), T.get('Learn More')); expect(infoPartTaskPicture($), findsOneWidget); + expect( + await getChildNodeText( + $, + $(registrationInfoPanel).$(CommonPage.decoratorData), + ), + T.get('Learn More'), + ); break; - case RegistrationState.checkYourKeychain: - throw UnimplementedError(); - case RegistrationState.createKeychain: - throw UnimplementedError(); + case RegistrationState.createKeychainInfo: case RegistrationState.keychainCreated: + expect(await infoPartHeaderTitleText($), T.get('Catalyst Keychain')); + expect(infoPartTaskPicture($), findsOneWidget); + expect($(progressBar), findsOneWidget); + expect( + await getChildNodeText( + $, + $(registrationInfoPanel).$(CommonPage.decoratorData), + ), + T.get('Learn More'), + ); + break; + case RegistrationState.keychainCreateMnemonicWritedown: + expect(await infoPartHeaderTitleText($), T.get('Catalyst Keychain')); + expect( + await infoPartHeaderSubtitleText($), + T.get('Write down your 12 Catalyst 
security words'), + ); + expect( + await infoPartHeaderBodyText($), + T.get( + 'Make sure you create an offline backup of your recovery phrase ' + 'as well.', + ), + ); + expect(infoPartTaskPicture($), findsOneWidget); + expect($(progressBar), findsOneWidget); + expect( + await getChildNodeText( + $, + $(registrationInfoPanel).$(CommonPage.decoratorData), + ), + T.get('Learn More'), + ); + break; + case RegistrationState.keychainCreateMnemonicInputInfo: + expect(await infoPartHeaderTitleText($), T.get('Catalyst Keychain')); + expect(infoPartTaskPicture($), findsOneWidget); + expect($(progressBar), findsOneWidget); + expect( + await getChildNodeText( + $, + $(registrationInfoPanel).$(CommonPage.decoratorData), + ), + T.get('Learn More'), + ); + case RegistrationState.keychainCreateMnemonicInput: + expect(await infoPartHeaderTitleText($), T.get('Catalyst Keychain')); + expect( + await infoPartHeaderSubtitleText($), + T.get('Input your Catalyst security keys'), + ); + expect( + await infoPartHeaderBodyText($), + T.get( + 'Select your 12 written down words in 
the correct order.', + ), + ); + expect(infoPartTaskPicture($), findsOneWidget); + expect($(progressBar), findsOneWidget); + expect( + await getChildNodeText( + $, + $(registrationInfoPanel).$(CommonPage.decoratorData), + ), + T.get('Learn More'), + ); + break; + case RegistrationState.keychainCreateMnemonicVerified: throw UnimplementedError(); - case RegistrationState.keychainRestoreInfo: + case RegistrationState.keychainRestoreChoice: throw UnimplementedError(); - case RegistrationState.keychainRestoreInput: + case RegistrationState.keychainRestoreMnemonicInfo: throw UnimplementedError(); - case RegistrationState.keychainRestoreStart: + case RegistrationState.keychainRestoreMnemonicInput: throw UnimplementedError(); case RegistrationState.keychainRestoreSuccess: throw UnimplementedError(); - case RegistrationState.mnemonicInput: + case RegistrationState.passwordInfo: + throw UnimplementedError(); + case RegistrationState.passwordInput: throw UnimplementedError(); - case RegistrationState.mnemonicVerified: + case RegistrationState.keychainCreateSuccess: throw UnimplementedError(); - case RegistrationState.mnemonicWritedown: + case RegistrationState.linkWalletInfo: throw UnimplementedError(); - case RegistrationState.passwordInfo: + case RegistrationState.linkWalletSelect: throw UnimplementedError(); - case RegistrationState.passwordInput: + case RegistrationState.linkWalletSuccess: + throw UnimplementedError(); + case RegistrationState.rolesSelect: + throw UnimplementedError(); + case RegistrationState.rolesConfirm: + throw UnimplementedError(); + case RegistrationState.rolesSummary: + throw UnimplementedError(); + case RegistrationState.keychainTransactionPending: + throw UnimplementedError(); + case RegistrationState.accountCreationSuccess: throw UnimplementedError(); } } static Future registrationDetailsPanelLooksAsExpected( PatrolTester $, - RegistrationState getStarted, + RegistrationState step, ) async { - expect( - detailsPartGetStartedTitle($), - T.get('Welcome to Catalyst'), - ); - expect( - detailsPartGetStartedBody($), - isNotEmpty, - ); - expect( - detailsPartGetStartedQuestionText($), - T.get('What do you want to do?'), - ); - expect( - await detailsPartGetStartedCreateNewBtn($), - findsOneWidget, - ); - expect( - await detailsPartGetStartedRecoverBtn($), - findsOneWidget, - ); - expect( - $(CommonPage.dialogCloseButton), - findsOneWidget, - ); + switch (step) { + case RegistrationState.getStarted: + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsTitle), + ), + T.get('Welcome to Catalyst'), + ); + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsBody), + ), + isNotEmpty, + ); + expect( + detailsPartGetStartedQuestionText($), + T.get('What do you want to do?'), + ); + expect(await detailsPartGetStartedCreateNewBtn($), findsOneWidget); + expect(await detailsPartGetStartedRecoverBtn($), findsOneWidget); + break; + case RegistrationState.createKeychainInfo: + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsTitle), + ), + T.get('Create your Catalyst Keychain'), + ); + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsBody), + ), + isNotEmpty, + ); + expect(await detailsPartCreateKeychainBtn($), findsOneWidget); + expect($(backButton), findsOneWidget); + break; + case RegistrationState.keychainCreated: + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsTitle), + ), + T.get('Great! Your Catalyst Keychain 
has been created.'), + ); + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsBody), + ), + isNotEmpty, + ); + expect($(backButton), findsOneWidget); + expect($(nextButton), findsOneWidget); + break; + case RegistrationState.keychainCreateMnemonicWritedown: + await writedownSeedPhrasesAreDisplayed($); + expect($(downloadSeedPhraseButton), findsOneWidget); + expect( + await getChildNodeText( + $, + $(downloadSeedPhraseButton).$(CommonPage.decoratorData), + ), + T.get('Download Catalyst key'), + ); + expect($(seedPhraseStoredCheckbox), findsOneWidget); + expect( + await getChildNodeText($, $(seedPhraseStoredCheckbox)), + T.get('I have written down/downloaded my 12 words'), + ); + expect($(backButton), findsOneWidget); + expect($(nextButton), findsOneWidget); + break; + case RegistrationState.keychainCreateMnemonicInputInfo: + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsTitle), + ), + T.get('Check your Catalyst security keys'), + ); + expect( + await getChildNodeText( + $, + $(registrationDetailsPanel).$(registrationDetailsBody), + ), + isNotEmpty, + ); + break; + case RegistrationState.keychainCreateMnemonicInput: + await inputSeedPhrasesAreDisplayed($); + expect($(uploadKeyButton), findsOneWidget); + expect( + await getChildNodeText( + $, + $(uploadKeyButton).$(CommonPage.decoratorData), + ), + T.get('Upload Catalyst Key'), + ); + expect($(backButton), findsOneWidget); + expect($(nextButton), findsOneWidget); + break; + case RegistrationState.keychainCreateMnemonicVerified: + throw UnimplementedError(); + case RegistrationState.keychainRestoreChoice: + throw UnimplementedError(); + case RegistrationState.keychainRestoreMnemonicInfo: + throw UnimplementedError(); + case RegistrationState.keychainRestoreMnemonicInput: + 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: + throw UnimplementedError(); + case RegistrationState.linkWalletSelect: + throw UnimplementedError(); + case RegistrationState.linkWalletSuccess: + throw UnimplementedError(); + case RegistrationState.rolesSelect: + throw UnimplementedError(); + case RegistrationState.rolesConfirm: + throw UnimplementedError(); + case RegistrationState.rolesSummary: + throw UnimplementedError(); + case RegistrationState.keychainTransactionPending: + throw UnimplementedError(); + case RegistrationState.accountCreationSuccess: + throw UnimplementedError(); + } + } + + static Future writedownSeedPhrasesAreDisplayed(PatrolTester $) async { + for (var i = 0; i < 12; i++) { + expect(await writedownSeedPhraseNumber($, i), i + 1); + expect(await writedownSeedPhraseWord($, i), isNotEmpty); + } + } + + static Future inputSeedPhrasesAreDisplayed(PatrolTester $) async { + for (var i = 0; i < 12; i++) { + expect(await inputSeedPhrasePickerWord($, i), isNotEmpty); + expect(await inputSeedPhraseCompleterWord($, i), isNotEmpty); + } } } diff --git a/catalyst_voices/apps/voices/integration_test/pageobject/overall_spaces_page.dart b/catalyst_voices/apps/voices/integration_test/pageobject/overall_spaces_page.dart index 6ee344a019c..7741cdd4076 100644 --- a/catalyst_voices/apps/voices/integration_test/pageobject/overall_spaces_page.dart +++ b/catalyst_voices/apps/voices/integration_test/pageobject/overall_spaces_page.dart @@ -1,5 +1,3 @@ -library dashboard_page; - import 'package:catalyst_voices_models/catalyst_voices_models.dart'; import 'package:flutter/material.dart'; 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 a8fc82f54f3..b355c211485 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 @@ -1,5 +1,3 @@ -library spaces_drawer_page; - import 'package:catalyst_voices_models/catalyst_voices_models.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/catalyst_voices/apps/voices/integration_test/suites/app_test.dart b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart new file mode 100644 index 00000000000..0a790864aa5 --- /dev/null +++ b/catalyst_voices/apps/voices/integration_test/suites/app_test.dart @@ -0,0 +1,160 @@ +import 'package:catalyst_voices/app/view/app.dart'; +import 'package:catalyst_voices/configs/bootstrap.dart'; +import 'package:catalyst_voices/routes/routes.dart'; +import 'package:catalyst_voices_models/catalyst_voices_models.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:go_router/go_router.dart'; +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/selector_utils.dart'; + +void main() async { + late final GoRouter router; + + setUpAll(() async { + router = buildAppRouter(); + }); + + setUp(() async { + await registerDependencies(config: const AppConfig()); + router.go(const DiscoveryRoute().location); + }); + + tearDown(() async { + await restartDependencies(); + }); + + group('Spaces drawer -', () { + patrolWidgetTest( + 'visitor - no drawer button', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.visitorShortcutBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + expect($(AppBarPage.spacesDrawerButton).exists, false); + }, + ); + + patrolWidgetTest( + 'guest - chooser - clicking on icons works correctly', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + SpacesDrawerPage.commonElementsLookAsExpected($); + + // iterate thru spaces by clicking on spaces icons directly + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await SpacesDrawerPage.guestLooksAsExpected($, space); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + }, + ); + + patrolWidgetTest( + 'guest - chooser - next,previous buttons work correctly', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + + // iterate thru spaces by clicking next + for (final space in Space.values) { + await SpacesDrawerPage.guestLooksAsExpected($, space); + await $(SpacesDrawerPage.chooserNextBtn).tap(); + SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserPrevBtn)); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserNextBtn)); + + // iterate thru spaces by clicking previous + for (final space in Space.values.reversed) { + await SpacesDrawerPage.guestLooksAsExpected($, space); + await $(SpacesDrawerPage.chooserPrevBtn).tap(); + SelectorUtils.isEnabled($, $(SpacesDrawerPage.chooserNextBtn)); + } + SelectorUtils.isDisabled($, $(SpacesDrawerPage.chooserPrevBtn)); + }, + ); + + patrolWidgetTest( + 'user - chooser - clicking on icons works correctly', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + SpacesDrawerPage.commonElementsLookAsExpected($); + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await SpacesDrawerPage.userLooksAsExpected($, space); + } + }, + ); + + patrolWidgetTest( + 'guest - chooser - all spaces button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.guestShortcutBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + await $(SpacesDrawerPage.allSpacesBtn).tap(); + expect($(OverallSpacesPage.spacesListView), findsOneWidget); + }, + ); + + patrolWidgetTest( + 'user - chooser - all spaces button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + await $(SpacesDrawerPage.allSpacesBtn).tap(); + expect($(OverallSpacesPage.spacesListView), findsOneWidget); + }, + ); + + patrolWidgetTest( + 'check tooltip text', + (PatrolTester $) async { + final spaceToTooltipText = { + Space.discovery: 'Discovery space', + Space.workspace: 'Workspace', + Space.voting: 'Voting space', + Space.fundedProjects: 'Funded project space', + Space.treasury: 'Treasury space', + }; + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.userShortcutBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await $(AppBarPage.spacesDrawerButton).waitUntilVisible().tap(); + for (final space in Space.values) { + await $(SpacesDrawerPage.chooserItem(space)).tap(); + await $(SpacesDrawerPage.chooserIcon(space)).longPress(); + await Future.delayed(const Duration(seconds: 1)); + final expectedText = spaceToTooltipText[space]; + final chooserItem = find.byKey(SpacesDrawerPage.chooserItem(space)); + final tooltipElement = find.descendant( + of: chooserItem, + matching: find.byKey(SpacesDrawerPage.tooltipElement), + ); + final tooltipTextElement = find.descendant( + of: tooltipElement, + matching: find.byType(Text), + ); + + final tooltipText = $(tooltipTextElement).text; + expect(tooltipText, expectedText); + } + }, + ); + }); +} diff --git a/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart new file mode 100644 index 00000000000..3a520bc4664 --- /dev/null +++ b/catalyst_voices/apps/voices/integration_test/suites/onboarding_test.dart @@ -0,0 +1,259 @@ +import 'package:catalyst_voices/app/view/app.dart'; +import 'package:catalyst_voices/configs/bootstrap.dart'; +import 'package:catalyst_voices/routes/routes.dart'; +import 'package:catalyst_voices_models/catalyst_voices_models.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:go_router/go_router.dart'; +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/registration_state.dart'; + +void main() async { + late final GoRouter router; + + setUpAll(() async { + router = buildAppRouter(); + }); + + setUp(() async { + await registerDependencies(config: const AppConfig()); + router.go(const DiscoveryRoute().location); + }); + + tearDown(() async { + await restartDependencies(); + }); + + group( + 'Onboarding -', + () { + patrolWidgetTest( + 'visitor - get started button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(OverallSpacesPage.visitorShortcutBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await $(AppBarPage.getStartedBtn).tap(); + expect($(OnboardingPage.registrationInfoPanel), findsOneWidget); + expect($(OnboardingPage.registrationDetailsPanel), findsOneWidget); + }, + ); + + patrolWidgetTest( + 'visitor - get started screen looks OK', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.getStarted, + ); + }, + ); + + patrolWidgetTest( + 'visitor - get started screen close button works', + (PatrolTester $) async { + await $.pumpWidgetAndSettle(App(routerConfig: router)); + await $(AppBarPage.getStartedBtn) + .tap(settleTimeout: const Duration(seconds: 10)); + await OnboardingPage.closeBtn($).tap(); + expect($(OnboardingPage.registrationDialog), findsNothing); + }, + ); + + patrolWidgetTest( + 'visitor - create - keychain 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.onboardingScreenLooksAsExpected( + $, + RegistrationState.createKeychainInfo, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - keychain 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.backButton)).waitUntilVisible().tap(); + await OnboardingPage.registrationInfoPanelLooksAsExpected( + $, + RegistrationState.getStarted, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - keychain created 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.onboardingScreenLooksAsExpected( + $, + RegistrationState.createKeychainInfo, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - keychain created 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.backButton)).waitUntilVisible().tap(); + await OnboardingPage.registrationInfoPanelLooksAsExpected( + $, + RegistrationState.createKeychainInfo, + ); + }, + ); + + patrolWidgetTest('visitor - create - mnemonic writedown 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.onboardingScreenLooksAsExpected( + $, + RegistrationState.keychainCreateMnemonicWritedown, + ); + }); + + patrolWidgetTest( + 'visitor - create - mnemonic writedown 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.backButton)).waitUntilVisible().tap(); + await OnboardingPage.registrationInfoPanelLooksAsExpected( + $, + RegistrationState.keychainCreated, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - mnemonic writedown screen next button is 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.registrationInfoPanelLooksAsExpected( + $, + RegistrationState.keychainCreateMnemonicWritedown, + ); + OnboardingPage.voicesFilledButtonIsDisabled( + $, + OnboardingPage.nextButton, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - mnemonic input 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.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await OnboardingPage.onboardingScreenLooksAsExpected( + $, + RegistrationState.keychainCreateMnemonicInputInfo, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - mnemonic input 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.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); + await OnboardingPage.registrationInfoPanelLooksAsExpected( + $, + RegistrationState.keychainCreateMnemonicWritedown, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - mnemonic 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.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.onboardingScreenLooksAsExpected( + $, + RegistrationState.keychainCreateMnemonicInput, + ); + }, + ); + + patrolWidgetTest( + 'visitor - create - mnemonic 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.seedPhraseStoredCheckbox).tap(); + await $(OnboardingPage.nextButton).tap(); + await $(OnboardingPage.nextButton).tap(); + await ($(OnboardingPage.backButton)).waitUntilVisible().tap(); + await OnboardingPage.registrationInfoPanelLooksAsExpected( + $, + RegistrationState.keychainCreateMnemonicInputInfo, + ); + }, + ); + }, + ); +} diff --git a/catalyst_voices/apps/voices/integration_test/types/registration_state.dart b/catalyst_voices/apps/voices/integration_test/types/registration_state.dart index c40c7ddd5b6..245d28ab6cb 100644 --- a/catalyst_voices/apps/voices/integration_test/types/registration_state.dart +++ b/catalyst_voices/apps/voices/integration_test/types/registration_state.dart @@ -1,15 +1,24 @@ enum RegistrationState { - checkYourKeychain, - createKeychain, getStarted, + createKeychainInfo, keychainCreated, - keychainRestoreInfo, - keychainRestoreInput, - keychainRestoreStart, + keychainCreateMnemonicWritedown, + keychainCreateMnemonicInputInfo, + keychainCreateMnemonicInput, + keychainCreateMnemonicVerified, + keychainRestoreChoice, + keychainRestoreMnemonicInfo, + keychainRestoreMnemonicInput, keychainRestoreSuccess, - mnemonicInput, - mnemonicVerified, - mnemonicWritedown, passwordInfo, - passwordInput; + passwordInput, + keychainCreateSuccess, + linkWalletInfo, + linkWalletSelect, + linkWalletSuccess, + rolesSelect, + rolesConfirm, + rolesSummary, + keychainTransactionPending, + accountCreationSuccess; } diff --git a/catalyst_voices/apps/voices/lib/pages/registration/create_keychain/stage/seed_phrase_panel.dart b/catalyst_voices/apps/voices/lib/pages/registration/create_keychain/stage/seed_phrase_panel.dart index 822b239f416..737722a8860 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/create_keychain/stage/seed_phrase_panel.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/create_keychain/stage/seed_phrase_panel.dart @@ -91,6 +91,7 @@ class _SeedPhraseWords extends StatelessWidget { SeedPhrasesViewer(words: words), const SizedBox(height: 10), VoicesTextButton( + key: const Key('DownloadSeedPhraseButton'), onTap: () => unawaited(_downloadSeedPhrase(context)), child: Text(context.l10n.createKeychainSeedPhraseDownload), ), @@ -130,6 +131,7 @@ class _StoredCheckbox extends StatelessWidget { @override Widget build(BuildContext context) { return VoicesCheckbox( + key: const Key('SeedPhraseStoredCheckbox'), value: isConfirmed, label: Text(context.l10n.createKeychainSeedPhraseStoreConfirmation), onChanged: (value) { diff --git a/catalyst_voices/apps/voices/lib/pages/registration/create_keychain/stage/splash_panel.dart b/catalyst_voices/apps/voices/lib/pages/registration/create_keychain/stage/splash_panel.dart index 6a2aa936c1f..43565e72080 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/create_keychain/stage/splash_panel.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/create_keychain/stage/splash_panel.dart @@ -19,11 +19,13 @@ class SplashPanel extends StatelessWidget { ), const Spacer(), VoicesFilledButton( + key: const Key('CreateKeychainButton'), child: Text(context.l10n.accountCreationSplashNextButton), onTap: () => RegistrationCubit.of(context).nextStep(), ), const SizedBox(height: 10), VoicesBackButton( + key: const Key('BackButton'), onTap: () => RegistrationCubit.of(context).previousStep(), ), ], 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 57374b42bf0..eb6b9c49d0c 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 @@ -67,6 +67,7 @@ class RecoverMethodPanel extends StatelessWidget { ), const Spacer(), VoicesBackButton( + key: const Key('BackButton'), onTap: () => RegistrationCubit.of(context).previousStep(), ), ], diff --git a/catalyst_voices/apps/voices/lib/pages/registration/registration_dialog.dart b/catalyst_voices/apps/voices/lib/pages/registration/registration_dialog.dart index 718d303e71a..00cd47005db 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/registration_dialog.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/registration_dialog.dart @@ -77,6 +77,7 @@ class _RegistrationDialogState extends State selector: (state) => state.step is! AccountCompletedStep, builder: (context, showCloseButton) { return VoicesTwoPaneDialog( + key: const Key('RegistrationDialog'), left: const RegistrationInfoPanel(), right: const RegistrationDetailsPanel(), showCloseButton: showCloseButton, 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 c89d80dd7e6..0a962b81d54 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 @@ -53,6 +53,7 @@ class _SelectWalletPanelState extends State { ), const SizedBox(height: 24), VoicesBackButton( + key: const Key('BackButton'), onTap: () { RegistrationCubit.of(context).previousStep(); }, diff --git a/catalyst_voices/apps/voices/lib/pages/registration/widgets/information_panel.dart b/catalyst_voices/apps/voices/lib/pages/registration/widgets/information_panel.dart index f62b36b524a..fbec487e63d 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/widgets/information_panel.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/widgets/information_panel.dart @@ -105,7 +105,10 @@ class _Footer extends StatelessWidget { children: [ Visibility.maintain( visible: progress != null, - child: AnimatedVoicesLinearProgressIndicator(value: progress ?? 0), + child: AnimatedVoicesLinearProgressIndicator( + key: const Key('ProgressBar'), + value: progress ?? 0, + ), ), const SizedBox(height: 10), VoicesLearnMoreButton(onTap: () {}), diff --git a/catalyst_voices/apps/voices/lib/pages/registration/widgets/registration_stage_navigation.dart b/catalyst_voices/apps/voices/lib/pages/registration/widgets/registration_stage_navigation.dart index a2c0fce0e4a..917f2382db9 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/widgets/registration_stage_navigation.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/widgets/registration_stage_navigation.dart @@ -24,11 +24,13 @@ class RegistrationBackNextNavigation extends StatelessWidget { spacing: 10, children: [ VoicesBackButton( + key: const Key('BackButton'), onTap: isBackEnabled ? onBackTap ?? () => RegistrationCubit.of(context).previousStep() : null, ), VoicesNextButton( + key: const Key('NextButton'), onTap: isNextEnabled ? onNextTap ?? () => RegistrationCubit.of(context).nextStep() : null, diff --git a/catalyst_voices/apps/voices/lib/pages/registration/widgets/seed_phrase_actions.dart b/catalyst_voices/apps/voices/lib/pages/registration/widgets/seed_phrase_actions.dart index 950ca4bd6ae..4b46c7d7f43 100644 --- a/catalyst_voices/apps/voices/lib/pages/registration/widgets/seed_phrase_actions.dart +++ b/catalyst_voices/apps/voices/lib/pages/registration/widgets/seed_phrase_actions.dart @@ -17,12 +17,14 @@ class SeedPhraseActions extends StatelessWidget { return Row( children: [ VoicesTextButton( + key: const Key('UploadKeyButton'), onTap: onUploadKeyTap, child: Text(context.l10n.uploadCatalystKey), ), const Spacer(), if (onResetTap != null) VoicesTextButton( + key: const Key('ResetButton'), onTap: onResetTap, child: Text(context.l10n.reset), ), diff --git a/catalyst_voices/apps/voices/lib/widgets/modals/voices_desktop_dialog.dart b/catalyst_voices/apps/voices/lib/widgets/modals/voices_desktop_dialog.dart index df3a5af8c7a..e76cdeb296f 100644 --- a/catalyst_voices/apps/voices/lib/widgets/modals/voices_desktop_dialog.dart +++ b/catalyst_voices/apps/voices/lib/widgets/modals/voices_desktop_dialog.dart @@ -153,7 +153,6 @@ class _CloseButtonPosition extends StatelessWidget { ); return Align( - key: const Key('DialogCloseButton'), alignment: alignment, child: IconButtonTheme( data: const IconButtonThemeData(style: buttonStyle), @@ -169,6 +168,7 @@ class _CloseButton extends StatelessWidget { @override Widget build(BuildContext context) { return XButton( + key: const Key('DialogCloseButton'), onTap: () { unawaited(Navigator.of(context).maybePop()); }, diff --git a/catalyst_voices/apps/voices/lib/widgets/seed_phrase/seed_phrases_viewer.dart b/catalyst_voices/apps/voices/lib/widgets/seed_phrase/seed_phrases_viewer.dart index 9c11152b19c..373e1f0c44d 100644 --- a/catalyst_voices/apps/voices/lib/widgets/seed_phrase/seed_phrases_viewer.dart +++ b/catalyst_voices/apps/voices/lib/widgets/seed_phrase/seed_phrases_viewer.dart @@ -71,12 +71,14 @@ class _WordCell extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Text( + key: const Key('SeedPhraseNumber'), '${number.toString().padLeft(2, '0')}.', style: TextStyle(color: theme.colors.textOnPrimary), ), const SizedBox(width: 6), Flexible( child: Text( + key: const Key('SeedPhraseWord'), data, style: TextStyle(color: theme.colors.textPrimary), maxLines: 1,