From 525c375c71bc5cd2a7e3d1e9137a4c42e1d7a9b6 Mon Sep 17 00:00:00 2001 From: poka Date: Sat, 27 Aug 2022 23:27:02 +0200 Subject: [PATCH] add test: certs state on wallet view --- integration_test/cert_state.dart | 21 +++++++++++++++++++-- integration_test/tests_utility.dart | 15 +++++++++------ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/integration_test/cert_state.dart b/integration_test/cert_state.dart index d3e589a..2ecdb18 100644 --- a/integration_test/cert_state.dart +++ b/integration_test/cert_state.dart @@ -32,6 +32,7 @@ void main() { await waitFor(tester, 'Vous devez ', reverse: true); await waitFor(tester, 'Vous pourrez renouveler ', reverse: true); + // await spawnBlock(tester, number: 10); // Background pay 25 await pay(tester, fromAddress: test1.address, destAddress: test5.address, amount: 25); @@ -42,9 +43,24 @@ void main() { fromAddress: test1.address, destAddress: test5.address); await waitFor(tester, '1', exactMatch: true); await confirmIdentity(tester, fromAddress: test5.address, name: test5.name); - await spawnBlock(tester, number: 10); await certify(tester, fromAddress: test2.address, destAddress: test5.address); + + // // Change default wallet to test3 + // await goKey(tester, keyPay); + // await goKey(tester, keyChangeChest); + // await goKey(tester, keySelectThisWallet(test2.address)); + // await goKey(tester, keyConfirm); + // await sleep(tester); + + // // Certify with test3 account + // await goKey(tester, keyCertify); + // await goKey(tester, keyConfirm); + // await spawnBlock(tester, duration: 500); + // await waitFor(tester, 'validé !', timeout: const Duration(seconds: 1)); + // await goKey(tester, keyCloseTransactionScreen); + // await waitFor(tester, 'Vous devez attendre'); + await waitFor(tester, '2', exactMatch: true); await certify(tester, fromAddress: test3.address, destAddress: test5.address); @@ -54,6 +70,7 @@ void main() { await waitFor(tester, '4', exactMatch: true); await pay(tester, fromAddress: test2.address, destAddress: test5.address, amount: 40); - await waitFor(tester, '62.0 $currencyName'); + await waitFor(tester, '61.99 $currencyName'); + await spawnBlock(tester, until: 25); }); } diff --git a/integration_test/tests_utility.dart b/integration_test/tests_utility.dart index 39785c3..5c5a410 100644 --- a/integration_test/tests_utility.dart +++ b/integration_test/tests_utility.dart @@ -99,12 +99,15 @@ Future isIconPresent(WidgetTester tester, IconData icon, } Future spawnBlock(WidgetTester tester, - {int number = 1, int duration = 200}) async { + {int number = 1, int duration = 200, int? until}) async { if (duration != 0) { await sleep(tester, duration); } - sub.spawnBlock(number); - await sleep(tester, 500); + if (until != null) { + number = until - sub.blocNumber; + } + await sub.spawnBlock(number); + await sleep(tester, 200); } Future pay(WidgetTester tester, @@ -116,21 +119,21 @@ Future pay(WidgetTester tester, destAddress: destAddress, amount: amount, password: 'AAAAA'); - spawnBlock(tester, duration: 500); + await spawnBlock(tester); await sleep(tester, 500); } Future certify(WidgetTester tester, {required String fromAddress, required String destAddress}) async { sub.certify(fromAddress, destAddress, 'AAAAA'); - spawnBlock(tester, duration: 500); + await spawnBlock(tester); await sleep(tester, 500); } Future confirmIdentity(WidgetTester tester, {required String fromAddress, required String name}) async { sub.confirmIdentity(fromAddress, name, 'AAAAA'); - spawnBlock(tester, duration: 500); + await spawnBlock(tester); await sleep(tester, 500); }