dev
dart 60 lines 1.93 KB
Raw
1 import 'package:cake_wallet/wallet_types.g.dart';
2 import 'package:cw_core/wallet_type.dart';
3 import 'package:flutter/material.dart';
4 import 'package:flutter_test/flutter_test.dart';
5 import 'package:integration_test/integration_test.dart';
6
7 import '../components/common_test_constants.dart';
8 import '../components/common_test_flows.dart';
9 import '../robots/dashboard_page_robot.dart';
10
11 void main() {
12 IntegrationTestWidgetsFlutterBinding.ensureInitialized();
13
14 CommonTestFlows commonTestFlows;
15 DashboardPageRobot dashboardPageRobot;
16
17 testWidgets(
18 'Create Wallet Flow',
19 (tester) async {
20 FlutterError.onError = (FlutterErrorDetails details) {
21 debugPrint('FlutterError caught: ${details.exception}');
22 };
23 commonTestFlows = CommonTestFlows(tester);
24 dashboardPageRobot = DashboardPageRobot(tester);
25
26 // Start the app
27 await commonTestFlows.startAppFlow(
28 ValueKey('create_wallets_through_seeds_test_app_key'),
29 );
30
31 await commonTestFlows.welcomePageToCreateNewWalletFlow(
32 WalletType.solana,
33 CommonTestConstants.pin,
34 );
35
36 // Confirm it actually restores a solana wallet
37 await dashboardPageRobot.confirmWalletTypeIsDisplayedCorrectly(WalletType.solana);
38
39 // Do the same for other available wallet types
40 for (var walletType in availableWalletTypes) {
41 if (walletType == WalletType.solana) {
42 continue;
43 }
44
45 await dashboardPageRobot.navigateToWalletsListPage();
46
47 await commonTestFlows.createNewWalletFromWalletMenu(walletType);
48
49 await dashboardPageRobot.confirmWalletTypeIsDisplayedCorrectly(walletType);
50 }
51
52 // Goes to the wallet menu and provides a confirmation that all the wallets were correctly restored
53 await dashboardPageRobot.navigateToWalletsListPage();
54
55 commonTestFlows.confirmAllAvailableWalletTypeIconsDisplayCorrectly();
56
57 await Future.delayed(Duration(seconds: 5));
58 },
59 );
60 }