fix(integration_test): repair compile after chain removal; robust key taps

integration_test/ has not compiled since 784a082f1 removed SOL/TRX/ZEC/DCR/
ZANO/Haven: common_test_flows.dart and common_test_constants.dart still
referenced WalletType.solana/.tron/.zano/.decred/.zcash/.haven and secrets that
were never generated, and wallet_keys_robot branched on .solana/.tron. Any
`flutter drive` over these components failed at kernel compile.

- common_test_flows.dart: drop removed chains from both wallet-type switches.
- common_test_constants.dart: default test wallet SOL -> WOW (Wownero-first;
  SOL no longer exists), with a real WOW address.
- wallet_keys_robot.dart: EVM-only branch (solana/tron gone).
- common_test_cases.dart tapItemByKey: wait for the widget (up to 20s) instead
  of pumping a flat 500ms then asserting. Screens behind an async transition
  (PIN-setup success button) were a coin flip; this makes the failure honest
  ("not there after 20s") and the pass reliable. Pump loop, not pumpAndSettle,
  since the dashboard sync animation never settles.
This commit is contained in:
jwinterm
2026-08-02 21:29:40 -04:00
parent 44661ce592
commit f64ee19b0c
4 changed files with 30 additions and 27 deletions
@@ -14,12 +14,25 @@ class CommonTestCases {
String key, {
bool shouldPumpAndSettle = true,
int pumpDuration = 100,
Duration timeout = const Duration(seconds: 20),
}) async {
await tester.pump(Duration(milliseconds: 500));
final widgetFinder = find.byKey(ValueKey(key));
expect(tester.any(widgetFinder), true, reason: 'Widget with key "$key" should be visible');
// Wait for the widget to actually appear rather than pumping a flat 500ms
// and hoping. Screens that arrive behind an async transition (PIN setup's
// success button is the usual offender) are otherwise a coin flip, and the
// failure reads as "key missing" rather than "key not there YET".
//
// Deliberately a pump loop, not pumpAndSettle: the dashboard runs a
// perpetual sync-indicator animation, so settling never completes there.
final deadline = DateTime.now().add(timeout);
while (!tester.any(widgetFinder) && DateTime.now().isBefore(deadline)) {
await tester.pump(const Duration(milliseconds: 100));
}
expect(tester.any(widgetFinder), true,
reason: 'Widget with key "$key" should be visible '
'(waited ${timeout.inSeconds}s)');
final widget = widgetFinder.first;
await tester.tap(widget, warnIfMissed: false);
@@ -6,10 +6,13 @@ class CommonTestConstants {
static final String sendTestAmount = '0.00008';
static final String sendTestFiatAmount = '1.00';
static final String exchangeTestAmount = '0.01';
static final WalletType testWalletType = WalletType.solana;
// Hash Bags is Wownero-first and no longer ships Solana, so the defaults
// moved off SOL. WalletType.solana does not exist in this fork.
static final WalletType testWalletType = WalletType.wownero;
static final String testWalletName = 'Integrated Testing Wallet';
static final CryptoCurrency sendTestReceiveCurrency = CryptoCurrency.sol;
static final CryptoCurrency exchangeTestReceiveCurrency = CryptoCurrency.usdtSol;
static final CryptoCurrency exchangeTestDepositCurrency = CryptoCurrency.sol;
static final String testWalletAddress = '7TSTXnQZxQDA4JoNqs4DqVqE7oNWk2kmHkMT6DD6vw2S';
static final CryptoCurrency sendTestReceiveCurrency = CryptoCurrency.wow;
static final CryptoCurrency exchangeTestReceiveCurrency = CryptoCurrency.btc;
static final CryptoCurrency exchangeTestDepositCurrency = CryptoCurrency.wow;
static final String testWalletAddress =
'Wo3MWeKwtA918DU4c69hVSNgejdWFCRCuWjShRY66mJkU2Hv58eygJWDJS1MNa2Ge5M1WjUkGHJLAjaZYLBZnDh42Q2u1Es9J';
}
@@ -352,30 +352,21 @@ class CommonTestFlows {
return secrets.bitcoinCashTestWalletSeeds;
case WalletType.polygon:
return secrets.polygonTestWalletSeeds;
case WalletType.solana:
return secrets.solanaTestWalletSeeds;
case WalletType.base:
return secrets.baseTestWalletSeeds;
case WalletType.arbitrum:
return secrets.arbitrumTestWalletSeeds;
case WalletType.bsc:
return secrets.bscTestWalletSeeds;
case WalletType.tron:
return secrets.tronTestWalletSeeds;
case WalletType.nano:
return secrets.nanoTestWalletSeeds;
case WalletType.wownero:
return secrets.wowneroTestWalletSeeds;
case WalletType.zano:
return secrets.zanoTestWalletSeeds;
case WalletType.decred:
return secrets.decredTestWalletSeeds;
// Hash Bags does not ship SOL/TRX/ZEC/DCR/ZANO/Haven — those WalletType
// members no longer exist. dogecoin ships, but has no test seed in
// .secrets.g.dart.
case WalletType.dogecoin:
return secrets.dogeTestWalletSeeds;
case WalletType.zcash:
return secrets.zcashTestWalletSeeds;
case WalletType.none:
case WalletType.haven:
case WalletType.banano:
throw Exception("Unable to get seeds for ${walletType}");
}
@@ -402,10 +393,6 @@ class CommonTestFlows {
return secrets.arbitrumTestWalletReceiveAddress;
case WalletType.bsc:
return secrets.bscTestWalletReceiveAddress;
case WalletType.solana:
return secrets.solanaTestWalletReceiveAddress;
case WalletType.tron:
return secrets.tronTestWalletReceiveAddress;
case WalletType.nano:
return secrets.nanoTestWalletReceiveAddress;
case WalletType.wownero:
@@ -64,9 +64,9 @@ class WalletKeysAndSeedPageRobot {
tester.printToConsole('$walletName wallet has seeds properly displayed');
}
if (isEVMCompatibleChain(walletType) ||
walletType == WalletType.solana ||
walletType == WalletType.tron) {
// Hash Bags does not ship Solana or Tron; those WalletType members were
// removed with the chains, so only the EVM chains remain here.
if (isEVMCompatibleChain(walletType)) {
if (hasSeed) {
final seedWords = appStore.wallet!.seed!.split(" ");
for (var seedWord in seedWords) {