Metadata-Version: 2.4
Name: identifier-checker
Version: 1.0.0
Summary: Universal Mobile Runtime Identifier Verifier for Android, iOS, React Native, React Native Turbo, Capacitor, and Flutter
Author: Ayush Mishra
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: Appium-Python-Client>=3.0.0
Requires-Dist: PyYAML>=6.0

# identifier-checker

A universal, automated command-line tool for mobile QA and test automation engineers working with any mobile application technology:
- **Native Android** (Kotlin / Java / Jetpack Compose)
- **Native iOS** (Swift / SwiftUI / UIKit)
- **React Native** (Bridged Architecture)
- **React Native Turbo** (New Architecture / Fabric)
- **Capacitor & Ionic** (HTML5 WebViews)
- **Flutter**

It verifies whether accessibility and test identifiers (`resource-id`, `content-desc`, `name`, `label`, `testID`, `data-testid`, `id`) are present in the runtime UI hierarchy, correctly exposed in page source attributes, and queryable by live Appium element locators across screens.

---

## Key Features

- ⚡ **Fast Element Lookup**: Temporarily sets Appium implicit wait to **1.0 second** during element verification so missing/failed identifiers check instantly without multi-second delays.
- 🎯 **Strict Appium Locators**: Performs live element lookups using **`By.ACCESSIBILITY_ID`** and **`By.ID`** (no XPath overhead).
- 📱 **Screen-Wise Identifier Verification**: Provide your expected identifiers grouped screen-by-screen in a clean JSON format.
- ⏸️ **Interactive Screen Navigation**: Verifies the initial screen on app launch, then prompts you to navigate to the next screen on your device/emulator before pressing `ENTER`.
- 📝 **Flexible Markdown Report Output**: Generates clean terminal console output and saves a Markdown summary report (`id_report_<timestamp>.md` or custom `.md` path).
- ⚙️ **CI/CD Ready**: Exits with status code `0` when all identifiers across all screens pass, and `1` when any identifier fails or is missing.

---

## Installation Options

### Option 1: Install from PyPI
```bash
pip install identifier-checker
# OR using pipx (recommended for isolated global CLI tools):
pipx install identifier-checker
```

### Option 2: Direct GitHub Install
```bash
pip install git+https://github.com/your-username/identifier-checker.git
# OR using pipx:
pipx install git+https://github.com/your-username/identifier-checker.git
```

### Option 3: Local Installation (For Development)
```bash
git clone https://github.com/your-username/identifier-checker.git
cd identifier-checker
pip install -e .
```

---

## How to Publish to PyPI & GitHub

### 1. Publish to PyPI
1. Create an account on [pypi.org](https://pypi.org).
2. Build distribution wheels:
   ```bash
   pip install build twine
   python -m build
   ```
3. Upload to PyPI:
   ```bash
   python -m twine upload dist/*
   ```

### 2. Push to GitHub
```bash
git init
git add .
git commit -m "Initial release of identifier-checker CLI"
git branch -M main
git remote add origin https://github.com/your-username/identifier-checker.git
git push -u origin main
```

---

## Expected Input JSON Format (`expected_ids.json`)

Provide your expected identifiers grouped screen-wise:

```json
{
  "screens": {
    "home_screen": [
      "app_drawer",
      "home_core_card",
      "recent_activity_$index",
      "truvideo_sdk",
      "view_all_recent_activity"
    ],
    "all_video_requests_screen": [
      "back_button",
      "status_$index",
      "toggle_stream",
      "video_request_item_$index",
      "video_request_list_add_fab_button",
      "video_requests_id_$index",
      "video_requests_type_$index"
    ]
  }
}
```

---

## Usage Examples

### Verification via App Package & Activity Name
```bash
identifier-checker \
  --ids expected_ids.json \
  --app-package com.example.truvideo_sample \
  --app-activity .MainActivity
```

### Custom Output Report Path
Save report to a specific Markdown file path:
```bash
identifier-checker \
  --ids expected_ids.json \
  --app-package com.example.truvideo_sample \
  --app-activity .MainActivity \
  --output ~/Desktop/my_summary_report.md
```

### Verification via APK / IPA Binary File
```bash
identifier-checker \
  --ids expected_ids.json \
  --app /path/to/app.apk
```

---

## Command Line Reference

| Argument | Description | Default |
|---|---|---|
| `--ids` | Path to JSON file containing expected identifiers. | *Required* |
| `--app` | Path to APK or IPA application binary. | `from config` |
| `--app-package` | Android app package name. | `from config` |
| `--app-activity` | Android main activity name. | `from config` |
| `--platform` | Target platform (`android` or `ios`). | `android` |
| `--device-name` | Target device or emulator name. | `emulator-5554` |
| `--appium-url` | Appium server URL. | `http://127.0.0.1:4723` |
| `--output` | Output directory OR custom `.md` report path. | `reports` |
| `--wait` | Seconds to wait after app launch or screen prompt for UI to settle. | `1.0` |
| `--implicit-wait` | Timeout in seconds for element lookups. | `5.0` |
| `--no-reset` | Do not reset application state between sessions. | `True` |

---

## Exit Codes

| Exit Code | Meaning |
|---|---|
| `0` | **Success**: All expected identifiers across all screens passed exact match and live find checks. |
| `1` | **Failure**: One or more identifiers were missing, merged, failed live lookup, or a setup error occurred. |
