flutter/dev/integration_tests/android_engine_test
Matan Lurey 89b336109f
Add a virtual-display (VD) platform view test, and refactor tests a bit. (#161349)
Towards https://github.com/flutter/flutter/issues/161261.

Still need to add a HC (Hybrid Composition) variant, but figured I'd do
this incrementally to make it easier to review.
2025-01-10 03:23:40 +00:00
..
android Add a virtual-display (VD) platform view test, and refactor tests a bit. (#161349) 2025-01-10 03:23:40 +00:00
lib Add a virtual-display (VD) platform view test, and refactor tests a bit. (#161349) 2025-01-10 03:23:40 +00:00
test_driver Add a virtual-display (VD) platform view test, and refactor tests a bit. (#161349) 2025-01-10 03:23:40 +00:00
.metadata Rename native_driver to android_{driver_extensions|engine_test} (#161263) 2025-01-08 20:28:38 +00:00
pubspec.yaml Rename native_driver to android_{driver_extensions|engine_test} (#161263) 2025-01-08 20:28:38 +00:00
README.md Rename native_driver to android_{driver_extensions|engine_test} (#161263) 2025-01-08 20:28:38 +00:00

android_engine_test

This directory contains a sample app and tests that demonstrate how to use the (experimental) native Flutter Driver API to drive Flutter apps that run on Android devices or emulators, interact with and capture screenshots of the app, and compare the screenshots against golden images.

Running the apps and tests

Each lib/{prefix}_main.dart file is a standalone Flutter app that you can run on an Android device or emulator:

flutter_rendered_blue_rectangle

This app displays a full screen blue rectangle. It mostly serves as a test that Flutter can run at all on the target device, and that the Flutter (native) driver can take a screenshot and compare it to a golden image. If this app or test fails, it's likely none of the other apps or tests will work either.

# Run the app
$ flutter run lib/flutter_rendered_blue_rectangle_main.dart

# Run the test
$ flutter drive lib/flutter_rendered_blue_rectangle_main.dart

Files of significance:

Debugging tips

  • Use flutter drive --keep-app-running to keep the app running after the test.
  • USe flutter run followed by flutter drive --use-existing-app for faster test iterations.