Run Flutter Integration Tests On Real Devices- 3 Easy Steps!
Flutter app development is a popular web technology that enables businesses to develop hybrid applications. This open-source platform allows businesses to save their time and effort as one doesn’t have to develop two different applications for different operating systems. Flutter has boomed the market in the past few years and has become the number one choice of entrepreneurs. However, to test the Flutter app developers used to run flutter driver testers on the Android emulator and iOS emulator, depending on the operating system.
But now, flutter integration with an open-source command line utility called Sylph has made things more seamless. This out-of-the-box integration with AWS Device Farm will enable you to run tests on real devices that will give you a clear picture of the app’s performance.
What is Sylph, and how it will be useful?
AWS Device Farm provides a massive pool of Android and iOS devices for running integration tests on many real devices in one go. This is one of the best options that will help you ensure that your release builds are thoroughly checked before pushing out the app from the store. Previously, there was no quick way to use AWS Device Farm-flutter integration as the AWS Device Farm’s support list included Appium and native tests only. And flutter driver testers were not on the list of the supported framework!
Sylph was developed by Maurice McCabe, which actually opened the door to AWS Device Farm for flutter apps. Under the roof, Sylph makes it appear as if you’re running an Appium test. You can set it up locally on Linux, Mac, or Windows using command row, but it processes better in the CI environment. The complete AWS Device Farm test run configuration includes numerous test suites and the devices to be used for testing. This can be defined as a sylph.yaml file.
What are the steps to run flutter apps on real devices with AWS Device Farm and Sylph?
You should opt for flutter app development services that can provide you with both Sylph and AWS Device Farm integrated environments. This makes it really easy for flutter developers to use AWS Device Farm for testing applications. To run this application you need an AWS account and a trouble-free sylph.yaml file configuration in the repo for making these efficiently work. And in case, if you don’t have a sylph configuration file, then these service providers can help you with that.
Now let’s dive through the steps to configure your flutter driver tests on a real device with the AWS Device Farm integration:
Step 1: Begin with setting up AWS Device Farm
For running integration tests on AWS Device Farm, it can be enabled in App settings > Test. After that, you need to verify Enable Flutter Drive tests and then select where to run them. The moment you choose AWS Device Farm, you will notice the fields to enter your AWS access key ID and AWS secret access key. However, if you’re planning to run Flutter Driver tests on Android devices only, you can save the settings and end the process of setting them up here. In case your device collection contains iOS devices, all you will need is to set up a Fastlane match and add the iOS definite environment variables in App settings > Environment.
Step 2: Initiate to build
If you’re satisfied with the app settings, click on the “Start new Build” option. During the building process, you need to explore the depository for a sylph.yaml file to configure the AWS Device Farm test run and creates a default configuration file if no available configuration is established. However, by default, you’ll find the project_root/test_driver folder.
Step 3: Check the results
As you can monitor the build logs while it runs, you will also view the results conveniently once the Testing step is accomplished. After the test run, you will see an advanced overview of how many tests failed, skipped, or passed on the results tab as well as a thorough test log on the Log tab.
Besides other details, the test log involves information concerning the status of the test on each testing device as well as optimized device minutes. And if you’re seeking more detailed information on the test run, you can also see videos, data about memory, CPU usage, and device logs. It is also available in your AWS Management Console.
Bottom line
Tests are always better on real devices. When you test flutter applications on real devices, it enables you to alter the performance and abolish potential device-specific bugs. All thanks to Sylph! AWS Device Farm can now be integrated into the build workflow so you can smoothly authenticate that your significant releases, not only pass the CI test but also pass the integration tests on a collection of real Android and iOS devices. Remember, you will need an account for using the AWS Device Farm!
Run flutter integration tests on devices using aws services
Contact Us
Manish Patel
Manish Patel is a Co-Founder of Concetto Labs, a leading mobile app development company specialized in android and iOS app development. We provide a one-stop solution for all IT related services.