diff --git a/.env b/.env new file mode 100644 index 0000000..797c39f --- /dev/null +++ b/.env @@ -0,0 +1 @@ +ip_address=127.0.0.1 diff --git a/.gitignore b/.gitignore index b021e4e..e903697 100644 --- a/.gitignore +++ b/.gitignore @@ -56,5 +56,4 @@ AppDir/ appimage-builder-cache/ AppImageBuilder.yml android/app/build.gradle -.env integration_test/duniter/data/chains/ \ No newline at end of file diff --git a/integration_test/gecko_complete.dart b/integration_test/gecko_complete.dart index 07e43c0..7c7c3a7 100644 --- a/integration_test/gecko_complete.dart +++ b/integration_test/gecko_complete.dart @@ -18,16 +18,16 @@ void main() { // Change Duniter endpoint to local await changeNode(tester); - // Delete all existing chests + // Delete all existing chests is exists await deleteAllWallets(tester); - // Restore a chest + // Restore the test chest await restoreChest(tester); // Execute a transaction to test2 await payTest2(tester); - // Certify test5 account with 3 account to become member + // Certify test5 account with 3 accounts to become member await certifyTest5(tester); }); } @@ -47,7 +47,6 @@ Future changeNode(WidgetTester tester) async { await goBack(tester); } -// Customs actions Future deleteAllWallets(WidgetTester tester) async { if (await isPresent(tester, 'Rechercher')) { await goKey(tester, keyDrawerMenu); @@ -133,7 +132,6 @@ Future payTest2(WidgetTester tester) async { await goKey(tester, keyPay); await enterText(tester, keyAmountField, '12.14'); await goKey(tester, keyConfirmPayment); - // await sleep(tester); await spawnBlock(tester, keyCloseTransactionScreen); await waitFor(tester, 'validé !', timeout: const Duration(seconds: 1)); @@ -150,8 +148,6 @@ Future addDerivation(WidgetTester tester) async { Future certifyTest5(WidgetTester tester) async { // Create identity with Test1 account - // await spawnBlock(tester, keyViewActivity, 5); - // await sleep(tester); await goKey(tester, keyCertify); await goKey(tester, keyConfirm); await spawnBlock(tester, keyViewActivity, duration: 500); @@ -171,12 +167,15 @@ Future certifyTest5(WidgetTester tester) async { await waitFor(tester, 'validé !', timeout: const Duration(seconds: 1)); await goKey(tester, keyCloseTransactionScreen); await waitFor(tester, 'Identité confirmée'); + + // Set wallet 2 as default wallet await goBack(tester); await goKey(tester, keyOpenWallet('5E4i8vcNjnrDp21Sbnp32WHm2gz8YP3GGFwmdpfg5bHd8Whb')); await goKey(tester, keySetDefaultWallet); await waitFor(tester, 'Ce portefeuille est celui par defaut'); + // Search Wallet 5 again await goKey(tester, keyAppBarSearch); final addressToSearch = (await Clipboard.getData('text/plain'))!.text; final endAddress = addressToSearch!.substring(addressToSearch.length - 6); diff --git a/integration_test/launch_test.sh b/integration_test/launch_test.sh index aa72d85..c4a4b87 100755 --- a/integration_test/launch_test.sh +++ b/integration_test/launch_test.sh @@ -21,6 +21,9 @@ cd ../.. # Start integration test flutter test integration_test/$testName.dart +# Reset .env +echo "ip_address=127.0.0.1" > .env + # Stop Duniter cd integration_test/duniter docker-compose down diff --git a/integration_test/tests_utility.dart b/integration_test/tests_utility.dart index e3d31a5..260f391 100644 --- a/integration_test/tests_utility.dart +++ b/integration_test/tests_utility.dart @@ -4,7 +4,7 @@ import 'package:gecko/globals.dart'; import 'package:gecko/providers/substrate_sdk.dart'; import 'package:provider/provider.dart'; -// CUSTOM METHODS +// CUSTOM FUNCTIONS Future sleep(WidgetTester tester, [int time = 1000]) async { await Future.delayed(Duration(milliseconds: time));