2024-09-22 02:46:51 +00:00
|
|
|
import 'package:cake_wallet/src/screens/restore/restore_options_page.dart';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
|
|
|
|
import '../components/common_test_cases.dart';
|
|
|
|
|
|
|
|
class RestoreOptionsPageRobot {
|
|
|
|
RestoreOptionsPageRobot(this.tester) : commonTestCases = CommonTestCases(tester);
|
|
|
|
|
|
|
|
final WidgetTester tester;
|
|
|
|
late CommonTestCases commonTestCases;
|
|
|
|
|
|
|
|
Future<void> isRestoreOptionsPage() async {
|
|
|
|
await commonTestCases.isSpecificPage<RestoreOptionsPage>();
|
|
|
|
}
|
|
|
|
|
|
|
|
void hasRestoreOptionsButton() {
|
2024-11-07 14:46:08 +00:00
|
|
|
commonTestCases.hasValueKey('restore_options_from_seeds_or_keys_button_key');
|
2024-09-22 02:46:51 +00:00
|
|
|
commonTestCases.hasValueKey('restore_options_from_backup_button_key');
|
|
|
|
commonTestCases.hasValueKey('restore_options_from_hardware_wallet_button_key');
|
|
|
|
commonTestCases.hasValueKey('restore_options_from_qr_button_key');
|
|
|
|
}
|
|
|
|
|
2024-11-07 14:46:08 +00:00
|
|
|
Future<void> navigateToRestoreFromSeedsOrKeysPage() async {
|
|
|
|
await commonTestCases.tapItemByKey('restore_options_from_seeds_or_keys_button_key');
|
2024-09-22 02:46:51 +00:00
|
|
|
await commonTestCases.defaultSleepTime();
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> navigateToRestoreFromBackupPage() async {
|
|
|
|
await commonTestCases.tapItemByKey('restore_options_from_backup_button_key');
|
|
|
|
await commonTestCases.defaultSleepTime();
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> navigateToRestoreFromHardwareWalletPage() async {
|
|
|
|
await commonTestCases.tapItemByKey('restore_options_from_hardware_wallet_button_key');
|
|
|
|
await commonTestCases.defaultSleepTime();
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> backAndVerify() async {
|
|
|
|
await commonTestCases.goBack();
|
|
|
|
await isRestoreOptionsPage();
|
|
|
|
}
|
|
|
|
}
|