Skip to content
Snippets Groups Projects
Commit c60a8ad4 authored by poka's avatar poka
Browse files

make integration tests multilang

parent 2571baa9
No related branches found
No related tags found
No related merge requests found
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:gecko/models/widgets_keys.dart';
......@@ -25,9 +26,9 @@ void main() async {
await tapKey(keyConfirmSearch);
await waitFor(test5.shortAddress());
await tapKey(keySearchResult(test5.address));
await waitFor('Certifier');
await waitFor('Vous devez ', reverse: true);
await waitFor('Vous pourrez renouveler ', reverse: true);
await waitFor('certify'.tr());
await waitFor('mustWaitXBeforeCertify'.tr().substring(0, 6), reverse: true);
await waitFor('canRenewCertInX'.tr().substring(0, 8), reverse: true);
// Background pay 25
await bkPay(
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:gecko/models/widgets_keys.dart';
......@@ -35,7 +36,7 @@ void main() async {
Future payTest2() async {
spawnBlock(until: 13);
await waitFor('Rechercher');
await waitFor('searchWallet'.tr());
await tapKey(keyOpenSearch);
final addressToSearch = await clipPaste();
final endAddress = addressToSearch.substring(addressToSearch.length - 6);
......@@ -51,7 +52,7 @@ Future payTest2() async {
await tapKey(keyConfirmPayment);
spawnBlock(duration: 500);
await waitFor('validée !', timeout: const Duration(seconds: 1));
await waitFor('extrinsicValidated'.tr(), timeout: const Duration(seconds: 1));
await tapKey(keyCloseTransactionScreen, duration: 0);
await waitFor('12.14');
spawnBlock(duration: 500);
......@@ -64,9 +65,9 @@ Future certifyTest5() async {
await tapKey(keyCertify);
await tapKey(keyConfirm);
spawnBlock(duration: 500);
await waitFor('validée !', timeout: const Duration(seconds: 1));
await waitFor('extrinsicValidated'.tr(), timeout: const Duration(seconds: 1));
await tapKey(keyCloseTransactionScreen);
await waitFor('Identité créée');
await waitFor('identityCreated'.tr());
// Confirm Identity Test5
await tapKey(keyAppBarChest, duration: 300);
......@@ -77,15 +78,15 @@ Future certifyTest5() async {
await enterText(keyEnterIdentityUsername, test5.name);
await tapKey(keyConfirm);
spawnBlock(duration: 500);
await waitFor('validée !', timeout: const Duration(seconds: 1));
await waitFor('extrinsicValidated'.tr(), timeout: const Duration(seconds: 1));
await tapKey(keyCloseTransactionScreen);
await waitFor('Identité confirmée');
await waitFor('identityConfirmed'.tr());
humanRead(2);
// Set wallet 2 as default wallet
await goBack();
await tapKey(keyOpenWallet(test2.address));
await tapKey(keySetDefaultWallet);
await waitFor('Ce portefeuille est celui par defaut');
await waitFor('thisWalletIsDefault'.tr());
// Search Wallet 5 again
await tapKey(keyAppBarSearch);
......@@ -103,7 +104,7 @@ Future certifyTest5() async {
await tapKey(keyCertify);
await tapKey(keyConfirm);
spawnBlock(duration: 500);
await waitFor('validée !', timeout: const Duration(seconds: 1));
await waitFor('extrinsicValidated'.tr(), timeout: const Duration(seconds: 1));
await tapKey(keyCloseTransactionScreen);
await waitFor('2');
......@@ -118,14 +119,14 @@ Future certifyTest5() async {
await tapKey(keyCertify);
await tapKey(keyConfirm);
spawnBlock(duration: 500);
await waitFor('validée !', timeout: const Duration(seconds: 1));
await waitFor('extrinsicValidated'.tr(), timeout: const Duration(seconds: 1));
await tapKey(keyCloseTransactionScreen);
await waitFor('Vous devez attendre');
await waitFor('mustWaitXBeforeCertify'.substring(0, 12));
// Check if test5 is member
await tapKey(keyAppBarChest, duration: 300);
await tapKey(keyOpenWallet(test5.address));
await waitFor('Membre validé !');
await waitFor('memberValidated'.tr());
// spawn 20 blocs and check if ud is creating
await spawnBlock(until: 20);
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:gecko/models/widgets_keys.dart';
......@@ -32,16 +33,17 @@ void main() async {
await bkConfirmIdentity(fromAddress: test5.address, name: test5.name);
await bkCertify(fromAddress: test2.address, destAddress: test5.address);
await bkCertify(fromAddress: test3.address, destAddress: test5.address);
await waitFor('Membre validé !', exactMatch: true);
await waitFor('memberValidated'.tr(), exactMatch: true);
// Revoke test5
await tapKey(keyManageMembership, duration: 1000);
await tapKey(keyRevokeIdty);
await tapKey(keyConfirm);
spawnBlock(duration: 2000);
await waitFor('validée !', timeout: const Duration(seconds: 4));
await waitFor('extrinsicValidated'.tr().substring(3),
timeout: const Duration(seconds: 4));
await tapKey(keyCloseTransactionScreen, duration: 0);
await waitFor('Aucune identité', exactMatch: true);
await waitFor('noIdentity'.tr(), exactMatch: true);
await sleep();
// Check test1 cannot be revoked
......@@ -49,19 +51,7 @@ void main() async {
await tapKey(keyAddDerivation);
await tapKey(keyOpenWallet(test1.address), duration: 500);
await tapKey(keyManageMembership, duration: 1000);
await waitFor('Vous ne pouvez pas révoquer cette identité');
await waitFor('youCannotRevokeThisIdentity'.tr().substring(0, 15));
// // Try migrate test1 identity to test6 address
// await tapKey(keyMigrateIdentity);
// await tapKey(keySelectWallet);
// await tapKey(keySelectThisWallet(test6.address), selectLast: true);
// await spawnBlock(number: 100);
// await waitFor('Vous devez attendre', reverse: true);
// await waitForButtonEnabled(keyConfirm);
// await tapKey(keyConfirm, duration: 500);
// await spawnBlock(duration: 2000);
// await waitFor('validée !');
// await tapKey(keyCloseTransactionScreen, duration: 0);
// await sleep(5000);
}, timeout: testTimeout());
}
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
......@@ -20,7 +21,7 @@ void main() async {
// Go to test1 options and check if balance growup with UDs creations
await tapKey(keyAddDerivation);
await waitFor('Portefeuille 6');
await waitFor(' 6');
await scrollUntil(keyImportG1v1);
await tapKey(keyImportG1v1);
......@@ -43,12 +44,12 @@ void main() async {
await waitForButtonEnabled(keyConfirm);
await tapKey(keyConfirm);
spawnBlock(duration: 2000);
await waitFor('validée !');
await waitFor('extrinsicValidated'.tr());
await tapKey(keyCloseTransactionScreen, duration: 0);
await tapKey(keyOpenWallet(test6.address), duration: 300);
await waitFor('3', exactMatch: true);
await waitFor('Membre validé !');
await waitFor('memberValidated'.tr());
await waitFor('99.98', exactMatch: true);
}, timeout: testTimeout());
......
......@@ -152,12 +152,11 @@ Future onboardingNewChest() async {
// Check if string "Mon portefeuille co" is present in screen
await waitFor('currentWallet'.tr());
await waitFor('0.0', exactMatch: true);
// await waitFor('Scanner un');
}
Future addDerivation() async {
await tapKey(keyAddDerivation);
await waitFor('Portefeuille 5');
await waitFor(' 5');
}
Future firstOpenChest() async {
......
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
......@@ -302,14 +303,14 @@ Future bkFastStart([bool restoreChest = true]) async {
if (restoreChest) {
// Restore the test chest
await bkRestoreChest();
await waitFor("y'a pas de lézard");
await waitFor("noLizard".tr());
}
}
Future startWait() async {
app.main();
await waitFor('Test starting...', reverse: true);
await tester.pumpAndSettle(const Duration(milliseconds: 300));
await tester.pumpAndSettle(const Duration(seconds: 2));
await sleep(3000);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment