test: fix and adapt test to latest UI
This commit is contained in:
parent
e3dc579da7
commit
a13d19177b
|
@ -5,8 +5,7 @@ services:
|
||||||
container_name: duniter-v2s-gecko-tests
|
container_name: duniter-v2s-gecko-tests
|
||||||
# image: duniter/duniter-v2s:debug-sha-4d5e08be
|
# image: duniter/duniter-v2s:debug-sha-4d5e08be
|
||||||
image: duniter/duniter-v2s:debug-sha-44b09061
|
image: duniter/duniter-v2s:debug-sha-44b09061
|
||||||
command: --alice
|
command: --alice --sealing=manual
|
||||||
# --sealing=manual
|
|
||||||
ports:
|
ports:
|
||||||
- "127.0.0.1:9615:9615"
|
- "127.0.0.1:9615:9615"
|
||||||
- "127.0.0.1:9933:9933"
|
- "127.0.0.1:9933:9933"
|
||||||
|
|
|
@ -65,10 +65,11 @@ Future payTest2() async {
|
||||||
|
|
||||||
Future certifyTest5() async {
|
Future certifyTest5() async {
|
||||||
// Create identity with Test1 account
|
// Create identity with Test1 account
|
||||||
|
await pump(number: 8);
|
||||||
await tapKey(keyCertify);
|
await tapKey(keyCertify);
|
||||||
await tapKey(keyConfirm);
|
await tapKey(keyConfirm);
|
||||||
spawnBlock(duration: 1000);
|
spawnBlock(duration: 1000);
|
||||||
await tester.pump(const Duration(seconds: 2));
|
await pump(number: 3);
|
||||||
await waitFor('sending'.tr(),
|
await waitFor('sending'.tr(),
|
||||||
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
||||||
await tapKey(keyCloseTransactionScreen);
|
await tapKey(keyCloseTransactionScreen);
|
||||||
|
@ -83,7 +84,7 @@ Future certifyTest5() async {
|
||||||
await enterText(keyEnterIdentityUsername, test5.name);
|
await enterText(keyEnterIdentityUsername, test5.name);
|
||||||
await tapKey(keyConfirm);
|
await tapKey(keyConfirm);
|
||||||
spawnBlock(duration: 1000);
|
spawnBlock(duration: 1000);
|
||||||
await tester.pump(const Duration(seconds: 2));
|
await pump(number: 3);
|
||||||
await waitFor('sending'.tr(),
|
await waitFor('sending'.tr(),
|
||||||
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
||||||
await tapKey(keyCloseTransactionScreen);
|
await tapKey(keyCloseTransactionScreen);
|
||||||
|
@ -111,7 +112,7 @@ Future certifyTest5() async {
|
||||||
await tapKey(keyCertify);
|
await tapKey(keyCertify);
|
||||||
await tapKey(keyConfirm);
|
await tapKey(keyConfirm);
|
||||||
spawnBlock(duration: 1000);
|
spawnBlock(duration: 1000);
|
||||||
await tester.pump(const Duration(seconds: 2));
|
await pump(number: 3);
|
||||||
await waitFor('sending'.tr(),
|
await waitFor('sending'.tr(),
|
||||||
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
||||||
await tapKey(keyCloseTransactionScreen);
|
await tapKey(keyCloseTransactionScreen);
|
||||||
|
@ -119,16 +120,16 @@ Future certifyTest5() async {
|
||||||
|
|
||||||
// Change default wallet to test3
|
// Change default wallet to test3
|
||||||
await tapKey(keyPay);
|
await tapKey(keyPay);
|
||||||
await tapKey(keyChangeChest);
|
await tapKey(keyDropdownWallets);
|
||||||
await tapKey(keySelectThisWallet(test3.address));
|
await tapKey(keySelectThisWallet(test3.address));
|
||||||
await tapKey(keyConfirm);
|
await tapKey(keyPopButton);
|
||||||
await sleep();
|
await sleep();
|
||||||
|
|
||||||
// Certify with test3 account
|
// Certify with test3 account
|
||||||
await tapKey(keyCertify);
|
await tapKey(keyCertify);
|
||||||
await tapKey(keyConfirm);
|
await tapKey(keyConfirm);
|
||||||
spawnBlock(duration: 1000);
|
spawnBlock(duration: 1000);
|
||||||
await tester.pump(const Duration(seconds: 2));
|
await pump(number: 3);
|
||||||
await waitFor('sending'.tr(),
|
await waitFor('sending'.tr(),
|
||||||
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
||||||
await tapKey(keyCloseTransactionScreen);
|
await tapKey(keyCloseTransactionScreen);
|
||||||
|
|
|
@ -44,6 +44,7 @@ void main() async {
|
||||||
await tapKey(keyConfirm);
|
await tapKey(keyConfirm);
|
||||||
spawnBlock(duration: 1000);
|
spawnBlock(duration: 1000);
|
||||||
await tester.pump(const Duration(seconds: 2));
|
await tester.pump(const Duration(seconds: 2));
|
||||||
|
await tester.pump(const Duration(seconds: 1));
|
||||||
await waitFor('sending'.tr(),
|
await waitFor('sending'.tr(),
|
||||||
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
reverse: true, settle: false, timeout: const Duration(seconds: 20));
|
||||||
await tapKey(keyCloseTransactionScreen, duration: 0);
|
await tapKey(keyCloseTransactionScreen, duration: 0);
|
||||||
|
@ -52,7 +53,7 @@ void main() async {
|
||||||
await waitFor('3', exactMatch: true);
|
await waitFor('3', exactMatch: true);
|
||||||
await waitFor('memberValidated'.tr());
|
await waitFor('memberValidated'.tr());
|
||||||
|
|
||||||
await waitFor('99.98', exactMatch: true);
|
await waitFor('110.01', exactMatch: true);
|
||||||
}, timeout: testTimeout());
|
}, timeout: testTimeout());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ Future changeNode() async {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future deleteAllWallets() async {
|
Future deleteAllWallets() async {
|
||||||
if (await isPresent('Rechercher')) {
|
if (await isPresent('searchWallet'.tr())) {
|
||||||
await tapKey(keyDrawerMenu);
|
await tapKey(keyDrawerMenu);
|
||||||
await tapKey(keyParameters);
|
await tapKey(keyParameters);
|
||||||
|
|
||||||
|
@ -65,15 +65,17 @@ Future restoreChest() async {
|
||||||
// Enter password
|
// Enter password
|
||||||
await enterText(keyPinForm, 'AAAAA', 0);
|
await enterText(keyPinForm, 'AAAAA', 0);
|
||||||
|
|
||||||
|
// pump a few frame
|
||||||
|
await pump(duration: const Duration(milliseconds: 500), number: 10);
|
||||||
|
|
||||||
// Check if string "Accéder à mon coffre" is present in screen
|
// Check if string "Accéder à mon coffre" is present in screen
|
||||||
await waitFor('accessMyChest'.tr(), pumpDuration: 30);
|
await waitFor('accessMyChest'.tr(), settle: false);
|
||||||
|
|
||||||
// Go to wallets home
|
// Go to wallets home
|
||||||
await tapKey(keyGoWalletsHome, duration: 0);
|
await tapKey(keyGoWalletsHome, duration: 0);
|
||||||
|
|
||||||
// Skip tutorial
|
// Skip tutorial
|
||||||
await sleep(500);
|
await skipWalletDragTutorial();
|
||||||
await tapKey(keyDragAndDrop).timeout(const Duration(seconds: 3));
|
|
||||||
|
|
||||||
// Check if string "ĞD" is present in screen
|
// Check if string "ĞD" is present in screen
|
||||||
await waitFor('ĞD');
|
await waitFor('ĞD');
|
||||||
|
@ -168,5 +170,15 @@ Future firstOpenChest() async {
|
||||||
final isCached = await isIconPresent(Icons.check_box);
|
final isCached = await isIconPresent(Icons.check_box);
|
||||||
if (!isCached) await tapKey(keyCachePassword, duration: 0);
|
if (!isCached) await tapKey(keyCachePassword, duration: 0);
|
||||||
await enterText(keyPinForm, 'AAAAA', 0);
|
await enterText(keyPinForm, 'AAAAA', 0);
|
||||||
await waitFor('100.0', exactMatch: true);
|
await skipWalletDragTutorial();
|
||||||
|
await waitFor(test1.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future skipWalletDragTutorial() async {
|
||||||
|
await pump(duration: const Duration(milliseconds: 500), number: 4);
|
||||||
|
await pump(duration: const Duration(seconds: 2));
|
||||||
|
if (await isPresent('explainDraggableWallet'.tr().substring(0, 13),
|
||||||
|
timeout: const Duration(seconds: 5), settle: false)) {
|
||||||
|
await tapKey(keyDragAndDrop, duration: 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,15 @@ Future sleep([int time = 1000]) async {
|
||||||
await Future.delayed(Duration(milliseconds: time));
|
await Future.delayed(Duration(milliseconds: time));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future pump(
|
||||||
|
{Duration duration = const Duration(milliseconds: 300),
|
||||||
|
int number = 1}) async {
|
||||||
|
for (int i = 0; i < number; i++) {
|
||||||
|
log.d("pump $i");
|
||||||
|
await tester.pump(duration = duration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<String> clipPaste() async =>
|
Future<String> clipPaste() async =>
|
||||||
(await Clipboard.getData('text/plain'))?.text ?? '';
|
(await Clipboard.getData('text/plain'))?.text ?? '';
|
||||||
|
|
||||||
|
@ -146,7 +155,8 @@ Future<void> waitFor(String text,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settle) {
|
if (settle) {
|
||||||
await tester.pumpAndSettle(Duration(milliseconds: pumpDuration));
|
await tester.pumpAndSettle(Duration(milliseconds: pumpDuration),
|
||||||
|
EnginePhase.sendSemanticsUpdate, timeout);
|
||||||
}
|
}
|
||||||
await Future.delayed(const Duration(milliseconds: 100));
|
await Future.delayed(const Duration(milliseconds: 100));
|
||||||
} while (reverse ? finder.evaluate().isNotEmpty : finder.evaluate().isEmpty);
|
} while (reverse ? finder.evaluate().isNotEmpty : finder.evaluate().isEmpty);
|
||||||
|
@ -155,9 +165,9 @@ Future<void> waitFor(String text,
|
||||||
|
|
||||||
// Test if text is visible on screen, return a boolean
|
// Test if text is visible on screen, return a boolean
|
||||||
Future<bool> isPresent(String text,
|
Future<bool> isPresent(String text,
|
||||||
{Duration timeout = const Duration(seconds: 1)}) async {
|
{Duration timeout = const Duration(seconds: 1), bool settle = true}) async {
|
||||||
try {
|
try {
|
||||||
await waitFor(text, timeout: timeout);
|
await waitFor(text, timeout: timeout, settle: settle);
|
||||||
humanRead();
|
humanRead();
|
||||||
return true;
|
return true;
|
||||||
} catch (exception) {
|
} catch (exception) {
|
||||||
|
@ -278,8 +288,8 @@ Future<WalletData> _addImportAccount(
|
||||||
Future bkDeleteAllWallets() async {
|
Future bkDeleteAllWallets() async {
|
||||||
final myWalletProvider =
|
final myWalletProvider =
|
||||||
Provider.of<MyWalletsProvider>(homeContext, listen: false);
|
Provider.of<MyWalletsProvider>(homeContext, listen: false);
|
||||||
final isWalletsPresents =
|
final isWalletsPresents = await isPresent('scanQRCode'.tr(),
|
||||||
await isPresent('Scanner un', timeout: const Duration(milliseconds: 300));
|
timeout: const Duration(milliseconds: 300));
|
||||||
if (isWalletsPresents) {
|
if (isWalletsPresents) {
|
||||||
await walletBox.clear();
|
await walletBox.clear();
|
||||||
await chestBox.clear();
|
await chestBox.clear();
|
||||||
|
|
|
@ -98,6 +98,8 @@ const keyCesiumPassword = Key('keyCesiumPassword');
|
||||||
const keySelectWallet = Key('keySelectWallet');
|
const keySelectWallet = Key('keySelectWallet');
|
||||||
const keyCesiumIdVisible = Key('keyCesiumIdVisible');
|
const keyCesiumIdVisible = Key('keyCesiumIdVisible');
|
||||||
|
|
||||||
|
const keyDropdownWallets = Key('keyDropdownKey');
|
||||||
|
|
||||||
// Items keys
|
// Items keys
|
||||||
Key keyTransaction(int keyId) => Key('keyTransaction$keyId');
|
Key keyTransaction(int keyId) => Key('keyTransaction$keyId');
|
||||||
Key keyMnemonicWord(String word) => Key('keyMnemonicWord$word');
|
Key keyMnemonicWord(String word) => Key('keyMnemonicWord$word');
|
||||||
|
|
|
@ -343,7 +343,7 @@ class WalletOptions extends StatelessWidget {
|
||||||
future: sub.idtyStatus(walletProvider.address.text),
|
future: sub.idtyStatus(walletProvider.address.text),
|
||||||
initialData: '',
|
initialData: '',
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
if (snapshot.data == 'Created') {
|
if (snapshot.data == IdtyStatus.created) {
|
||||||
return Column(children: [
|
return Column(children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 320,
|
width: 320,
|
||||||
|
@ -542,7 +542,7 @@ class WalletOptions extends StatelessWidget {
|
||||||
// WalletData defaultWallet = _myWalletProvider.getDefaultWallet()!;
|
// WalletData defaultWallet = _myWalletProvider.getDefaultWallet()!;
|
||||||
// defaultWallet = wallet;
|
// defaultWallet = wallet;
|
||||||
await sub.setCurrentWallet(wallet);
|
await sub.setCurrentWallet(wallet);
|
||||||
myWalletProvider.readAllWallets(currentChest);
|
await myWalletProvider.readAllWallets(currentChest);
|
||||||
myWalletProvider.reload();
|
myWalletProvider.reload();
|
||||||
walletOptions.reload();
|
walletOptions.reload();
|
||||||
}
|
}
|
||||||
|
@ -575,9 +575,9 @@ class WalletOptions extends StatelessWidget {
|
||||||
onTap: canDelete
|
onTap: canDelete
|
||||||
? () async {
|
? () async {
|
||||||
await walletOptions.deleteWallet(context, wallet);
|
await walletOptions.deleteWallet(context, wallet);
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) async {
|
||||||
myWalletProvider.listWallets =
|
myWalletProvider.listWallets =
|
||||||
myWalletProvider.readAllWallets(currentChest);
|
await myWalletProvider.readAllWallets(currentChest);
|
||||||
myWalletProvider.reload();
|
myWalletProvider.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,6 @@ void paymentPopup(BuildContext context, String toAddress, String username) {
|
||||||
var defaultWallet = myWalletProvider.getDefaultWallet();
|
var defaultWallet = myWalletProvider.getDefaultWallet();
|
||||||
bool canValidate = false;
|
bool canValidate = false;
|
||||||
final amountFocus = FocusNode();
|
final amountFocus = FocusNode();
|
||||||
final dropdownKey = GlobalKey();
|
|
||||||
|
|
||||||
walletViewProvider.payAmount.text = '';
|
walletViewProvider.payAmount.text = '';
|
||||||
|
|
||||||
|
@ -132,6 +131,7 @@ void paymentPopup(BuildContext context, String toAddress, String username) {
|
||||||
fontSize: 26, fontWeight: FontWeight.w700),
|
fontSize: 26, fontWeight: FontWeight.w700),
|
||||||
),
|
),
|
||||||
IconButton(
|
IconButton(
|
||||||
|
key: keyPopButton,
|
||||||
iconSize: 40,
|
iconSize: 40,
|
||||||
icon: const Icon(Icons.cancel_outlined),
|
icon: const Icon(Icons.cancel_outlined),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
@ -152,7 +152,7 @@ void paymentPopup(BuildContext context, String toAddress, String username) {
|
||||||
return DropdownButton(
|
return DropdownButton(
|
||||||
dropdownColor: const Color(0xffffeed1),
|
dropdownColor: const Color(0xffffeed1),
|
||||||
elevation: 12,
|
elevation: 12,
|
||||||
key: dropdownKey,
|
key: keyDropdownWallets,
|
||||||
value: defaultWallet,
|
value: defaultWallet,
|
||||||
menuMaxHeight: 300,
|
menuMaxHeight: 300,
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
@ -197,6 +197,7 @@ void paymentPopup(BuildContext context, String toAddress, String username) {
|
||||||
.map((WalletData wallet) {
|
.map((WalletData wallet) {
|
||||||
return DropdownMenuItem(
|
return DropdownMenuItem(
|
||||||
value: wallet,
|
value: wallet,
|
||||||
|
key: keySelectThisWallet(wallet.address),
|
||||||
child: Container(
|
child: Container(
|
||||||
color: const Color(0xffffeed1),
|
color: const Color(0xffffeed1),
|
||||||
width: 408,
|
width: 408,
|
||||||
|
|
|
@ -100,8 +100,8 @@ class SearchResult extends StatelessWidget {
|
||||||
walletsProfilesClass.address = g1Wallet.address;
|
walletsProfilesClass.address = g1Wallet.address;
|
||||||
return WalletViewScreen(
|
return WalletViewScreen(
|
||||||
address: g1Wallet.address,
|
address: g1Wallet.address,
|
||||||
username: g1WalletsBox.get(g1Wallet)!.username ?? '',
|
username: g1Wallet.username ?? '',
|
||||||
avatar: g1WalletsBox.get(g1Wallet.address)?.avatar,
|
avatar: g1Wallet.avatar,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue