flutter/dev/integration_tests/native_driver_test
Michael Goderbauer 5491c8c146
Auto-format Framework (#160545)
This auto-formats all *.dart files in the repository outside of the
`engine` subdirectory and enforces that these files stay formatted with
a presubmit check.

**Reviewers:** Please carefully review all the commits except for the
one titled "formatted". The "formatted" commit was auto-generated by
running `dev/tools/format.sh -a -f`. The other commits were hand-crafted
to prepare the repo for the formatting change. I recommend reviewing the
commits one-by-one via the "Commits" tab and avoiding Github's "Files
changed" tab as it will likely slow down your browser because of the
size of this PR.

---------

Co-authored-by: Kate Lovett <katelovett@google.com>
Co-authored-by: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com>
2024-12-19 20:06:21 +00:00
..
android [Reland] Force automatic ndk download when building for Android (#160260) 2024-12-13 20:27:23 +00:00
ios Move (dev/tools), complete v0 of native_driver (Android) (#154843) 2024-09-11 23:56:21 +00:00
lib Auto-format Framework (#160545) 2024-12-19 20:06:21 +00:00
test_driver Auto-format Framework (#160545) 2024-12-19 20:06:21 +00:00
.metadata Move (dev/tools), complete v0 of native_driver (Android) (#154843) 2024-09-11 23:56:21 +00:00
pubspec.yaml Manual pub roll with flutter_tools patch (#160174) 2024-12-16 21:41:54 +00:00
README.md Move (dev/tools), complete v0 of native_driver (Android) (#154843) 2024-09-11 23:56:21 +00:00

native_driver_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 or iOS 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 or iOS 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.