My Experience Working on Flutter for Integration Testing

I recently joined Zola Electric as a QA Engineer and the Software Development team currently leverages the Flutter SDK to develop their customer-facing Android and iOS apps. The choice of the cross-platform mobile development framework was a no-brainer; Flutter’s hot reload feature, support for beautiful Material Design and Flutter’s ability to incorporate all critical platform differences to provide full native performance are the common reasons for the choice. But then, my fear was how to automate tests for these mobile apps.

Photo by from Pexels

First and foremost, testing using the Flutter driver was a bit different from Appium which I was accustomed to. In Flutter, automated testing falls into three categories; Unit testing, Widget testing, and Integration testing. Unit tests and Widget tests focus on individual classes, functions, or Widgets. However, integration testing tests how the performance of an application runs on a real device. This includes testing how the app behaves or responds to a tap, scroll, text input, etc. Integration tests can be automated to run on an emulator.

Secondly, it meant learning a new language; Dart developed by Google. It was not so difficult writing my first few tests because I was familiar with Java. In order to be a bit more comfortable with the language and framework, what I did was:

  • create a simple dummy app then set up Flutter driver
  • collate all Serialized Finders (objects repository) in a separate file
  • write a few tests using this as a guide

Then I ran the test. Imagine my reaction when they all passed!

Another thing was that I was required to share the same repository with the developer. Before now, my experience at my previous companies was that it was better not to co-locate app and automation code as it was assumed that it was too much of a risk to allow testers to have access to the ‘almighty’ app code. My other fear was sharing the same repository with a developer who was no ordinary developer at all! She is Annyce Davis, an Android Google Developer Expert, Software Group Lead at Zola Electric and my line manager.

I was initially afraid that I would not be able to write intelligent code. Turns out, there wasn’t any reason for such fear as it has been a great experience. I am even getting better at it and getting more familiar with the internal workings of the project. Other advantages I have actually experienced are; unreliable web element locators that cause flaky automated tests are avoided and that it also makes each party more involved/carried along with the other’s contribution to the repository. With this experience, there are many other advantages that can be derived from this which can be seen here.

Also, Flutter’s support community isn’t so large yet at least compared to Appium’s. And so I made a few mistakes, figured out some things on my own and asked a lot of questions from the developer who was way more experienced using it and was glad to help.

So far, I’m enjoying working with Flutter. I’ll keep on practising because I have learned that “practice is improvement, and improvement only leads to perfection” ― Richelle E. Goodrich.

Kindly share this

Oluwatomi Familoni is a Software Quality Assurance Engineer at ZOLA Electric

© 2023. All Rights Reserved.