Skip to content

Commit

Permalink
[skip slack] [run tests] Run tests on CI, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCyjaneK committed Jan 9, 2025
1 parent 48895ad commit 728e4aa
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pr_test_build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,6 @@ jobs:
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: |
./integration_test_runner.sh
flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/confirm_seeds_flow_test.dart || exit 1
flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/restore_wallet_through_seeds_flow_test.dart || exit 1
flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/transaction_history_flow_test.dart || exit 1
5 changes: 5 additions & 0 deletions integration_test/components/common_test_cases.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ class CommonTestCases {
expect(textWidget, hasWidget ? findsOneWidget : findsNothing);
}

void hasTextAtLestOnce(String text, {bool hasWidget = true}) {
final textWidget = find.text(text);
expect(textWidget, hasWidget ? findsAny : findsNothing);
}

void hasType<T>() {
final typeWidget = find.byType(T);
expect(typeWidget, findsOneWidget);
Expand Down
4 changes: 2 additions & 2 deletions integration_test/components/common_test_flows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ class CommonTestFlows {

await _walletSeedPageRobot.onCopySeedsButtonPressed();

await _walletSeedPageRobot.onNextButtonPressed();
await _walletSeedPageRobot.onSeedPageVerifyButtonPressed();

await _walletSeedPageRobot.onConfirmButtonOnSeedAlertDialogPressed();
await _walletSeedPageRobot.onOpenWalletButtonPressed();
}

//* Main Restore Actions - On the RestoreFromSeed/Keys Page - Restore from Seeds Action
Expand Down
16 changes: 12 additions & 4 deletions integration_test/robots/wallet_seed_page_robot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@ class WalletSeedPageRobot {
await commonTestCases.isSpecificPage<WalletSeedPage>();
}

Future<void> onNextButtonPressed() async {
await commonTestCases.tapItemByKey('wallet_seed_page_next_button_key');
Future<void> onSeedPageVerifyButtonPressed() async {
await commonTestCases.tapItemByKey('wallet_seed_page_verify_seed_button_key');
await commonTestCases.defaultSleepTime();
}

Future<void> onOpenWalletButtonPressed() async {
await commonTestCases.tapItemByKey('wallet_seed_page_open_wallet_button_key');
await commonTestCases.defaultSleepTime();
}

Expand All @@ -38,11 +43,14 @@ class WalletSeedPageRobot {
final walletSeeds = walletSeedViewModel.seed;

commonTestCases.hasText(walletName);
commonTestCases.hasText(walletSeeds);
final seedList = walletSeeds.trim().split(" ");
for (final seedWord in seedList) {
commonTestCases.hasTextAtLestOnce(seedWord);
}
}

void confirmWalletSeedReminderDisplays() {
commonTestCases.hasText(S.current.seed_reminder);
commonTestCases.hasText(S.current.cake_seeds_save_disclaimer);
}

Future<void> onSaveSeedsButtonPressed() async {
Expand Down

0 comments on commit 728e4aa

Please sign in to comment.