tree: 3950c31c569c5bb174ca300af40d41c09633b331 [path history] [tgz]
  1. bin/
  2. ios/
  3. lib/
  4. .gitignore
  5. BUILD.gn
  6. pubspec.yaml
  7. README.md
  8. run_ios_tests.sh
engine/src/flutter/testing/ios_scenario_app/README.md

Scenario App

GitHub Issues or Pull Requests by label

This package simulates a Flutter app that uses the engine (dart:ui) only, in conjunction with iOS-specific embedding code that simulates the use of the engine in a real app (such as plugins and platform views).

run_ios_tests.sh is used to run the tests on a simulator.

See also:

  • File an issue with the e: scenario-app label.
  • lib/, the Dart code and instrumentation for the scenario app.
  • ios/, the iOS-side native code and tests.

Adding a New Scenario

Like a regular Flutter iOS app, the Scenario app consists of the iOS embedding code and the dart logic that are Scenarios.

To introduce a new subclass of Scenario, add it to the map in scenarios.dart. For an example, animated_color_square.dart, which draws a continuously animating colored square that bounces off the sides of the viewport.

The Scenarios app loads a Scenario when it receives a set_scenario method call on the driver platform channel from the objective-c code. However if you're adding a UI test this is typically not needed as you typically should add a new launch argument. See ScenariosUITests for more details.

Running a specific test

The run_ios_tests.sh script runs all tests in the Scenarios project. If you're debugging a specific test, rebuild the ios_debug_sim_unopt_arm64 engine variant (assuming testing on a simulator on Apple Silicon chips), and open src/out/ios_debug_sim_unopt_arm64/ios_scenario_app/Scenarios.xcworkspace in xcode. Use the xcode UI to run the test.