diff --git a/lib/screens/commonElements.dart b/lib/screens/commonElements.dart index 59bc2b6..80d4f78 100644 --- a/lib/screens/commonElements.dart +++ b/lib/screens/commonElements.dart @@ -7,7 +7,7 @@ class CommonElements { return Text('Coucou'); } - Widget bubbleSpeak(String text, {double long}) { + Widget bubbleSpeak(String text, {double long, Key textKey}) { return Bubble( padding: long == null ? BubbleEdges.all(18) @@ -18,6 +18,7 @@ class CommonElements { // nip: BubbleNip.leftTop, child: Text( text, + key: textKey, style: TextStyle( color: Colors.black, fontSize: 18, fontWeight: FontWeight.w400), ), diff --git a/lib/screens/home.dart b/lib/screens/home.dart index b21bc7d..e8951dc 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -257,6 +257,7 @@ class HomeScreen extends StatelessWidget { Column(children: [ Container( child: ClipOval( + key: Key('manageWallets'), child: Material( color: Color(0xffFFD58D), // button color child: InkWell( diff --git a/lib/screens/onBoarding/0_noKeychainFound.dart b/lib/screens/onBoarding/0_noKeychainFound.dart index d5c9acb..f4ed053 100644 --- a/lib/screens/onBoarding/0_noKeychainFound.dart +++ b/lib/screens/onBoarding/0_noKeychainFound.dart @@ -23,8 +23,8 @@ class NoKeyChainScreen extends StatelessWidget { child: Column(children: [ common.onboardingProgressBar(context, 'Mes portefeuilles', 0), common.bubbleSpeak( - "Je ne connais pour l’instant aucun de vos portefeuilles.\n\nVous pouvez en créer un nouveau, ou bien importer un portefeuille Cesium existant.", - ), + "Je ne connais pour l’instant aucun de vos portefeuilles.\n\nVous pouvez en créer un nouveau, ou bien importer un portefeuille Cesium existant.", + textKey: Key('textOnboarding')), SizedBox(height: 90), Container( child: ClipOval( diff --git a/pubspec.lock b/pubspec.lock index 6d1b885..8c8924d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,6 +1,20 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "20.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" archive: dependency: transitive description: @@ -64,6 +78,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + cli_util: + dependency: transitive + description: + name: cli_util + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" clock: dependency: transitive description: @@ -99,13 +120,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + coverage: + dependency: transitive + description: + name: coverage + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" crypto: dependency: "direct main" description: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" dubp: dependency: "direct main" description: @@ -153,6 +188,11 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_driver: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" flutter_launcher_icons: dependency: "direct main" description: @@ -191,6 +231,18 @@ packages: description: flutter source: sdk version: "0.0.0" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" globbing: dependency: transitive description: @@ -275,6 +327,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.13.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" http_parser: dependency: transitive description: @@ -324,6 +383,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.17.0" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" isolate: dependency: transitive description: @@ -352,6 +418,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.0" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" matcher: dependency: transitive description: @@ -366,6 +439,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.0" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" nested: dependency: transitive description: @@ -373,6 +453,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.0.4" + node_preamble: + dependency: transitive + description: + name: node_preamble + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" normalize: dependency: transitive description: @@ -380,6 +467,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.5.0-nullsafety.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" package_info: dependency: "direct main" description: @@ -541,6 +635,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.0" printing: dependency: "direct main" description: @@ -554,7 +655,7 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.1.0" + version: "4.2.1" provider: dependency: "direct main" description: @@ -562,6 +663,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.3.2+3" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" qr: dependency: transitive description: @@ -653,18 +761,60 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + shelf_static: + dependency: transitive + description: + name: shelf_static + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" sky_engine: dependency: transitive description: flutter source: sdk version: "0.0.99" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.10" source_span: dependency: transitive description: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" stack_trace: dependency: transitive description: @@ -699,7 +849,7 @@ packages: name: sync_http url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.3.0" system_info: dependency: transitive description: @@ -714,13 +864,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + test: + dependency: "direct main" + description: + name: test + url: "https://pub.dartlang.org" + source: hosted + version: "1.16.8" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19" + version: "0.3.0" + test_core: + dependency: transitive + description: + name: test_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.19" truncate: dependency: "direct main" description: @@ -749,6 +913,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0" + vm_service: + dependency: transitive + description: + name: vm_service + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.0+1" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" web_socket_channel: dependency: transitive description: @@ -756,6 +934,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + webdriver: + dependency: transitive + description: + name: webdriver + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" win32: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 89976f8..5c6eeb0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -34,7 +34,7 @@ dependencies: pdf: ^3.0.1 printing: ^5.0.2 shared_preferences: ^2.0.3 - sync_http: ^0.2.0 + sync_http: ^0.3.0 crypto: ^3.0.0 fast_base58: logger: ^1.0.0 @@ -47,6 +47,9 @@ dependencies: responsive_builder: ^0.3.0 jdenticon_dart: ^2.0.0 audioplayers: ^0.18.1 + flutter_driver: + sdk: flutter + test: ^1.16.6 flutter_icons: android: "ic_launcher" diff --git a/test_driver/app.dart b/test_driver/app.dart new file mode 100644 index 0000000..ec9a318 --- /dev/null +++ b/test_driver/app.dart @@ -0,0 +1,11 @@ +import 'package:flutter_driver/driver_extension.dart'; +import 'package:gecko/main.dart' as app; + +void main() { + // This line enables the extension. + enableFlutterDriverExtension(); + + // Call the `main()` function of the app, or call `runApp` with + // any widget you are interested in testing. + app.main(); +} diff --git a/test_driver/app_test.dart b/test_driver/app_test.dart new file mode 100644 index 0000000..f87cbf9 --- /dev/null +++ b/test_driver/app_test.dart @@ -0,0 +1,50 @@ +// Imports the Flutter Driver API. +import 'package:flutter_driver/flutter_driver.dart'; +// import 'package:flutter_test/flutter_test.dart'; +import 'package:test/test.dart'; + +void main() { + group('Counter App', () { + // First, define the Finders and use them to locate widgets from the + // test suite. Note: the Strings provided to the `byValueKey` method must + // be the same as the Strings we used for the Keys in step 1. + final manageWalletsFinder = find.byValueKey('manageWallets'); + // final buttonFinder = find.byValueKey('increment'); + + FlutterDriver driver; + + // Connect to the Flutter driver before running any tests. + setUpAll(() async { + driver = await FlutterDriver.connect(); + await driver.waitUntilFirstFrameRasterized(); + }); + + // Close the connection to the driver after the tests have completed. + tearDownAll(() async { + if (driver != null) { + driver.close(); + } + }); + + test('Open wallets management', () async { + await driver.runUnsynchronized(() async { + // First, tap the button. + await driver.tap(manageWalletsFinder); + + // tester.tap(find.widgetWithText(Button, 'Update')); + // + + SerializableFinder textOnboarding = find.byValueKey( + 'textOnboarding', + ); + + print( + '####################################################################'); + + // Then, verify the counter text is incremented by 1. + expect(await driver.getText(textOnboarding), + "Je ne connais pour l’instant aucun de vos portefeuilles.\n\nVous pouvez en créer un nouveau, ou bien importer un portefeuille Cesium existant."); + }); + }); + }); +}