Metadata-Version: 2.4
Name: mobileuitest
Version: 0.1.0
Summary: Mobile UI Testing CLI - Run YAML-based mobile tests anywhere
Project-URL: Homepage, https://github.com/vladkarpman/mobileuitest
Project-URL: Documentation, https://github.com/vladkarpman/mobileuitest#readme
Project-URL: Repository, https://github.com/vladkarpman/mobileuitest
Project-URL: Issues, https://github.com/vladkarpman/mobileuitest/issues
Author: Vladislav Karpman
License-Expression: MIT
Keywords: android,automation,mobile,scrcpy,testing,ui
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.11
Requires-Dist: adbutils>=2.0.0
Requires-Dist: av>=12.0.0
Requires-Dist: google-genai>=1.0.0
Requires-Dist: mysc>=0.5.0
Requires-Dist: numpy>=1.24.0
Requires-Dist: pillow>=10.0.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0.0
Requires-Dist: typer>=0.12.0
Provides-Extra: dev
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Description-Content-Type: text/markdown

# mut - Mobile UI Testing CLI

Run YAML-based mobile UI tests anywhere - CI/CD, local development, or scripts.

## Features

- **Run anywhere** - No Claude Code dependency, works in CI/CD
- **Fast screenshots** - ~50ms via scrcpy frame buffer
- **AI verification** - Gemini 2.5 Flash for visual assertions
- **Video recording** - Capture test execution for debugging
- **Record tests** - Capture user interactions to generate YAML

## Installation

```bash
pip install mut
```

### Requirements

- Python 3.11+
- Android device/emulator with USB debugging enabled
- `adb` in PATH
- `scrcpy` 3.x installed
- `GOOGLE_API_KEY` environment variable (for AI features)

## Quick Start

### Run a test

```bash
mut run tests/login.yaml
```

### Record a test

```bash
mut record login-flow
# Interact with your app...
mut stop
```

### List devices

```bash
mut devices
```

## YAML Test Format

```yaml
config:
  app: com.example.app

setup:
  - terminate_app
  - launch_app
  - wait: 2s

tests:
  - name: Login flow
    steps:
      - tap: "Email"
      - type: "user@test.com"
      - tap: "Password"
      - type: "secret123"
      - tap: "Sign In"
      - verify_screen: "Welcome screen with user greeting"
```

## Commands

### `mut run <test.yaml>`

Execute a YAML test file.

```bash
# Basic execution
mut run tests/login.yaml

# Skip AI verifications (faster, for CI)
mut run tests/login.yaml --no-ai

# Specify device
mut run tests/login.yaml --device emulator-5554

# Custom output
mut run tests/login.yaml --output reports/
```

### `mut record <name>`

Start recording user interactions.

```bash
mut record checkout-flow
```

### `mut stop`

Stop recording and generate YAML test.

```bash
mut stop
# Opens browser with approval UI
# Export YAML when done
```

### `mut devices`

List connected devices.

```bash
mut devices
```

## Configuration

### Global config (`~/.mut.yaml`)

```yaml
ai:
  model: gemini-2.5-flash

defaults:
  video: true
  verbose: false
```

### Project config (`.mut.yaml`)

```yaml
device: emulator-5554
test_dir: tests/
report_dir: reports/
```

## CI/CD Integration

### GitHub Actions

```yaml
name: Mobile UI Tests
on: [push]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install mut
        run: pip install mut

      - name: Run tests
        uses: reactivecircus/android-emulator-runner@v2
        with:
          api-level: 34
          script: mut run tests/login.yaml --no-ai
```

## Environment Variables

| Variable | Description |
|----------|-------------|
| `GOOGLE_API_KEY` | Gemini API key for AI features |
| `MUT_DEVICE` | Default device ID |
| `MUT_VERBOSE` | Enable verbose logging |

## License

MIT
