How to Run Flutter Tests Online: Integrating with CI/CD Pipelines

On This Page Why You Need to Run Flutter Tests Online

January 04, 2026 · 11 min read · CI/CD

How to Run Flutter Tests Online: Integrating with CI/CD Pipelines

Our Flutter app legislate every local exam and still failed in production within hr of liberation.

When we traced the failure, we found that nearly one-third of issue never prove up on developer machines at all. They appear only formerly code enters shared, automated environments.

That moment exposed a hard truth, which was, local flutter testing might afford you assurance, but not reportage.

To catch real-world failures early, Flutter try must run online and be profoundly desegregate with, where environs are ordered and feedback is immediate.

Overview

How to Run Flutter Tests Online?

If you want to run Flutter tests online, follow these four high-level steps:

1. Set up Flutter consolidation testsby enable the integration_test package, configuring the test binding, pose tests in integration_test/, and define dependencies in pubspec.yaml.

2. Build Android and iOS test artefactby generating app and test physique with matching variate. Ensure the integration test runner is bundle with the app build.

3. Upload builds to BrowserStack App Automateby submitting the app and test artifacts, selecting target devices and OS versions, and securely storing credentials for CI/CD grapevine.

4. Execute tests on real devicesby actuate Flutter integration tests in parallel on Android and iOS and reviewing logs, picture, and reports from the test dashboard.

In this blog, I & # 8217; ll show how to run Flutter tests online and mix them with CI/CD pipelines so production failures are caught long before users see them.

Why You Need to Run Flutter Tests Online

As apps grow in complexity and user reach,testing solely on localturn a bottleneckkinda than a safety net. In order to deliver consistent user experience across devices, OS versions, and form factors, teams increasingly need to run Flutter tests online on real devices.

Let & # 8217; s break down why.

1. Local Emulators Fall Short for Production-Grade Flutter Testing

Local emulators and simulators are utilitarian during early development, but theyfail to replicateaccurately.

The Key limitation include:

  • Incomplete hardware simulation:Emulators don & # 8217; t fully mimic real CPU conduct, retentivity constraints, GPU interpreting, sensors, or battery usage.
  • Unrealistic performance metric:Animations, frame drop, and load times often act differently on real devices.
  • Limited device and OS reportage:You & # 8217; re usually testing on 1-2 device profiles rather of hundred of real device-OS combination.
  • Environment drift:Tests may surpass on one developer & # 8217; s machine but fail on another due to OS, SDK, or dependency differences.
  • Poor scalability:Running tumid Flutter test suites locally slows machines and block parallel execution.

Therefore, pass tests on an ape does not guarantee your Flutter app will behave right for existent users.

Read More:

2. Real Cloud Devices Reveal Issues Emulators Can & # 8217; t Catch

Running Flutter trial online on a cloud-based real gimmick infrastructure helps you move past the limitations of emulator-only testing and validate your app under real-world conditions. Tests execute on actual Android and iOS devices, delivering wide-eyed device and OS reportage to rise UI, motion, and device-specific issues betimes. Parallel execution abridge feedback cycles, while exchangeable environments eliminate inconsistencies from local setups.

For Flutter apps, where UI consistency across devices is both a hope and a common endangerment, platform like supply a reliable and scalable way to check production-ready quality.

3. Online Testing Accelerates Your Release Cycle

Running Flutter tests online directly impacts release speed.

Here & # 8217; s how:

  • Faster feedback eyelet:shortens from hours to minutes.
  • Other bug detection:Issues coat during CI runs instead of post-release.
  • Reduced manual testing try:Automated real-device testing replaces repetitive manual checks.
  • Seamless integration:Tests spark mechanically on every pull request or form.
  • Lower rollback risk:Stable, well-tested body-build move to product with confidence.

Teams embracing must process the ability to run Flutter tests online within CI/CD pipelines as a core necessity preferably than an optional practice. Automated validation on real devices enables while preserving the reliability, stability, and user experience expected from modern Flutter covering.

Also Read:

Prerequisites to Run Flutter Tests Online

Before deploying to the cloud, you need to prepare your Flutter project for machine-controlled instrumentation testing.

1. Setting Up the Flutter integration_test Package

Historically, Flutter usedflutter_driver, but the ecosystem has moved to the integration_test bundle. This package allows tests to run on the device (or emulator) simply like the app itself, ply best access to the app & # 8217; s internal state.

Add the dependency to your pubspec.yaml file:

dev_dependencies:

flutter_test:

sdk: flutter

integration_test:

sdk: waver

2. Writing Your Inaugural End-to-End Test Script

Create a directory named integration_test at the root of your project. Inside, create a file named app_test.dart.

Here is a simple example that taps a push and verifies a antagonistic increment:

meaning & # 8217; package: flutter/material.dart & # 8217;; import & # 8217; packet: flutter_test/flutter_test.dart & # 8217;;
import & # 8217; package: integration_test/integration_test.dart & # 8217;;
import & # 8217; package: my_app/main.dart & # 8217; asapp;

voidmain () {
//InitializetheIntegrationTestWidgetsFlutterBindingsingleton
IntegrationTestWidgetsFlutterBinding.ensureInitialized ();

testWidgets (& # 8216; verifycounterincrement & # 8217;, (WidgetTestertester) async {
app.main ();
awaittester.pumpAndSettle ();

//Verifythecounterstartsat0.
look (find.text (& # 8216; 0 & # 8217;), findsOneWidget);

//Findsthefloatingactionbuttontotapon.
finalFinderfab=find.byTooltip (& # 8216; Increment & # 8217;);

//Emulateataponthefloatingactionbutton.
awaittester.tap (fab);

//Triggeraframe.
awaittester.pumpAndSettle ();

//Verifythecounterincrementsto1.
ask (find.text (& # 8216; 1 & # 8217;), findsOneWidget);
});
}

3. Configuring pubspec.yaml for Automated Testing

  • Keep pubspec.yaml clean and ensure all testing dependencies are up to appointment.
  • Add required test package such as integration_test under dev_dependencies.
  • Run flutter pub get to install and sync addiction.
  • Avoid unneeded configuration in pubspec.yaml beyond dependencies.
  • Verify android/build.gradle and ios/Podfile use minimum SDK versions compatible with your plugins.

How to Run Flutter Tests Online: A Step-by-Step Guide

Once your Flutter project is set for automation, you can start action tests on real devices in the cloud.

You can run Flutter tests online using, a leading platform for cloud-based peregrine testing.

SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.

Run Flutter Tests on Real Devices

Catch production glitch early by screen Flutter apps on real device.

Step 1: Configure the integration_test Package

For Android, create a test instrumentality file to allow the system to launch your tests.

Create android/app/src/androidTest/java/com/example/myapp/MainActivityTest.java(adjust package gens):

package com.example.myapp;
import androidx.test.rule.ActivityTestRule;
import dev.flutter.plugins.integration_test.FlutterTestRunner;
significance org.junit.Rule;
importation org.junit.runner.RunWith;

@ RunWith (FlutterTestRunner.class)
public class MainActivityTest {
@Rule
public ActivityTestRule normal = new ActivityTestRule (MainActivity.class, true, mistaken);
}

Step 2: Generate Android and iOS Build Artifacts

To run tests on a cloud grid, you must package both your application and your test suite.

For Android:

1. Build the debug APK (App under test):

kerfuffle build apk & # 8211; debug

2. Build the Android Test APK (): Navigate to the android folder and run the Gradle assembler.

cd android

./gradlew app: assembleAndroidTest

Output: You will hold two APKs: app-debug.apk and app-debug-androidTest.apk.

For iOS:

1. To run on real iOS devices in the cloud, you typically take to build an .ipa file.

flutter build ios & # 8211; release & # 8211; no-codesign

Note:For integration tests on iOS, the apparatus often involves Xcode tests (XCTest). BrowserStack supports running XCUITest which wrap your Flutter tests.

Step 3: Upload Builds to BrowserStack App Automate

You demand to upload both APKs to BrowserStack host so they can be install on the remote devices.

Upload the App:

curl -u & # 8220; YOUR_USERNAME: YOUR_ACCESS_KEY & # 8221; -X POST & # 8220; [https: //api-cloud.browserstack.com/app-automate/upload] (https: //api-cloud.browserstack.com/app-automate/upload) & # 8221;
-F & # 8220; file= @ /path/to/build/app/outputs/flutter-apk/app-debug.apk & # 8221;

Response: You will receive an app_url (e.g., bs: //12345 & # 8230;).

Upload the Test Suite:

curl -u & # 8220; YOUR_USERNAME: YOUR_ACCESS_KEY & # 8221; -X POST & # 8220; [https: //api-cloud.browserstack.com/app-automate/espresso/test-suite] (https: //api-cloud.browserstack.com/app-automate/espresso/test-suite) & # 8221;
-F & # 8220; file= @ /path/to/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk & # 8221;

Response: You will receive a test_suite_url (e.g., bs: //abcde & # 8230;).

Step 4: Execute the Test Suite on Real Devices

Once the shape are uploaded, you trigger the test execution using a cURL request specifying the devices you need to quiz on.

curl -u & # 8220; YOUR_USERNAME: YOUR_ACCESS_KEY & # 8221; -X POST & # 8220; [https: //api-cloud.browserstack.com/app-automate/espresso/v2/build] (https: //api-cloud.browserstack.com/app-automate/espresso/v2/build) & # 8221;
-d & # 8216; {& # 8220; app & # 8221;: & # 8220; bs: // & # 8221;, & # 8220; testSuite & # 8221;: & # 8220; bs: // & # 8221;, & # 8220; devices & # 8221;: [& # 8220; Google Pixel 7-13.0 & # 8221;]} & # 8217;
-H & # 8220; Content-Type: application/json & # 8221;

Read More:

How to Integrate Flutter Tests into CI/CD Pipeline?

Integrating this process into a CI/CD pipeline (like Jenkins,, or) automates the loop.

The flow postdate a standardSetup & gt; Build & gt; Execute & gt; Report pattern.

1. Setup:

Start by configuring your CI surround to back Flutter builds and cloud-based testing.

  • Checkout the code depositary.
  • Set up the Flutter environment
  • Install Flutter SDK
  • Ensure Java, Android SDK, and Xcode (for macOS runners) are available
  • Run flutter pub get.

2. Build:

Generate the application and test artifacts required for cloud-based execution.

Android example (GitHub Actions):

& # 8211; name: Build Android App run: hoo-ha build apk & # 8211; debug

& # 8211; name: Build Test Suite
run: cd android & amp; & amp; ./gradlew app: assembleAndroidTest

Notes:

  • App and test artefact must use the same build variant
  • For iOS, generate equivalent .app or .ipa artifacts utilise Xcode build dictation

3. Execute:

Once body-build are ready, trigger automated test execution in the cloud.

  • Use the cURL require from Steps 3 and 4 to upload artefact and trigger the build on BrowserStack.
  • Store YOUR_USERNAME and YOUR_ACCESS_KEY as repository secrets.

4. Report:

After performance, the grapevine collects elaborate test insights.

  • The API response from the executing trigger will furnish a Build ID.
  • You can poll the condition of this build or simply log the Build URL to the CI console so developers can click through to the BrowserStack splashboard.

Also Read:

Analyzing Results After You Run Flutter Tests Online

Once the CI pipeline induction execution, the existent value of extend Flutter tests online emerges during the analysis stage. BrowserStack App Automate provides acentralized dashboardthat surfaces actionable insights from every real-device tryout run.

Key artifacts available for analysis include:

  • : Review total HD recording of each test session to visually identify UI glitches, animation issues, or application clash
  • : Inspect real-time device logarithm to debug assertion failure, logic fault, and unhandled exceptions.
  • : Analyze API requests and responses generated during test execution to validate backend integrations and detect network-related failures.
  • App profiling metrics:Monitor CPU and memory usage throughout the test run to uncover execution bottlenecks under real ironware conditions.

Together, these brainstorm aid teams move quickly from test failure to root drive, making online Flutter testing a reliable foundation for continuous quality substantiation.

Talk to an Expert

Scaling Flutter Tests with App Automate

As your coating grows, so make your test suite. Running tests consecutive on local emulators is not scalable.

is an AI-powered platform designed to solve this byintegrating seamlessly into your CI/CD pipeline, replacing unreliable ape with a cloud of30,000+ real iOS and Android device.

App Automate leverages to autonomously optimise your testing workflows:

  • :Automatically detects and fixes broken locators at runtime, maintain your builds green even when UI ingredient change slightly.
  • :Intelligently run merely the tests relevant to your specific codification changes, sheer build time and infrastructure costs by up to 50 %.
  • :AI-driven analysis process logs and picture to categorise failures (e.g., distinguishing a merchandise bug from a scheme bit), reducing debugging clip by 95 %.

Instead of waiting hour for a regression rooms to finish, you can leverageScalable :

  • Instant Access:Run thousands of exam simultaneously across different devices and OS versions.
  • :Split your tryout suite into smaller shards to execute in analog, reducing executing clip from years to minutes and enabling true continuous delivery.

App Automate support complex real-world user scenarios on existent hardware:

  • Biometrics:Automate FaceID and TouchID workflow.
  • :Test QR code scanning and camera features without physical interaction.
  • :Test app behavior under varying network conditions (throttling, offline mode).
  • :Simulate GPS locations to test location-based features.

For teams with strict security or complex workflow requirement, theoffers a private cloud of dedicated devices reserved exclusively for you.

  • Persistent State:Keep apps lumber in between sessions for faster testing.
  • Custom-made Configurations:Support for custom MDM profile and mend SIM configurations for consistent 2FA examination.
  • Security & amp; Compliance:Combines the control of an on-premise lab with cloud scalability, ensuring / conformation and 100 % device availability.

Conclusion

Local copycat testing solo can not support the scale and complexity of modernistic Flutter applications. The ability to run Flutter tests online on real devices is indispensable for reach reliable reportage, faster feedback, and confident releases.

By integrating real-device essay into CI/CD pipelines, teams can validate every build under real-world weather and ship faster with fewer regression using platforms like BrowserStack App Automate.

Talk to an Expert

Tags

Frequently Asked Questions

Running Flutter test online is especially effective for observe device-specific UI number, OS-level behavior changes, execution fixation, network-related failures, and crashes that do not appear in emulator-based testing.

Yes, Flutter integration exam can be executed in parallel across multiple device when run in a cloud-based real gimmick surroundings. Parallel execution significantly reduces exam suite runtime and makes it practical to validate apps across many device and OS combinations within CI pipelines.

While flutter_driver is not full removed, Flutter recommends transmigrate to the integration_test package. It is the current measure for end-to-end testing and offers better compatibility with modern Flutter tooling, CI/CD pipeline, and real-device testing platforms.

Yes, Flutter integration tests can run on simulators, but simulators do not accurately reflect real-world ironware behavior, performance restraint, or device-specific number. Real devices are recommended for corroborate release-ready bod and user-critical flows.

On This Page

67,000+ Views

# Ask-and-Contributeabout this topic with our Discord community.

Related Guides

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free