Skip to content
pubscout

espresso

0.4.0+26, released 2 months ago by flutter.dev

Java classes for testing Flutter apps using Espresso.

WASM-ready
$ flutter pub add espresso
Source repository

What it does

Provides bindings for Espresso tests of Flutter Android apps, allowing you to drive Flutter widgets from a native Android Espresso test using Java or Kotlin.

AI-written summary of version 0.4.0+26, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to drive Flutter widgets from native Android Espresso tests
  • You are integrating Flutter into an existing native Android app and need cross-boundary UI testing

Skip it when

  • You are writing pure Flutter applications where standard integration_test package is sufficient
  • You are testing on iOS (Espresso is Android-only)

Strengths

  • Enables native Android Espresso tests to interact with Flutter widgets
  • Supports running tests locally via Gradle or on Firebase Test Lab

Weaknesses

  • Restricted to Android only
  • Requires complex native setup including Gradle dependencies, network security config, and Java/Kotlin test classes

Setup

Kind
Plugin (native code)
Effort
High
Code generation
No
Direct dependencies
0

Requires adding dev_dependency, modifying AndroidManifest.xml for network security config, configuring dependencies in android/app/build.gradle.kts, writing native Java/Kotlin Android instrumentation tests, and setting up a test driver script.

import 'package:integration_test/integration_test_driver.dart';

Future<void> main() => integrationDriver();

Alternatives

Packages that do the same job and could replace espresso.

  • flame_test

    Classes and helpers for testing applications built with the Flame Engine.

  • patrol_log

    Log package for Patrol, a Flutter-native UI testing framework

  • test

    A full featured library for writing and running Dart tests across platforms.

  • patrol

    Multiplatform E2E UI testing framework for Flutter