Flutter Driver Support in Appium OSS
Flutter driver is used to run automation tests for Flutter applications.
warning
- Flutter driver is supported only for Appium version 2 (and Appium Java client 8).
- Flutter driver is supported only for Automation and not in Mobile Studio.
To test a Flutter application:
-
Add support for
flutterDriverExtension
before therunApp
command, inmain.dart
.main.dart
import 'package:flutter_driver/driver_extension.dart';
void main() {
enableFlutterDriverExtension();
runApp(const MyApp());
} -
Add
dev_dependencies
to`pubspec.yml.`
pubspec.yaml
dev_dependencies:
test: any
flutter_driver:
sdk: flutter
flutter_test:
sdk: flutter -
Build the application.
- Android:
flutter build apk --debug
- iOS 13.0 and lower:
flutter build ios --debug
- iOS 14.0+:
flutter build ios --profile
- Android:
-
Upload the application to the Cloud.
To run an automation test on a Flutter application:
-
Pull the appium 2.0.0-beta.55 image from AWS.
Docker Pull Command
docker pull public.ecr.aws/dai-ct/appium-opensource:2.0.0.beta.55-6
-
Set the automation name in the capabilities to be "Flutter".
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("automationName", "Flutter");