encointer / encointer-wallet-flutter

Encointer mobile wallet flutter implementation

Home Page:https://encointer.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use Patrol for integration testing

clangenb opened this issue · comments

It seems that it is, in general, less painful to work with patrol than dart native integration test package, as they have written some bridges into native Android/IOS code to fix some systematic shortcomings of native dart code on a device, see https://leancode.co/blog/patrol-2-0-improved-flutter-ui-testing.

Some of these improvements are:

  • Group dependent tests, and have those groups executed without having to rebuild the app in between (will save us like 5-10 minutes of CI time).
  • A fatal crash in a group won't stop execution of the rest of the tests.

See getting started: https://patrol.leancode.co/getting-started

Nice features:

@Eldar2021 I have the feeling that this topic is interesting for you ;)

Wow! 😮
I didn't hear about this. Thank you :)

If it's not too urgent, I'd like to take this assignment for myself.

Haha, no it is not urgent. I doubt that I would find the time to do it soon. Thank you very much for your interest in doing that! :) However, please tell us when you start so that I don't do it at the same time accidentally.

It's great! I'm splitting time this weekend.

I am trying complete this task on this branch. But I can not run, I think we are have problem with our flavors.
https://github.com/encointer/encointer-wallet-flutter/tree/el/implement-patrol

Can you give me some more details about what you do and what fails?

Android error

macbook_pro@MacBook-Pro-Eldiiar-Almazbek app % patrol test -t integration_test/example_test.dart --flavor dev
In next major release, patrolTest method will be intended for UI tests.
If you want to use Patrol in your widget tests, use patrol_finders package.

For more information, see https://patrol.leancode.co/patrol-finders-release
Disable this warning by setting the PATROL_FINDERS environment variable.
      

Update available! 2.3.0 → 2.3.1+1
Run patrol update to update

No device specified, using the first one (emulator-5554)
• Building apk with entrypoint test_bundle.dart...
✓ Completed building apk with entrypoint test_bundle.dart (8.6s)
• Executing tests of apk with entrypoint test_bundle.dart on emulator-5554...
✓ Completed executing apk with entrypoint test_bundle.dart on emulator-5554 (18.2s)
Failed to call finalizer: AdbExecutableNotFound: No such file or directory
AdbExecutableNotFound: No such file or directory
#0      Adb._ensureServerRunning (package:adb/src/adb.dart:238:7)
<asynchronous suspension>
#1      Adb.uninstall (package:adb/src/adb.dart:79:5)
<asynchronous suspension>
#2      AndroidTestBackend.uninstall (package:patrol_cli/src/android/android_test_backend.dart:147:5)
<asynchronous suspension>
#3      TestCommand._execute (package:patrol_cli/src/commands/test.dart:286:9)
<asynchronous suspension>
#4      TestCommand.run (package:patrol_cli/src/commands/test.dart:169:23)
<asynchronous suspension>
#5      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#6      PatrolCommandRunner.runCommand (package:patrol_cli/src/runner/patrol_command_runner.dart:322:18)
<asynchronous suspension>
#7      PatrolCommandRunner.run (package:patrol_cli/src/runner/patrol_command_runner.dart:266:18)
<asynchronous suspension>
#8      patrolCommandRunner (package:patrol_cli/src/runner/patrol_command_runner.dart:77:20)
<asynchronous suspension>
#9      main (file:///Users/eldiiar/.pub-cache/hosted/pub.dev/patrol_cli-2.3.0/bin/main.dart:6:20)
<asynchronous suspension>

I searched about it, I fount leancodepl/patrol#1106
But I can't fix (

This seems that patrol can't find adb, which is the communication tool between the computed and the emulator. Maybe you just need to set some environment variable to tell patrol where your adb is installed.