https://github.com/sh3lan93/mobile-automator
The intelligent mobile QA extension that learns your app and writes tests for you.
https://github.com/sh3lan93/mobile-automator
gemini-cli-extension mobile-qa mobile-test-automation semantic-testing
Last synced: 3 months ago
JSON representation
The intelligent mobile QA extension that learns your app and writes tests for you.
- Host: GitHub
- URL: https://github.com/sh3lan93/mobile-automator
- Owner: sh3lan93
- License: other
- Created: 2026-02-10T14:59:04.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-02-25T20:01:43.000Z (4 months ago)
- Last Synced: 2026-02-26T10:10:10.916Z (4 months ago)
- Topics: gemini-cli-extension, mobile-qa, mobile-test-automation, semantic-testing
- Homepage:
- Size: 51.4 MB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# ๐ Mobile Automator
> **The intelligent mobile QA extension that learns your app and writes tests for you.**
[](LICENSE)
[](#)
[](https://github.com/mobile-next/mobile-mcp)
---
## ๐ก Why Mobile Automator?
**The story behind this tool:**
Every Monday, I had **4 hours blocked on my calendar** for manual regression testing. Four hours. Every single week.
That's **208 hours a year** tapping through the same flows, checking the same screens, validating the same features. Over and over again.
I realized something had to change. **I refuse to repeat myself.** My time is too valuable to waste on tasks that can be automated.
So I built Mobile Automatorโnot just to run tests, but to **learn from my manual testing sessions** and replay them automatically. Now, those 4 hours are spent building features instead of repeating the same test flows.
**If you're tired of manual regression testing eating your calendar, this tool is for you.** ๐ฏ
---
## โจ What Makes This Special?
**Mobile Automator doesn't just run testsโit understands your app.**
When you run setup, it analyzes your codebase and automatically detects:
- ๐ฑ **Platform & Architecture** - Android, iOS, Flutter, React Native, KMP, CMP
- ๐๏ธ **Architecture Pattern** - MVVM, Clean Architecture, BLoC, Redux, MVP
- ๐ฏ **Business Domain** - What your app actually does
- โก **Loading Patterns** - Your specific progress indicators and shimmer effects
- ๐ง **Build Configuration** - Commands, flavors, environments
- ๐ฆ **Package IDs** - Android applicationId, iOS Bundle Identifier
Then it generates **AI-powered testing skills** customized specifically for your project.
---
## ๐ฌ See It In Action
### ๐ Generate Test Scenarios
https://github.com/user-attachments/assets/6be4adce-4b30-45b1-a025-0e3373e30348
**What you see:**
- ๐ฎ Describe user flows in plain English
- ๐ค AI controls your device/emulator automatically
- ๐ธ Captures reference screenshots at each step
- โ๏ธ Generates structured JSON test scenarios
---
### โถ๏ธ Execute Tests & Get Intelligent Reports
https://github.com/user-attachments/assets/fbc69108-0736-402c-846c-faca237fe4ca
**What you get:**
- โ
Pass/fail status with detailed results
- ๐ Regression detection (spots UI changes)
- โก Flakiness detection (retries on transient failures)
- ๐ง Contextual insights (device differences, environment details)
---
## ๐ฏ Quick Start
### Prerequisites
- **Gemini CLI** installed ([Get it here](https://geminicli.com))
- **Mobile project** (Android, iOS, Flutter, React Native, KMP, or CMP)
- **Node.js** v16+ (for mobile-mcp automation engine)
### Installation
**From GitHub:**
```bash
gemini extensions install https://github.com/sh3lan93/mobile-automator
```
**Local Development:**
```bash
git clone https://github.com/sh3lan93/mobile-automator
cd mobile-automator
gemini extensions link .
```
### Setup Your Project
```bash
# Navigate to your mobile project
cd ~/projects/my-awesome-app
# Launch Gemini CLI
gemini
# Run setup
> /mobile-automator:setup
```
The setup wizard will guide you through:
1. โ
**Platform Detection** - Identifies your tech stack
2. โ
**Environment Discovery** - Finds staging, prod, dev configs
3. โ
**App Package Inference** - Extracts bundle IDs
4. โ
**Project Knowledge** - Learns your architecture and domain
5. โ
**Skill Installation** - Generates customized testing skills
6. โ
**Directory Scaffolding** - Creates test artifact structure
**After setup completes, reload skills:**
```bash
> /skills reload
```
**Output:**
```
mobile-automator/
โโโ config.json # Project configuration
โโโ index.md # Documentation
โโโ scenarios/ # Generated test scenarios
โโโ screenshots/ # Reference screenshots
โโโ results/ # Test execution reports
.gemini/skills/
โโโ mobile-automator-generator/ # Your custom test generator
โโโ mobile-automator-executor/ # Your custom test runner
```
### Generate Your First Test
```bash
> /mobile-automator:generate
```
When prompted, describe the test in natural language:
**Example 1: Login Flow**
```
1. Launch the app
2. Tap on "Login" button
3. Enter email: test@example.com
4. Enter password: Test123!
5. Tap "Sign In"
6. Validate user is logged in (shows profile icon)
```
**Example 2: Conversational Style**
```
fresh install -> user opens app -> wait for splash screen ->
validate bottom navigation shows 4 tabs: home, orders, offers, more
```
**What you get:**
- ๐ `mobile-automator/scenarios/login_flow.json` - Structured test scenario
- ๐ธ `mobile-automator/screenshots/login_flow/` - Reference screenshots
- โ
Ready to execute on any device
### Execute Your Test
```bash
> /mobile-automator:execute login_flow
```
**You'll see:**
- โถ๏ธ Real-time step execution on your device
- ๐ Pass/fail status for each assertion
- ๐ Flakiness detection and retry logic
- ๐ธ Screenshot comparison with visual analysis
- ๐ Detailed failure reports with context
---
## ๐๏ธ Supported Platforms
| Platform | Detection | Build Commands | Device Control |
|----------|-----------|----------------|----------------|
| **Android** | โ
Native, Gradle | `./gradlew assembleDebug` | โ
Emulator + Real Device |
| **iOS** | โ
Native, Xcode | `xcodebuild -scheme MyApp` | โ
Simulator + Real Device |
| **Flutter** | โ
Cross-platform | `flutter build apk/ios` | โ
All platforms |
| **React Native** | โ
Metro bundler | `npx react-native run-android/ios` | โ
All platforms |
| **Kotlin Multiplatform** | โ
KMP structure | `./gradlew assembleDebug` | โ
Android + iOS |
| **Compose Multiplatform** | โ
CMP structure | Gradle + Xcode | โ
Android + iOS |
---
## ๐ง Intelligent Features
### 1. Architecture Pattern Detection
Mobile Automator scans your codebase and recognizes:
- **MVVM** (ViewModel, LiveData patterns)
- **Clean Architecture** (domain, data, presentation layers)
- **BLoC** (Flutter - Business Logic Component)
- **Redux/MVI** (reducer, store, actions)
- **MVP/VIPER** (presenter, interactor patterns)
**Why it matters:** Skills are tailored to your architecture's naming conventions.
### 2. Loading Indicator Auto-Detection
Greps your source code for:
- Android: `CircularProgressIndicator`, `ShimmerEffect`, `ProgressBar`
- iOS: `UIActivityIndicatorView`, `ProgressView`, `SkeletonView`
- Flutter: `CircularProgressIndicator`, `Shimmer`
- React Native: `ActivityIndicator`, `SkeletonPlaceholder`
**Why it matters:** Tests automatically wait for your specific loading patterns.
### 3. Flakiness Detection & Diagnosis
When tests fail, the executor:
- ๐ **Retries once** on suspected timing issues
- ๐ **Flags flaky tests** with retry count
- ๐งช **Analyzes root cause**: loading delay, animation, network dependency
- ๐ก **Suggests fixes**: "Consider adding explicit wait for this step"
### 4. State-Aware Failure Analysis
Failed assertions include context:
- ๐ Dark mode vs light mode mismatch
- ๐ฑ Device differences (Pixel 6 vs Pixel 8)
- ๐ Network state (WiFi vs cellular)
- โจ๏ธ Keyboard visibility
- ๐ Orientation differences
### 5. Semantic Visual Testing
Instead of brittle pixel-matching:
> "Does this screen fulfill the same purpose as the reference?"
Uses AI vision to compare screenshots semantically, not pixel-by-pixel.
---
## ๐ Commands Reference
| Command | Description | Usage | What It Does |
|---------|-------------|-------|--------------|
| **`/mobile-automator:setup`** | One-time setup - analyzes project and installs testing skills | `> /mobile-automator:setup` | โข Detects platform (Android/iOS/Flutter/React Native/KMP/CMP)
โข Discovers build environments (staging, production, etc.)
โข Infers app package IDs from build files
โข Analyzes architecture patterns and business domain
โข Installs customized QA skills
โข Creates `mobile-automator/` test directory
โข **Resume support:** If interrupted, run again to resume |
| **`/mobile-automator:generate`** | **Record** test scenarios from natural language (do this once per test) | `> /mobile-automator:generate` | โข Connects to your device/emulator
โข Prompts for test steps in natural language
โข Executes steps on device while recording
โข Captures reference screenshots
โข Generates JSON scenario file (schema v2)
**Output:** `mobile-automator/scenarios/.json` |
| **`/mobile-automator:execute`** | **Replay** saved test scenarios (run repeatedly for regression testing) | `> /mobile-automator:execute `
Examples:
โข Single: `execute login_flow`
โข Multiple: `execute login_flow checkout_flow`
โข All: `execute` (interactive) | โข Replays scenario steps on connected device
โข Captures actual screenshots for comparison
โข Validates assertions (element exists, text matches, visual state)
โข Detects flakiness and retries automatically
โข Generates detailed pass/fail report with diagnostics
**Output:** `mobile-automator/results/.json` |
| **`/mobile-automator:migrate`** | **Migrate** a v1 scenario JSON to schema v2 format | `> /mobile-automator:migrate `
Examples:
โข `migrate login_flow`
โข `migrate` (interactive file selection) | โข Analyzes existing v1 scenario
โข Auto-converts step IDs, assertion IDs, metadata
โข Interactively resolves ambiguous waits
โข Creates `.v1.bak` backup before any changes
โข Outputs valid schema v2 scenario |
| **`/mobile-automator:list-tags`**| Lists all tags currently used in test scenarios | `> /mobile-automator:list-tags` | โข Scans all JSON scenarios
โข Displays tag counts
โข Differentiates standard vs custom tags |
| **`/mobile-automator:report`** | Generate aggregated test reports | `> /mobile-automator:report`
Options:
โข `--last N` (default 10)
โข `--format table\|json\|html`
โข `--junit` (JUnit XML) | โข Aggregates all test results
โข Shows pass rate, flaky steps, failures
โข Exports to JSON, HTML, or JUnit XML
**Output:** `mobile-automator/results/report.{json,html,xml}` |
## ๐ท๏ธ Tag-Based Filtering
Mobile Automator supports tagging scenarios logically (e.g. `smoke`, `regression`, `critical`) so you can execute specific subsets of your test suite.
### Adding Tags
During scenario generation (`/mobile-automator:generate`), the agent will ask you what tags describe the scenario before saving it. You can also manually add tags to the `scenario.json` file:
```json
{
"$schema_version": "2.0",
"scenario_id": "login_flow",
"tags": ["smoke", "auth", "p0"],
// ...
}
```
### Filtering Executions
Use the `--tag` parameter with `/mobile-automator:execute` to filter runs:
- **Single tag:** `/mobile-automator:execute --tag smoke`
- **Multiple tags (AND):** `/mobile-automator:execute --tag smoke,critical` (matches scenarios with BOTH tags)
- **Multiple tags (OR):** `/mobile-automator:execute --tag smoke|regression` (matches scenarios with ANY tag)
- **Exclude tags (NOT):** `/mobile-automator:execute --tag !flaky` (excludes scenarios with this tag)
If you run `/mobile-automator:execute` without arguments, the interactive menu will automatically group your scenarios by their primary tag.
### Standard Tag Registry
We recommend standardizing on these common tags:
- `smoke`: Quick validation of critical paths
- `regression`: Full feature validation
- `critical`, `p0`, `p1`: Priority levels
- `fast`, `slow`: Execution time indicators
- `flaky`: Network/timing dependent tests
- `wip`: Under development
---
## Using TestRail
**Optional:** Connect TestRail to auto-generate tests and sync results.
See [TESTRAIL.md](./TESTRAIL.md) for detailed setup and usage instructions.
---
### ๐ The Workflow
1. **Generate once** - Use `/mobile-automator:generate` to record test scenarios by performing actions on your device
2. **Execute many times** - Use `/mobile-automator:execute` to replay those scenarios automatically across devices/builds
---
## ๐ Project Structure
After setup, your project will have:
```
your-mobile-project/
โโโ mobile-automator/ # Test artifacts directory
โ โโโ config.json # Auto-generated project config
โ โโโ index.md # Documentation
โ โโโ scenarios/ # Test scenario JSON files
โ โ โโโ login_flow.json
โ โ โโโ checkout_flow.json
โ โโโ screenshots/ # Reference screenshots
โ โ โโโ login_flow/
โ โ โ โโโ step_launch_app.png
โ โ โ โโโ step_tap_login.png
โ โ โโโ checkout_flow/
โ โโโ results/ # Test execution results
โ โโโ run_20250212_143022.json
โ โโโ run_20250212_143022/
โ โโโ screenshots/
โ
โโโ .gemini/
โโโ skills/ # Generated testing skills
โโโ mobile-automator-generator/
โ โโโ SKILL.md # Customized for YOUR project
โ โโโ references/
โ โโโ scenario_schema_v2.json # Schema v2 (default)
โ โโโ scenario_schema.json # Schema v1 (legacy)
โโโ mobile-automator-executor/
โโโ SKILL.md # Customized for YOUR project
โโโ references/
โโโ result_schema.json
```
---
## ๐ฌ How It Works
### The 3-Tier Architecture
```
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TIER 1: Extension Commands โ
โ /mobile-automator:setup โ
โ /mobile-automator:generate โ
โ /mobile-automator:execute โ
โ (Pre-flight checks, validation) โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ delegates to
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ TIER 2: Workspace Skills โ
โ .gemini/skills/mobile-automator-*/ โ
โ (Test generation & execution logic)โ
โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ uses
โโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ TIER 3: Automation Engine โ
โ mobile-mcp โ
โ (Device control primitives) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
```
**Why this design?**
- โ
**Separation of concerns** - infrastructure vs domain logic
- โ
**Project-specific skills** - tailored to your app
- โ
**Portable automation** - works across platforms
---
## ๐จ Test Scenario Schema
Test scenarios are JSON files stored in `mobile-automator/scenarios/` following **schema v2** (default). Key fields:
- **`$schema_version`**: `"2.0"` โ required, enables version routing
- **`scenario_id`**: Unique identifier (snake_case)
- **`name`**: Human-readable description
- **`platform`**: `"android"` | `"ios"` | `"cross-platform"`
- **`variables`**: Named variables for capturing dynamic values across steps
- **`preconditions`**: Structured object โ `app_state`, `device_actions`, `device_properties`
- **`steps`**: Array of actions โ each step has a **named string `id`** (e.g., `"tap_login"`), plus:
- 14 action types: `launch_app`, `tap`, `long_press`, `double_tap`, `type`, `swipe`, `scroll_to_element`, `press_button`, `open_url`, `wait_for_element`, `wait_for_element_gone`, `wait_for_loading_complete`, `capture_value`, `clear_app_data`
- `optional: true` + `on_failure: "skip"` โ for non-deterministic UI elements (dialogs, banners)
- `condition` โ execute step only when a device property or runtime condition is met
- `retry_policy` โ retry on transient failures before marking the step as failed
- `capture_to` โ store a dynamic value for later assertion
- `sub_steps` โ nested conditional sub-flow
- `wait_config` โ smart wait parameters (`type`, `indicator`, `timeout_ms`)
- **`assertions`**: Validation rules โ each has a **named string `id`** and references its step by name (`after_step`):
- 9 types: `element_exists`, `element_not_exists`, `element_text`, `screenshot_match`, `pattern_match`, `value_matches_variable`, `element_count`, `visual_state`, `text_changed`
> **Migrating from v1?** Run `/mobile-automator:migrate ` or see [MIGRATION.md](MIGRATION.md).
Generated scenarios are project-specific and include your app's context (business domain, key features).
---
## ๐ Troubleshooting
For common issues and solutions, see **[TROUBLESHOOTING.md](TROUBLESHOOTING.md)**.
---
## ๐ค Contributing
Contributions are welcome! This project is open source under Apache 2.0 license.
**Areas for contribution:**
- Additional platform support
- Enhanced architecture pattern detection
- More assertion types
- CI/CD integrations
- Visual regression testing improvements
---
## ๐ License
Apache License 2.0 - See [LICENSE](LICENSE) for details.
---
## ๐ Acknowledgments
- **[Conductor](https://github.com/gemini-cli-extensions/conductor)** - Inspired the generator pattern and structured workflow approach
- **[mobile-mcp](https://github.com/mobile-next/mobile-mcp)** - The automation engine powering device control
- **Gemini CLI** - The AI-powered CLI platform
---
**Built with โค๏ธ for mobile QA engineers**
[Report Bug](https://github.com/sh3lan93/mobile-automator/issues) ยท [Request Feature](https://github.com/sh3lan93/mobile-automator/issues) ยท [Documentation](https://github.com/sh3lan93/mobile-automator)