forked from cypherstack/stack_wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_wallet_views_test.dart
106 lines (84 loc) · 3.54 KB
/
main_wallet_views_test.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:stackwallet/main.dart' as campfireApp;
import 'bot_runners/create_wallet_until_pin_confirmation.dart';
import 'bots/main_view_bot.dart';
import 'bots/onboarding/backup_key_warning_bot.dart';
import 'bots/onboarding/create_pin_view_bot.dart';
import 'bots/onboarding/name_your_wallet_view_bot.dart';
import 'bots/onboarding/onboarding_view_bot.dart';
import 'bots/onboarding/terms_and_conditions_bot.dart';
import 'bots/receive_view_bot.dart';
import 'bots/send_view_bot.dart';
import 'bots/settings/settings_view_bot.dart';
import 'bots/transaction/transaction_search_view_bot.dart';
import 'bots/wallet_view_bot.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets("wallet, send, and receive view test", (tester) async {
campfireApp.main();
await tester.pumpAndSettle(Duration(seconds: 10));
// robots
final onboardingViewBot = OnboardingViewBot(tester);
final termsAndConditionsViewBot = TermsAndConditionsViewBot(tester);
final nameYourWalletViewBot = NameYourWalletViewBot(tester);
final createPinViewBot = CreatePinViewBot(tester);
final backupKeyWarningViewBot = BackupKeyWarningViewBot(tester);
final mainViewBot = MainViewBot(tester);
final settingsViewBot = SettingsViewBot(tester);
final walletViewBot = WalletViewBot(tester);
final transactionSearchViewBot = TransactionSearchViewBot(tester);
final sendViewBot = SendViewBot(tester);
final receiveViewBot = ReceiveViewBot(tester);
// tap create new wallet button
await onboardingViewBot.ensureVisible();
await onboardingViewBot.tapCreateNewWallet();
await termsAndConditionsViewBot.ensureVisible();
await createWalletUntilPinConfirmation(
termsAndConditionsViewBot,
nameYourWalletViewBot,
createPinViewBot,
);
// wait for wallet generation
await tester.pumpAndSettle(Duration(seconds: 60));
await backupKeyWarningViewBot.ensureVisible();
// tap skip to load into main wallet view
await backupKeyWarningViewBot.tapSkip();
await mainViewBot.ensureVisible();
// tap refresh
await mainViewBot.tapRefresh();
// tap settings button
await mainViewBot.tapSettings();
await settingsViewBot.ensureVisible();
// tap back to main wallet view
await settingsViewBot.tapBack();
await mainViewBot.ensureVisible();
await walletViewBot.ensureVisible();
// wait for refresh notification that covers switch to disappear
await tester.pumpAndSettle(Duration(seconds: 3));
// tap switch
await walletViewBot.tapAvailableFullSwitch();
await walletViewBot.checkAvailableFullSwitchIsDisabled();
// drag switch
await walletViewBot.dragAvailableFullSwitchRight();
await walletViewBot.checkAvailableFullSwitchIsDisabled();
// drag switch
await walletViewBot.dragAvailableFullSwitchLeft();
await walletViewBot.checkAvailableFullSwitchIsEnabled();
// tap switch again
await walletViewBot.tapAvailableFullSwitch();
await walletViewBot.checkAvailableFullSwitchIsDisabled();
// tap tx search
await walletViewBot.tapTransactionSearch();
await transactionSearchViewBot.ensureVisible();
// go back
await transactionSearchViewBot.tapX();
await walletViewBot.ensureVisible();
// go to send tab
await mainViewBot.tapSend();
await sendViewBot.ensureVisible();
// go to receive tab
await mainViewBot.tapReceive();
await receiveViewBot.ensureVisible();
});
}