DEV Community

Cover image for How to Set Up Automated Tests with a QA Coding Agent for Flutter
Wes Nishio for GitAuto

Posted on • Originally published at gitauto.ai

How to Set Up Automated Tests with a QA Coding Agent for Flutter

How to Set Up Automated Tests with a QA Coding Agent for Flutter

Today, I'm sharing an interesting case study where a ride-sharing company (let's call them Company A) approached a system development vendor (Company B) for a mobile app revamp project. The requirement? Support both iOS and Android platforms while keeping costs reasonable. Company B's solution was to use Flutter with Dart for cross-platform development. To ensure quality delivery within the timeline, they wanted to implement automated testing to reduce manual testing efforts in the latter half of the project.

Let's see how we can leverage GitAuto, a QA Coding Agent, to set this up!

TL;DR - What's the story?

  1. The Challenge
  2. Initial Setup
  3. Verification
  4. Analysis of GitAuto's Decisions
  5. Looking Forward

1. The Challenge

The first step was to set up GitHub Actions for automated testing. I created a GitHub issue with the title "Add a GitHub Actions workflow to automatically conduct flutter test". I only specified the trigger conditions in the description:

GitHub Issue Creation

2. Initial Setup

Here's what GitAuto came up with - interestingly, it even provided a dummy test without being explicitly asked:

GitHub Actions Workflow

3. Verification

Let's check if the automated tests are actually running. Looking at the pull request checks:

PR Checks Green

All green! Let's also examine the test logs:

Test Execution Logs

While the logs are minimal due to the dummy test, they confirm proper execution.

4. Analysis of GitAuto's Decisions

It's interesting to analyze how GitAuto handled ambiguous aspects that I didn't explicitly specify:

Default Branch Name

GitAuto correctly identified that this repository uses master instead of main - a detail I hadn't specified.

Default Branch Name

Flutter Version

GitAuto used Flutter 3.7.0, which is somewhat dated considering the latest version is 3.29.0 based on the official Flutter website.

Flutter Version

Interestingly, Dart 3.7.0 is the latest version - perhaps there was some confusion there? In future updates, we should have GitAuto provide evidence for version selection decisions to save reviewers' time.

Actions/Checkout Version

GitAuto used v2, while v4 is the latest available according to the official GitHub Actions Checkout documentation. Another area for potential improvement.

GitAuto used v2

Actions/Checkout Version

Flutter Setup Approach

The choice of subosito/flutter-action was excellent. After investigation, I found it's a popular and well-maintained community action for Flutter, handling everything from installation to flutter pub get. As someone new to Flutter, this saved me significant research time.

You can specify your requirements if you don't rely on third-party actions to make sure GitAuto not use them.

5. Looking Forward

This experience was particularly valuable for me as a Flutter newcomer. It suggests that GitAuto can help set up testing infrastructure even for technologies we're not familiar with. In future posts, I'll explore how to leverage this setup for various types of Flutter tests, including:

  • Unit tests
  • Widget tests
  • Integration tests

What's even more exciting is the potential democratization of test creation. With the CI/CD workflow in place, writing test cases could potentially be delegated to non-engineers or junior developers. We might even reach a point where technical leads and senior engineers can review and guide test development directly from their smartphones, without opening an IDE. This could fundamentally change how we think about engineering roles - one might start their journey directly from Tech Lead or Senior Software Engineer positions.

Feel free to share your thoughts and feedback at info@gitauto.com.

Top comments (0)