Flutter › Integration Testing in Flutter

What is the integration_test package, and how does it let you actually run your Flutter integration tests directly on a real physical device or a properly configured emulator?

Beginner

Answer

The integration_test package is Flutter's own official recommended package specifically for writing and actually running integration tests, providing an IntegrationTestWidgetsFlutterBinding that properly configures your test environment to genuinely run directly on an actual real device or emulator rather than in a considerably more limited simulated test environment, letting you use the exact same familiar WidgetTester API already used for regular widget tests while genuinely testing your entire complete real app running with its own genuinely real platform specific plugins and native code.
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('app starts and shows home screen', (tester) async {
  await tester.pumpWidget(MyApp());
  expect(find.byType(HomeScreen), findsOneWidget);
});
Real-world example A team sets up the integration_test package to run their entire app's own genuinely full startup flow on a real physical Android device, correctly catching a genuine platform specific crash that had never actually appeared at all during their considerably more limited regular widget tests.

Common follow-ups: How do you actually properly run an integration test from the command line against a genuinely connected real device?;What genuinely specific additional platform level setup is actually required to properly run integration tests on iOS?