gecko/integration_test/scenarios/cert_state.dart

62 lines
2.3 KiB
Dart
Raw Normal View History

2023-02-28 17:04:31 +01:00
import 'package:easy_localization/easy_localization.dart';
2022-08-27 05:43:43 +02:00
import 'package:flutter_test/flutter_test.dart';
import 'package:gecko/models/widgets_keys.dart';
import 'package:integration_test/integration_test.dart';
2022-09-09 01:12:17 +02:00
import '../utility/general_actions.dart';
import '../utility/tests_utility.dart';
2022-08-27 05:43:43 +02:00
void main() async {
2022-08-27 05:43:43 +02:00
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
2023-03-10 17:54:35 +01:00
// await dotenv.load();
2022-08-27 05:43:43 +02:00
testWidgets('Certifications state', (testerLoc) async {
tester = testerLoc;
// Connect local node and import test chest in background
await bkFastStart();
2022-08-27 05:43:43 +02:00
// Open chest
await firstOpenChest();
2022-09-09 01:12:17 +02:00
spawnBlock(until: 15);
await goBack();
2022-08-27 05:43:43 +02:00
// Go wallet 5 view
await tapKey(keyOpenSearch);
await enterText(keySearchField, test5.address);
await tapKey(keyConfirmSearch);
await waitFor(test5.shortAddress());
await tapKey(keySearchResult(test5.address));
await waitFor('createIdentity'.tr());
2023-02-28 17:04:31 +01:00
await waitFor('mustWaitXBeforeCertify'.tr().substring(0, 6), reverse: true);
await waitFor('canRenewCertInX'.tr().substring(0, 8), reverse: true);
2022-08-27 05:43:43 +02:00
// Background pay 25
await bkPay(
2022-08-27 05:43:43 +02:00
fromAddress: test1.address, destAddress: test5.address, amount: 25);
2022-09-11 13:14:52 +02:00
await waitFor('25.0', exactMatch: true);
await spawnBlock();
2022-09-11 13:14:52 +02:00
await waitFor('22.0', exactMatch: true);
2022-09-09 01:12:17 +02:00
await bkCertify(
fromAddress: test1.address,
destAddress: test5.address,
spawnBloc: false);
await bkConfirmIdentity(fromAddress: test5.address, name: test5.name);
2022-09-09 01:12:17 +02:00
await waitFor('1', exactMatch: true);
await bkCertify(
fromAddress: test2.address,
destAddress: test5.address,
spawnBloc: false);
// await waitFor('2', exactMatch: true);
await bkCertify(fromAddress: test3.address, destAddress: test5.address);
await waitFor('3', exactMatch: true);
await bkCertify(fromAddress: test4.address, destAddress: test5.address);
await waitFor('4', exactMatch: true);
2022-09-09 01:12:17 +02:00
// await bkPay(
// fromAddress: test2.address, destAddress: test5.address, amount: 40);
2022-09-11 13:14:52 +02:00
await waitFor('21.99', exactMatch: true);
2022-09-09 01:12:17 +02:00
await spawnBlock(until: 30);
2022-09-11 13:14:52 +02:00
await waitFor('121.99', exactMatch: true);
2022-09-09 01:12:17 +02:00
await spawnBlock(until: 40);
2022-09-11 13:14:52 +02:00
await waitFor('221.99', exactMatch: true);
}, timeout: testTimeout());
2022-08-27 05:43:43 +02:00
}