I’ve written some easy articles about Flutter x Appium. [Appium][Flutter]Espresso driver x Flutter, [Flutter]Flutter app with Appium .
Recently, some topics about accessibility feature/Espresso/EarlGrey are in Flutter issues. issue1, issue2, issue3. Their main topic is how to overwrap Espresso/EarlGrey and Flutter. Their main concept is Espresso-Web according to their issues. Anyway, the topics are very exciting for test automation world.
In https://github.com/KazuCocoa/proto-flutter-driver-server , I tried to launch HttpServer inside Flutter world to handle flutter_driver via HTTP requests. If it works well, we can communicate with the flutter_driver via Appium easily.
Below is the result. Basic functionality is probably fine. As my code, I simply calls flutter_driver inside HttpServer. Clients send HTTP requests, then the http server calls flutter_driver APIs. The server returns the result to the clients.
One concern is we should call app.main() as flutter_driver does to launch Flutter View. After that, the flutter_driver connects to the main view. e.g. https://github.com/KazuCocoa/proto-flutter-driver-server/blob/master/test_driver/app_test.dart
Flutter generates apks/ipas in order to make their outputs work on Android/iOS framework. Thus, so far, it is not easy to connect to the Flutter scheme from such release apks/ipas. If Flutter team works for Espresso/EarlGrey more, I assume such issue will also alleviate more.
Conclusion
I was able to launch http server inside Flutter world. I could also communicate with Flutter elements via flutter_driver. e.g. bySemanticsLabel, tap etc. getRenderTree as well.
They are working to improve usage of Flutter View elements via Espresso/EarlGrey. In the future, we probably can handle elements via Espresso Driver / XCUITest driver in Appium terms. (But maybe using flutter_driver directly is the most stable usage tho.)
one more thing. Flutter is used by https://fuchsia.googlesource.com/fuchsia/. If the OS will be alternative of Android, Dart and today’s research will help in the case, too.

1 Comment