Skip to content

A comprehensive, fluent testing framework for Flutter applications that makes UI testing intuitive and maintainable.

License

Notifications You must be signed in to change notification settings

jaypal1046/flutter_test_pilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

61 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Flutter Test Pilot

Version 2.0.0 - A comprehensive Flutter automation testing framework with native Android support, intelligent caching, and parallel execution.

✨ Features

Phase 1 - Core Foundation βœ…

  • 🎯 Intelligent CLI - Production-ready command-line interface
  • ⚑ Smart Caching - SQLite-based test result caching (40x faster re-runs)
  • πŸ“± Device Management - Unified Android & iOS device handling
  • πŸ” Environment Validation - doctor command checks all dependencies

Phase 2 - Native Android Support βœ…

  • πŸ€– Native Dialog Handling - Auto-dismiss Google Credential Picker, permission dialogs
  • πŸ“‹ Permission Management - Pre-grant permissions before tests
  • βš™οΈ Device Configuration - Disable animations, clear app data
  • πŸ”§ UI Automator Integration - Java-based watcher for native dialogs

Phase 3 - Advanced Features βœ…

  • πŸ”„ Retry Handler - Exponential backoff for flaky tests
  • ⚑ Parallel Execution - Run tests across multiple devices simultaneously
  • πŸ“Έ Screenshot & Video - Capture on failure, record test sessions
  • πŸ” Test Discovery - Tag-based filtering, glob patterns

πŸ“š Documentation

All documentation has been organized in the doc/ folder:

Quick Links


πŸš€ Quick Start

Installation

# Add to your Flutter project's pubspec.yaml
dependencies:
  flutter_test_pilot:
    path: ../iltc-services/flutter_test_pilot

Basic Usage

# 1. Check environment
flutter_test_pilot doctor

# 2. Run a simple test
flutter_test_pilot run integration_test/app_test.dart

# 3. Run with native features
flutter_test_pilot run integration_test/app_test.dart \
  --app-id=com.example.myapp \
  --native-watcher \
  --pre-grant-permissions=all \
  --disable-animations

πŸ“– Command Reference

Essential Commands

# Environment check
flutter_test_pilot doctor

# List devices
flutter_test_pilot devices

# Run test
flutter_test_pilot run <test_file>

# Run with full features
flutter_test_pilot run <test_file> \
  --app-id=<package_name> \
  --native-watcher \
  --pre-grant-permissions=all \
  --disable-animations \
  --retry=3 \
  --screenshot \
  --parallel \
  --concurrency=3

Native Features

# Pre-grant permissions
--pre-grant-permissions=none|common|all|custom
--custom-permissions=CAMERA,LOCATION

# Native dialog handling
--native-watcher

# Device configuration
--disable-animations
--clear-app-data

For detailed command documentation, see Documentation Index.


🎯 Key Features

1. Native Dialog Handling

Automatically dismisses native Android dialogs:

  • Google Credential Picker
  • Permission dialogs
  • Location settings
  • System alerts
  • ANR dialogs
flutter_test_pilot run integration_test/login_test.dart \
  --app-id=com.example.myapp \
  --native-watcher

2. Smart Permission Management

Pre-grant permissions to avoid runtime dialogs:

# Grant all permissions
--pre-grant-permissions=all

# Grant common permissions
--pre-grant-permissions=common

# Grant specific permissions
--pre-grant-permissions=custom \
--custom-permissions=CAMERA,RECORD_AUDIO

3. Parallel Execution

Run tests across multiple devices simultaneously:

flutter_test_pilot run integration_test/ \
  --parallel \
  --concurrency=3

Performance: 3x-10x faster test execution!

4. Retry Logic

Automatically retry flaky tests with exponential backoff:

flutter_test_pilot run integration_test/app_test.dart \
  --retry=3

5. Screenshot Capture

Automatically capture screenshots on test failure:

flutter_test_pilot run integration_test/app_test.dart \
  --screenshot

πŸ—οΈ Architecture

flutter_test_pilot/
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ src/                    # Internal implementation
β”‚   β”‚   β”œβ”€β”€ cli/                # CLI commands
β”‚   β”‚   β”œβ”€β”€ core/               # Core framework (cache, config, models)
β”‚   β”‚   β”œβ”€β”€ native/             # Native Android support
β”‚   β”‚   β”œβ”€β”€ executor/           # Test execution
β”‚   β”‚   β”œβ”€β”€ discovery/          # Test discovery
β”‚   β”‚   └── reporting/          # Screenshots & reports
β”‚   └── flutter_test_pilot.dart # Main export file
β”‚
β”œβ”€β”€ native_assets/
β”‚   └── android/                # Java UI Automator watcher
β”‚       └── src/main/java/com/testpilot/watcher/
β”‚           └── NativeWatcher.java
β”‚
β”œβ”€β”€ doc/                        # πŸ“š All documentation
└── bin/                        # CLI entry point

πŸ“Š Performance Benefits

Feature Before After Improvement
Cached test re-run 120s 3s 40x faster
30 tests sequential 450s 150s (parallel) 3x faster
Flaky test success 60% 95% (retry) +58%
Tests with dialogs ❌ Hangs βœ… Auto-handled Infinite

πŸ› οΈ Setup Native Features

1. Build the Native Watcher (One-time)

cd native_assets/android
./build_watcher.sh

This creates build/libs/native_watcher.apk used for dialog handling.

2. Use in Tests

flutter_test_pilot run integration_test/app_test.dart \
  --app-id=YOUR_PACKAGE_NAME \
  --native-watcher \
  --pre-grant-permissions=all

πŸ“š Learn More

Visit the Documentation Index for:

  • Complete feature guides
  • Implementation details
  • Real-world examples
  • Troubleshooting tips
  • API documentation

πŸ› Troubleshooting

Quick Fixes

# Environment issues
flutter_test_pilot doctor --verbose

# Clear cache
flutter_test_pilot cache --clear

# Build native watcher
cd native_assets/android && ./build_watcher.sh

# Check devices
adb devices

For detailed troubleshooting, see Real World Usage Guide.


πŸ“„ License

Copyright Β© ILTC Development Team


Built with ❀️ by the ILTC Flutter Team

About

A comprehensive, fluent testing framework for Flutter applications that makes UI testing intuitive and maintainable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages