flutter/dev/integration_tests/flutter_driver_screenshot_test
Greg Spencer 1ba4f1f509
Add Linux and Windows target platforms (#51519)
This PR adds the linux and windows target platform enum values, along with automatically setting the defaultTargetPlatform to the appropriate value on those platforms.

Fixes #31366
2020-03-03 04:38:04 -08:00
..
android Reduce gradle deps (#50691) 2020-02-12 21:14:54 -08:00
assets Reland "Add a FlutterDriver screenshot test to device lab. #45411" (#46620) 2019-12-10 12:43:36 -08:00
fuchsia/meta Implement takeScreenshot and add driver test for Fuchsia (#48611) 2020-01-14 12:29:09 -08:00
ios Reland "Add a FlutterDriver screenshot test to device lab. #45411" (#46620) 2019-12-10 12:43:36 -08:00
lib Add Linux and Windows target platforms (#51519) 2020-03-03 04:38:04 -08:00
test_driver Revert "Temporarily disable the flutter_driver_screenshot_test. (#51665)" (#51783) 2020-03-02 09:45:24 -08:00
.metadata Reland "Add a FlutterDriver screenshot test to device lab. #45411" (#46620) 2019-12-10 12:43:36 -08:00
pubspec.yaml [flutter_tools] remove vm_service_client dependency from flutter tool (#51227) 2020-02-24 14:19:43 -08:00
README.md Revert "Temporarily disable the flutter_driver_screenshot_test. (#51665)" (#51783) 2020-03-02 09:45:24 -08:00

Summary

This tests contains an app with a main page and sub pages. The main page contains a list of buttons; each button leads to a designated sub page when tapped on. Each sub page should displays some simple UIs to screenshot tested.

The flutter driver test runs the app and opens each page to take a screenshot.

Use test_driver/flutter_gold_main_test.dart to test against golden files stored on Flutter Gold. Otherwise, use main_test.dart to test against golden files stored on test_driver/goldens/<some_test_page_name>/<device_model>.png.

Note that new binaries can't be checked in the Flutter repo, so use Flutter Gold instead.

Add a new page to test

  1. Create a new class which extends Page and implement the UI to be tested in the build method.
  2. The new class should set a static title and key
  3. Add an instance of the new class to the _allPages list in the main.dart
  4. Create a new test case similar to "'A page with an image screenshot" in test_driver/main_test.dart to run the screenshot test.
  5. Create directories for the test: test_driver/goldens/<some_test_page_name> should be created before running the test based on the target platform the test is designed to run.

An example of a Page subclass can be found in lib/image_page.dart

Environments

  • Device Lab which runs the app on iPhone 6s.
  • LUCI which runs the app on a Fuchsia NUC device.