mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-21 10:14:40 +00:00
3e10023e18
* CI update - use existing build outputs in build_monero_all.sh - update $HOME, fix gh actions - add secrets earlier in the runtime (potentially speed up 'Build generated code' step) - add windows dockerfile - add linux/android dockerfile - update android/linux ci script * [skip slack] [run tests] Run tests on CI, fix tests * [skip slack] [run tests] force enable kvm in android * [skip slack] [run tests] remove inexisting flag * [run tests] [skip slack] update tests * add extra dependencies [skip ci] * [skip slack] [run tests] Add secrets * [skip slack] [run tests] Timeout test cases, continue on error * [skip slack] [run tests] Xvfb fix, timeout fix * [skip slack] [run tests] Start dbus to clean up the logs, use SIGKILL * [skip slack] [run tests] Enable network manager * [skip slack] [run tests] Screen record test, resize screen * [skip slack] [run tests] Improve status report for tests * [skip slack] [run tests] Increase framerate * [skip slack] [run tests] Remove test that I am unable to fix locally easily from CI * [skip slack] [run tests] Simplify ffmpeg command * [skip slack] [run tests] Increase timeout, add comment * [skip slack] Update dockerfile, migrate from mrcyjanek to cake-tech for the ghcr org * Update lib/entities/default_settings_migration.dart Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com> --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
115 lines
3.6 KiB
Dart
115 lines
3.6 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:cake_wallet/wallet_types.g.dart';
|
|
import 'package:cw_core/wallet_type.dart';
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:integration_test/integration_test.dart';
|
|
|
|
import '../components/common_test_cases.dart';
|
|
import '../components/common_test_constants.dart';
|
|
import '../components/common_test_flows.dart';
|
|
import '../robots/auth_page_robot.dart';
|
|
import '../robots/dashboard_page_robot.dart';
|
|
import '../robots/security_and_backup_page_robot.dart';
|
|
import '../robots/wallet_keys_robot.dart';
|
|
|
|
void main() {
|
|
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
|
|
|
|
AuthPageRobot authPageRobot;
|
|
CommonTestFlows commonTestFlows;
|
|
DashboardPageRobot dashboardPageRobot;
|
|
WalletKeysAndSeedPageRobot walletKeysAndSeedPageRobot;
|
|
SecurityAndBackupPageRobot securityAndBackupPageRobot;
|
|
|
|
testWidgets(
|
|
'Confirm if the seeds display properly',
|
|
(tester) async {
|
|
authPageRobot = AuthPageRobot(tester);
|
|
commonTestFlows = CommonTestFlows(tester);
|
|
dashboardPageRobot = DashboardPageRobot(tester);
|
|
walletKeysAndSeedPageRobot = WalletKeysAndSeedPageRobot(tester);
|
|
securityAndBackupPageRobot = SecurityAndBackupPageRobot(tester);
|
|
|
|
// Start the app
|
|
await commonTestFlows.startAppFlow(
|
|
ValueKey('confirm_creds_display_correctly_flow_app_key'),
|
|
);
|
|
|
|
await commonTestFlows.welcomePageToCreateNewWalletFlow(
|
|
WalletType.solana,
|
|
CommonTestConstants.pin,
|
|
);
|
|
|
|
await dashboardPageRobot.confirmWalletTypeIsDisplayedCorrectly(WalletType.solana);
|
|
|
|
await _confirmSeedsFlowForWalletType(
|
|
WalletType.solana,
|
|
authPageRobot,
|
|
dashboardPageRobot,
|
|
securityAndBackupPageRobot,
|
|
walletKeysAndSeedPageRobot,
|
|
tester,
|
|
);
|
|
|
|
// Do the same for other available wallet types
|
|
for (var walletType in availableWalletTypes) {
|
|
if (walletType == WalletType.solana) {
|
|
continue;
|
|
}
|
|
|
|
await commonTestFlows.switchToWalletMenuFromDashboardPage();
|
|
|
|
await commonTestFlows.createNewWalletFromWalletMenu(walletType);
|
|
|
|
await dashboardPageRobot.confirmWalletTypeIsDisplayedCorrectly(walletType);
|
|
|
|
await _confirmSeedsFlowForWalletType(
|
|
walletType,
|
|
authPageRobot,
|
|
dashboardPageRobot,
|
|
securityAndBackupPageRobot,
|
|
walletKeysAndSeedPageRobot,
|
|
tester,
|
|
);
|
|
}
|
|
|
|
await Future.delayed(Duration(seconds: 15));
|
|
},
|
|
);
|
|
}
|
|
|
|
Future<void> _confirmSeedsFlowForWalletType(
|
|
WalletType walletType,
|
|
AuthPageRobot authPageRobot,
|
|
DashboardPageRobot dashboardPageRobot,
|
|
SecurityAndBackupPageRobot securityAndBackupPageRobot,
|
|
WalletKeysAndSeedPageRobot walletKeysAndSeedPageRobot,
|
|
WidgetTester tester,
|
|
) async {
|
|
await dashboardPageRobot.openDrawerMenu();
|
|
await dashboardPageRobot.dashboardMenuWidgetRobot.navigateToSecurityAndBackupPage();
|
|
|
|
await securityAndBackupPageRobot.navigateToShowKeysPage();
|
|
|
|
final onAuthPage = authPageRobot.onAuthPage();
|
|
if (onAuthPage) {
|
|
await authPageRobot.enterPinCode(CommonTestConstants.pin);
|
|
}
|
|
|
|
final onAuthPageDesktop = authPageRobot.onAuthPageDesktop();
|
|
if (onAuthPageDesktop) {
|
|
await authPageRobot.enterPassword(CommonTestConstants.pin.join(""));
|
|
}
|
|
await tester.pumpAndSettle();
|
|
|
|
await walletKeysAndSeedPageRobot.isWalletKeysAndSeedPage();
|
|
walletKeysAndSeedPageRobot.hasTitle();
|
|
walletKeysAndSeedPageRobot.hasShareWarning();
|
|
|
|
await walletKeysAndSeedPageRobot.confirmWalletCredentials(walletType);
|
|
|
|
await walletKeysAndSeedPageRobot.backToDashboard();
|
|
}
|