import "package:hash_wallet/generated/i18n.dart"; import "package:hash_wallet/src/screens/seed/seed_verification/seed_verification_page.dart"; import "package:flutter_test/flutter_test.dart"; import "../core/base_robot.dart"; class SeedVerificationPageRobot extends BaseRobot { SeedVerificationPageRobot(super.tester); @override Future isDisplayed() async { await isSpecificPage(); } void hasTitle() { hasText(S.current.verify_seed); } Future verifyWalletSeeds() async { final seedVerificationPage = tester.widget(find.byType(SeedVerificationPage)); final walletSeedViewModel = seedVerificationPage.walletSeedViewModel; while (!walletSeedViewModel.isVerificationComplete && walletSeedViewModel.verificationWordCount != 0) { final currentCorrectWord = walletSeedViewModel.currentCorrectWord; final currentStep = walletSeedViewModel.currentStepIndex; hasTextAtLeastOnce(currentCorrectWord); await tapByKey("seed_verification_option_${currentCorrectWord}_button_key"); final hasMovedOn = await pumpUntil( () => walletSeedViewModel.isVerificationComplete || walletSeedViewModel.currentStepIndex != currentStep, ); if (!hasMovedOn) { throw TestFailure("Seed verification never moved past step $currentStep"); } } await tapByKey("wallet_seed_page_open_wallet_button_key"); } }