Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Attempting automation for testing #1734

Merged
merged 163 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
ccf54ab
feat: Integration tests setup and tests for Disclaimer, Welcome and S…
Blazebrain Jun 21, 2024
767ea37
feat: Integration test flow from start to restoring a wallet successf…
Blazebrain Jun 24, 2024
8ec38e1
test: Dashboard view test and linking to flow
Blazebrain Jun 25, 2024
66af74f
feat: Testing the Exchange flow section, selecting sending and receiv…
Blazebrain Jun 27, 2024
b31bbc9
test: Successfully create an exchange section
Blazebrain Jun 27, 2024
2038154
feat: Implement flow up to sending section
Blazebrain Jun 28, 2024
97fced4
test: Complete Exchange flow
Blazebrain Jul 1, 2024
f27deb2
fix dependency issue
OmarHatem28 Jul 3, 2024
7b99667
test: Final cleanups
Blazebrain Jul 3, 2024
31facfc
Merge branch 'CW-659-Automated-Integrated-Tests' of https://github.co…
Blazebrain Jul 3, 2024
e7670c2
feat: Add CI to run automated integration tests withan android emulator
Blazebrain Jul 3, 2024
b915e27
feat: Adjust Automated integration test CI to run on ubuntu 20.04-a
Blazebrain Jul 3, 2024
6e4c9e8
fix: Move integration test CI into PR test build CI
Blazebrain Jul 3, 2024
ab420e4
ci: Add automated test ci which is a streamlined replica of pr test b…
Blazebrain Jul 3, 2024
e2ee119
ci: Re-add step to access branch name
Blazebrain Jul 3, 2024
3e1705a
ci: Add KVM
Blazebrain Jul 3, 2024
bf5cfbe
ci: Add filepath to trigger the test run from
Blazebrain Jul 3, 2024
bcab3c7
ci: Add required key
Blazebrain Jul 3, 2024
30802cb
ci: Add required key
Blazebrain Jul 3, 2024
b8627d8
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Jul 3, 2024
edd57b1
ci: Add missing secret key
Blazebrain Jul 3, 2024
7c6e6a4
ci: Add missing secret key
Blazebrain Jul 3, 2024
7e6ab22
Merge branch 'main' into CW-659-Automated-Integrated-Tests
OmarHatem28 Jul 4, 2024
fd65b21
ci: Add nano secrets to workflow
Blazebrain Jul 5, 2024
d49a526
ci: Switch step to free space on runner
Blazebrain Jul 5, 2024
0b92ff4
ci: Remove timeout from workflow
Blazebrain Jul 5, 2024
eb56236
ci: Confirm impact that removing copy_monero_deps would have on entir…
Blazebrain Jul 5, 2024
712658c
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Jul 9, 2024
3a687ee
ci: Update CI and temporarily remove cache related to emulator
Blazebrain Jul 9, 2024
eb228ed
ci: Remove dynamic java version
Blazebrain Jul 9, 2024
1504b55
ci: Temporarily switch CI
Blazebrain Jul 9, 2024
034c575
ci: Switch to 11.x jdk
Blazebrain Jul 9, 2024
5940737
ci: Temporarily switch CI
Blazebrain Jul 9, 2024
a5f4475
ci: Revert ubuntu version
Blazebrain Jul 9, 2024
d7c307f
ci: Add more api levels
Blazebrain Jul 9, 2024
fee1335
ci: Add more target options
Blazebrain Jul 9, 2024
3e06eb7
ci: Settled on stable emulator matrix options
Blazebrain Jul 9, 2024
27ba3f1
ci: Add more target options
Blazebrain Jul 9, 2024
a1dfc24
ci: Modify flow
Blazebrain Jul 9, 2024
065e0ae
ci: Streamline api levels to 28 and 29
Blazebrain Jul 9, 2024
a930369
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Jul 11, 2024
a4b30ec
ci: One more trial
Blazebrain Jul 11, 2024
83d6efc
ci: Switch to flutter drive
Blazebrain Jul 11, 2024
b411134
ci: Reduce options
Blazebrain Jul 11, 2024
8ec2097
ci: Remove haven from test
Blazebrain Jul 11, 2024
89c1651
ci: Check for solana in list
Blazebrain Jul 11, 2024
35eb07b
ci: Adjust amounts and currencies for exchange flow
Blazebrain Jul 12, 2024
01cd3b0
ci: Set write response on failure to true
Blazebrain Jul 12, 2024
9dc96d7
ci: Split ci to funds and non funds related tests
Blazebrain Jul 12, 2024
989ecbb
test: Test for Send flow scenario and minor restructuring for test fo…
Blazebrain Jul 31, 2024
698dc40
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Jul 31, 2024
14735d3
chore: cleanup
Blazebrain Jul 31, 2024
0f91cec
ci: Pause CI for now
Blazebrain Aug 1, 2024
5a90915
ci: Pause CI for now
Blazebrain Aug 1, 2024
f41e604
ci: Pause CI for now
Blazebrain Aug 1, 2024
6aa8750
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Aug 9, 2024
1169b41
test: Restore wallets integration automated tests
Blazebrain Aug 9, 2024
7a4ba7f
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Aug 12, 2024
ea3dbc8
Fix: Add keys back to currency amount textfield widget
Blazebrain Aug 12, 2024
bdf1127
fix: Switch variable name
Blazebrain Aug 13, 2024
dbe7e40
Merge branch 'CW-659-Restore-Wallets-Automated-Tests' of https://gith…
Blazebrain Aug 13, 2024
0f8215c
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Aug 13, 2024
9ade090
fix: remove automation for now
Blazebrain Aug 13, 2024
94e7c0d
Merge branch 'CW-659-Automated-Integrated-Tests' of https://github.co…
Blazebrain Aug 13, 2024
b6474ae
tests: Automated tests for Create wallets flow
Blazebrain Aug 13, 2024
bd3b14c
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Aug 13, 2024
929c046
Merge branch 'CW-659-Automated-Integrated-Tests' of https://github.co…
Blazebrain Aug 13, 2024
e9a41a1
tests: Further optimize common flows
Blazebrain Aug 13, 2024
06bde3e
Merge branch 'CW-659-Restore-Wallets-Automated-Tests' of https://gith…
Blazebrain Aug 13, 2024
7c169fe
tests: Add missing await for call
Blazebrain Aug 13, 2024
992ad7e
Merge branch 'CW-659-Restore-Wallets-Automated-Tests' of https://gith…
Blazebrain Aug 13, 2024
ab80805
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Aug 15, 2024
4555b0b
tests: Confirm Seeds Display Properly WIP
Blazebrain Aug 15, 2024
d197b71
tests: Confirm Seeds Display Correctly Automated Tests
Blazebrain Aug 19, 2024
9cf6014
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Aug 19, 2024
4102156
Merge branch 'CW-659-Automated-Integrated-Tests' of https://github.co…
Blazebrain Aug 19, 2024
2cb0e46
Merge branch 'CW-659-Restore-Wallets-Automated-Tests' of https://gith…
Blazebrain Aug 19, 2024
deea858
Merge branch 'CW-659-Create-Wallets-Automated-Tests' of https://githu…
Blazebrain Aug 19, 2024
517c92c
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Aug 26, 2024
cc4c99e
fix: Add missing pubspec params for bitcoin and bitcoin_cash
Blazebrain Aug 27, 2024
1979fcb
feat: Automated Tests for Transaction History Flow
Blazebrain Aug 29, 2024
dc37952
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 10, 2024
2540347
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 11, 2024
5d27850
fix: Add missing pubspec parameter
Blazebrain Sep 11, 2024
5779d30
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 11, 2024
63e0848
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 11, 2024
f6cf4fc
Merge branch 'CW-659-Automated-Integrated-Tests' of https://github.co…
Blazebrain Sep 11, 2024
1bce162
Merge branch 'CW-659-Restore-Wallets-Automated-Tests' of https://gith…
Blazebrain Sep 11, 2024
1314270
Merge branch 'CW-659-Create-Wallets-Automated-Tests' of https://githu…
Blazebrain Sep 11, 2024
ec74224
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 12, 2024
1e96271
feat: Automated Integration Tests for Transaction History flow
Blazebrain Sep 18, 2024
6c2890d
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 18, 2024
18bcc92
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 18, 2024
d0e0ddd
test: Updating send page robot and also syncing branch with main
Blazebrain Sep 18, 2024
c58d5a6
Merge branch 'CW-659-Automated-Integrated-Tests' of https://github.co…
Blazebrain Sep 18, 2024
6698c25
Merge branch 'CW-659-Restore-Wallets-Automated-Tests' of https://gith…
Blazebrain Sep 18, 2024
a096947
Merge branch 'CW-659-Create-Wallets-Automated-Tests' of https://githu…
Blazebrain Sep 18, 2024
57fd116
Merge branch 'CW-659-Confirm-Seeds-Display-Correctly' of https://gith…
Blazebrain Sep 18, 2024
bf97bc0
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 26, 2024
761b746
test: Modifying tests to flow with wallet grouping implementation
Blazebrain Sep 27, 2024
7d97ddb
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 27, 2024
cc00fda
fix: Issue with transaction history test
Blazebrain Sep 28, 2024
6a2367c
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Sep 28, 2024
67ac202
fix: Modifications to the PR and add automated confirmation for check…
Blazebrain Oct 3, 2024
92a1ad7
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Oct 8, 2024
d160ee2
test: Attempting automation for testing
Blazebrain Oct 8, 2024
51e98dc
test: Attempting automation for testing
Blazebrain Oct 8, 2024
d568d9f
test: Print out working directory
Blazebrain Oct 9, 2024
3d71468
test: See if I can cut down time by removing the build step
Blazebrain Oct 9, 2024
e9657ad
test: More logs
Blazebrain Oct 9, 2024
65685b0
test: Pubspec was not generated, checking if this fixes it
Blazebrain Oct 9, 2024
5e9d2dc
test: Pubspec was not generated, checking if this fixes it
Blazebrain Oct 9, 2024
04fda39
test: Pubspec was not generated, checking if this fixes it
Blazebrain Oct 9, 2024
a9f5032
test: Pubspec was not generated, checking if this fixes it
Blazebrain Oct 9, 2024
cbdee1a
test: Pubspec was not generated, checking if this fixes it
Blazebrain Oct 9, 2024
be64cb1
test: Pubspec was not generated, checking if this fixes it
Blazebrain Oct 9, 2024
45e026f
test: Another trial
Blazebrain Oct 9, 2024
d9bd180
test: Another trial
Blazebrain Oct 9, 2024
88c1d06
test: Another trial
Blazebrain Oct 9, 2024
10d4616
test: Another trial
Blazebrain Oct 9, 2024
7794ee1
test: Another trial
Blazebrain Oct 9, 2024
b084238
test: Another trial
Blazebrain Oct 9, 2024
72af925
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Oct 25, 2024
35b1cfa
fix: Adjust config file
Blazebrain Oct 25, 2024
2e56479
test: Add commands to generate files and set codebase up as new
Blazebrain Oct 25, 2024
118e6fb
test: try another route
Blazebrain Oct 25, 2024
d860b0a
test: try another route - 2
Blazebrain Oct 25, 2024
2253a99
test: try another route
Blazebrain Oct 25, 2024
4fbdaa2
test: try another route - 2
Blazebrain Oct 25, 2024
a391b02
test: Uncomment KVM and optimizations-a
Blazebrain Oct 25, 2024
13317cd
test: Try with sudo permissions-a
Blazebrain Oct 25, 2024
db7a738
test: Try again
Blazebrain Oct 25, 2024
980ab74
test: Pause build and rename steps, see how faster it resolves
Blazebrain Oct 25, 2024
d3d31ef
test: Try using working directory
Blazebrain Oct 25, 2024
6eeaecd
test: Check details of current working directory
Blazebrain Oct 25, 2024
37638bb
test: Switch test run command from flutter drive to flutter test
Blazebrain Oct 25, 2024
0d6e11c
test: Adding secrets to CI workflow
Blazebrain Oct 26, 2024
fb484bf
fix: add working directory to emulator and reactivate build step
Blazebrain Oct 28, 2024
0d2e1fa
test: Add verbosity
Blazebrain Oct 28, 2024
66f0aad
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Nov 5, 2024
6193acf
test: Check tat emulator is present and ready to connect
Blazebrain Nov 5, 2024
ef7e395
test: Try a direct test to see if it'll trigger properly
Blazebrain Nov 5, 2024
8367c52
test: Try the flutter drive command
Blazebrain Nov 5, 2024
212dbce
test: Try uninstalling before running
Blazebrain Nov 5, 2024
f6da70c
test: Create an aggregator test file as the entry point for all tests
Blazebrain Nov 5, 2024
cabf653
test: Try without awaiting each test
Blazebrain Nov 5, 2024
7ee60f2
test: Another trial at getting combined tests running
Blazebrain Nov 6, 2024
70594b0
test: Use a test runner script that'll be responsible for running all…
Blazebrain Nov 6, 2024
b2dd5ed
test: Add command to make integration test runner file an executable
Blazebrain Nov 6, 2024
21b064a
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Nov 26, 2024
6f485fa
test: Fix failing exchange flow test
Blazebrain Nov 28, 2024
97ccdcd
test: fix failing exchange flow test
Blazebrain Nov 28, 2024
f2f2775
test: Fix issue with send flow test
Blazebrain Nov 28, 2024
5697298
test: Fix issue with confirm seeds flow test
Blazebrain Nov 28, 2024
097340a
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Nov 28, 2024
6d41eae
test: Modify create and restore flows to reflect modified onboarding …
Blazebrain Dec 2, 2024
d6f23f1
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
Blazebrain Dec 2, 2024
75dba7c
chore: Remove package declaration in AndroidManifestBase file to fix …
Blazebrain Dec 2, 2024
5516731
test: Bump up flutter version
Blazebrain Dec 2, 2024
352da5b
fix: Add meld keys
Blazebrain Dec 2, 2024
8e646d6
chore: Remove package name declarations from AndroidManifests
Blazebrain Dec 3, 2024
138653c
Merge branch 'main' of https://github.com/cake-tech/cake_wallet into …
OmarHatem28 Dec 12, 2024
8f16e99
better write close function definition
OmarHatem28 Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
298 changes: 298 additions & 0 deletions .github/workflows/automated_integration_test.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/pr_test_build_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ jobs:
echo "const tronGridApiKey = '${{ secrets.TRON_GRID_API_KEY }}';" >> cw_tron/lib/.secrets.g.dart
echo "const tronNowNodesApiKey = '${{ secrets.TRON_NOW_NODES_API_KEY }}';" >> cw_tron/lib/.secrets.g.dart
echo "const meldTestApiKey = '${{ secrets.MELD_TEST_API_KEY }}';" >> lib/.secrets.g.dart
echo "const meldTestPublicKey = '${{ secrets.MELD_TEST_PUBLIC_KEY}}';" >> lib/.secrets.g.dar
echo "const meldTestPublicKey = '${{ secrets.MELD_TEST_PUBLIC_KEY}}';" >> lib/.secrets.g.dart
echo "const letsExchangeBearerToken = '${{ secrets.LETS_EXCHANGE_TOKEN }}';" >> lib/.secrets.g.dart
echo "const letsExchangeAffiliateId = '${{ secrets.LETS_EXCHANGE_AFFILIATE_ID }}';" >> lib/.secrets.g.dart
echo "const stealthExBearerToken = '${{ secrets.STEALTH_EX_BEARER_TOKEN }}';" >> lib/.secrets.g.dart
Expand Down
2 changes: 1 addition & 1 deletion cw_bitcoin/lib/electrum_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ abstract class ElectrumWalletBase
}

@override
Future<void> close({required bool shouldCleanup}) async {
Future<void> close({bool shouldCleanup = false}) async {
try {
await _receiveStream?.cancel();
await electrumClient.close();
Expand Down
2 changes: 1 addition & 1 deletion cw_bitcoin/lib/litecoin_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ abstract class LitecoinWalletBase extends ElectrumWallet with Store {
}

@override
Future<void> close({required bool shouldCleanup}) async {
Future<void> close({bool shouldCleanup = false}) async {
_utxoStream?.cancel();
_feeRatesTimer?.cancel();
_syncTimer?.cancel();
Expand Down
2 changes: 1 addition & 1 deletion cw_core/lib/wallet_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ abstract class WalletBase<BalanceType extends Balance, HistoryType extends Trans

Future<void> rescan({required int height});

Future<void> close({required bool shouldCleanup});
Future<void> close({bool shouldCleanup = false});

Future<void> changePassword(String password);

Expand Down
2 changes: 1 addition & 1 deletion cw_evm/lib/evm_chain_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ abstract class EVMChainWalletBase
}

@override
Future<void> close({required bool shouldCleanup}) async {
Future<void> close({bool shouldCleanup = false}) async {
_client.stop();
_transactionsUpdateTimer?.cancel();
_updateFeesTimer?.cancel();
Expand Down
2 changes: 1 addition & 1 deletion cw_haven/lib/haven_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ abstract class HavenWalletBase
Future<void>? updateBalance() => null;

@override
Future<void> close({required bool shouldCleanup}) async {
Future<void> close({bool shouldCleanup = false}) async {
_listener?.stop();
_onAccountChangeReaction?.reaction.dispose();
_autoSaveTimer?.cancel();
Expand Down
2 changes: 1 addition & 1 deletion cw_monero/lib/monero_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,
Future<void>? updateBalance() => null;

@override
Future<void> close({required bool shouldCleanup}) async {
Future<void> close({bool shouldCleanup = false}) async {
_listener?.stop();
_onAccountChangeReaction?.reaction.dispose();
_onTxHistoryChangeReaction?.reaction.dispose();
Expand Down
2 changes: 1 addition & 1 deletion cw_nano/lib/nano_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ abstract class NanoWalletBase
Future<void> changePassword(String password) => throw UnimplementedError("changePassword");

@override
Future<void> close({required bool shouldCleanup}) async {
Future<void> close({bool shouldCleanup = false}) async {
_client.stop();
_receiveTimer?.cancel();
}
Expand Down
2 changes: 1 addition & 1 deletion cw_solana/lib/solana_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ abstract class SolanaWalletBase
Future<void> changePassword(String password) => throw UnimplementedError("changePassword");

@override
Future<void> close({required bool shouldCleanup}) async {
Future<void> close({bool shouldCleanup = false}) async {
_client.stop();
_transactionsUpdateTimer?.cancel();
}
Expand Down
2 changes: 1 addition & 1 deletion cw_tron/lib/tron_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ abstract class TronWalletBase
Future<void> changePassword(String password) => throw UnimplementedError("changePassword");

@override
Future<void> close({required bool shouldCleanup}) async => _transactionsUpdateTimer?.cancel();
Future<void> close({bool shouldCleanup = false}) async => _transactionsUpdateTimer?.cancel();

@action
@override
Expand Down
2 changes: 1 addition & 1 deletion cw_wownero/lib/wownero_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ abstract class WowneroWalletBase
Future<void>? updateBalance() => null;

@override
Future<void> close({required bool shouldCleanup}) async {
Future<void> close({bool shouldCleanup = false}) async {
_listener?.stop();
_onAccountChangeReaction?.reaction.dispose();
_onTxHistoryChangeReaction?.reaction.dispose();
Expand Down
6 changes: 3 additions & 3 deletions integration_test/components/common_test_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import 'package:cw_core/wallet_type.dart';
class CommonTestConstants {
static final pin = [0, 8, 0, 1];
static final String sendTestAmount = '0.00008';
static final String exchangeTestAmount = '8';
static final String exchangeTestAmount = '0.01';
static final WalletType testWalletType = WalletType.solana;
static final String testWalletName = 'Integrated Testing Wallet';
static final CryptoCurrency testReceiveCurrency = CryptoCurrency.sol;
static final CryptoCurrency testDepositCurrency = CryptoCurrency.usdtSol;
static final CryptoCurrency testReceiveCurrency = CryptoCurrency.usdtSol;
static final CryptoCurrency testDepositCurrency = CryptoCurrency.sol;
static final String testWalletAddress = '5v9gTW1yWPffhnbNKuvtL2frevAf4HpBMw8oYnfqUjhm';
}
13 changes: 10 additions & 3 deletions integration_test/components/common_test_flows.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:flutter_test/flutter_test.dart';

import 'package:cake_wallet/main.dart' as app;

import '../robots/create_pin_welcome_page_robot.dart';
import '../robots/dashboard_page_robot.dart';
import '../robots/disclaimer_page_robot.dart';
import '../robots/new_wallet_page_robot.dart';
Expand Down Expand Up @@ -37,6 +38,7 @@ class CommonTestFlows {
_walletListPageRobot = WalletListPageRobot(_tester),
_newWalletTypePageRobot = NewWalletTypePageRobot(_tester),
_restoreOptionsPageRobot = RestoreOptionsPageRobot(_tester),
_createPinWelcomePageRobot = CreatePinWelcomePageRobot(_tester),
_restoreFromSeedOrKeysPageRobot = RestoreFromSeedOrKeysPageRobot(_tester),
_walletGroupDescriptionPageRobot = WalletGroupDescriptionPageRobot(_tester);

Expand All @@ -53,6 +55,7 @@ class CommonTestFlows {
final WalletListPageRobot _walletListPageRobot;
final NewWalletTypePageRobot _newWalletTypePageRobot;
final RestoreOptionsPageRobot _restoreOptionsPageRobot;
final CreatePinWelcomePageRobot _createPinWelcomePageRobot;
final RestoreFromSeedOrKeysPageRobot _restoreFromSeedOrKeysPageRobot;
final WalletGroupDescriptionPageRobot _walletGroupDescriptionPageRobot;

Expand Down Expand Up @@ -190,23 +193,27 @@ class CommonTestFlows {
WalletType walletTypeToCreate,
List<int> pin,
) async {
await _welcomePageRobot.navigateToCreateNewWalletPage();
await _createPinWelcomePageRobot.tapSetAPinButton();

await setupPinCodeForWallet(pin);

await _welcomePageRobot.navigateToCreateNewWalletPage();

await _selectWalletTypeForWallet(walletTypeToCreate);
}

Future<void> _welcomeToRestoreFromSeedsOrKeysPath(
WalletType walletTypeToRestore,
List<int> pin,
) async {
await _createPinWelcomePageRobot.tapSetAPinButton();

await setupPinCodeForWallet(pin);

await _welcomePageRobot.navigateToRestoreWalletPage();

await _restoreOptionsPageRobot.navigateToRestoreFromSeedsOrKeysPage();

await setupPinCodeForWallet(pin);

await _selectWalletTypeForWallet(walletTypeToRestore);
}

Expand Down
53 changes: 53 additions & 0 deletions integration_test/robots/create_pin_welcome_page_robot.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/welcome/create_pin_welcome_page.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
import 'package:flutter_test/flutter_test.dart';

import '../components/common_test_cases.dart';

class CreatePinWelcomePageRobot {
CreatePinWelcomePageRobot(this.tester) : commonTestCases = CommonTestCases(tester);

final WidgetTester tester;
late CommonTestCases commonTestCases;

Future<void> isCreatePinWelcomePage() async {
await commonTestCases.isSpecificPage<CreatePinWelcomePage>();
}

void hasTitle() {
String title;
if (isMoneroOnly) {
title = S.current.monero_com;
}

if (isHaven) {
title = S.current.haven_app;
}

title = S.current.cake_wallet;

commonTestCases.hasText(title);
}

void hasDescription() {
String description;
if (isMoneroOnly) {
description = S.current.monero_com_wallet_text;
}

if (isHaven) {
description = S.current.haven_app_wallet_text;
}

description = S.current.new_first_wallet_text;

commonTestCases.hasText(description);
}

Future<void> tapSetAPinButton() async {
await commonTestCases.tapItemByKey('create_pin_welcome_page_create_a_pin_button_key');

await commonTestCases.defaultSleepTime();
}
}
14 changes: 5 additions & 9 deletions integration_test/robots/exchange_page_robot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,8 @@ class ExchangePageRobot {
return;
}

await commonTestCases.dragUntilVisible(
'picker_items_index_${depositCurrency.name}_button_key',
'picker_scrollbar_key',
);
await commonTestCases.enterText(depositCurrency.name, 'search_bar_widget_key');

await commonTestCases.defaultSleepTime();

await commonTestCases.tapItemByKey('picker_items_index_${depositCurrency.name}_button_key');
Expand All @@ -149,10 +147,8 @@ class ExchangePageRobot {
return;
}

await commonTestCases.dragUntilVisible(
'picker_items_index_${receiveCurrency.name}_button_key',
'picker_scrollbar_key',
);
await commonTestCases.enterText(receiveCurrency.name, 'search_bar_widget_key');

await commonTestCases.defaultSleepTime();

await commonTestCases.tapItemByKey('picker_items_index_${receiveCurrency.name}_button_key');
Expand Down Expand Up @@ -318,7 +314,7 @@ class ExchangePageRobot {

Future<void> handleErrors(String initialAmount) async {
await tester.pumpAndSettle();

await _handleMinLimitError(initialAmount);

await _handleMaxLimitError(initialAmount);
Expand Down
11 changes: 5 additions & 6 deletions integration_test/robots/send_page_robot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,11 @@ class SendPageRobot {
return;
}

await commonTestCases.dragUntilVisible(
'picker_items_index_${receiveCurrency.name}_button_key',
'picker_scrollbar_key',
);
await commonTestCases.enterText(receiveCurrency.title, 'search_bar_widget_key');

await commonTestCases.defaultSleepTime();

await commonTestCases.tapItemByKey('picker_items_index_${receiveCurrency.name}_button_key');
await commonTestCases.tapItemByKey('picker_items_index_${receiveCurrency.fullName}_button_key');
}

Future<void> enterReceiveAddress(String receiveAddress) async {
Expand Down Expand Up @@ -210,6 +208,7 @@ class SendPageRobot {
_handleAuthPage();
}
}
await tester.pump();
}

Future<void> handleSendResult() async {
Expand Down Expand Up @@ -366,4 +365,4 @@ class SendPageRobot {
Future<void> _onIgnoreButtonOnSentDialogPressed() async {
await commonTestCases.tapItemByKey('send_page_sent_dialog_ignore_button_key');
}
}
}
18 changes: 13 additions & 5 deletions integration_test/robots/wallet_keys_robot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class WalletKeysAndSeedPageRobot {
bool hasPrivateKey = appStore.wallet!.privateKey != null;

if (walletType == WalletType.monero) {
final moneroWallet = appStore.wallet as MoneroWallet;
final moneroWallet = appStore.wallet as MoneroWalletBase;
final lang = PolyseedLang.getByPhrase(moneroWallet.seed);
final legacySeed = moneroWallet.seedLegacy(lang.nameEnglish);

_confirmMoneroWalletCredentials(
await _confirmMoneroWalletCredentials(
appStore,
walletName,
moneroWallet.seed,
Expand All @@ -59,7 +59,7 @@ class WalletKeysAndSeedPageRobot {
final lang = PolyseedLang.getByPhrase(wowneroWallet.seed);
final legacySeed = wowneroWallet.seedLegacy(lang.nameEnglish);

_confirmMoneroWalletCredentials(
await _confirmMoneroWalletCredentials(
appStore,
walletName,
wowneroWallet.seed,
Expand Down Expand Up @@ -105,12 +105,12 @@ class WalletKeysAndSeedPageRobot {
await commonTestCases.defaultSleepTime(seconds: 5);
}

void _confirmMoneroWalletCredentials(
Future<void> _confirmMoneroWalletCredentials(
AppStore appStore,
String walletName,
String seed,
String legacySeed,
) {
) async {
final keys = appStore.wallet!.keys as MoneroWalletKeys;

final hasPublicSpendKey = commonTestCases.isKeyPresent(
Expand Down Expand Up @@ -145,10 +145,18 @@ class WalletKeysAndSeedPageRobot {
tester.printToConsole('$walletName wallet has private view key properly displayed');
}
if (hasSeeds) {
await commonTestCases.dragUntilVisible(
'${walletName}_wallet_seed_item_key',
'wallet_keys_page_credentials_list_view_key',
);
commonTestCases.hasText(seed);
tester.printToConsole('$walletName wallet has seeds properly displayed');
}
if (hasSeedLegacy) {
await commonTestCases.dragUntilVisible(
'${walletName}_wallet_seed_legacy_item_key',
'wallet_keys_page_credentials_list_view_key',
);
commonTestCases.hasText(legacySeed);
tester.printToConsole('$walletName wallet has legacy seeds properly displayed');
}
Expand Down
2 changes: 1 addition & 1 deletion integration_test/test_suites/confirm_seeds_flow_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Future<void> _confirmSeedsFlowForWalletType(
walletKeysAndSeedPageRobot.hasTitle();
walletKeysAndSeedPageRobot.hasShareWarning();

walletKeysAndSeedPageRobot.confirmWalletCredentials(walletType);
await walletKeysAndSeedPageRobot.confirmWalletCredentials(walletType);

await walletKeysAndSeedPageRobot.backToDashboard();
}
Loading