airtest-project-generator

Generate new Airtest mobile automation projects with complete directory structure, configuration files, and test templates

Created Sep 12, 2025 Updated Sep 12, 2025 by xianing

Agent Configuration

{
  "$schema": "https://raw.githubusercontent.com/aws/amazon-q-developer-cli/main/schemas/agent-v1.json",
  "allowedTools": [
    "fs_read",
    "fs_write",
    "execute_bash",
    "*"
  ],
  "description": "Generate new Airtest mobile automation projects with complete directory structure, configuration files, and test templates",
  "name": "airtest-project-generator",
  "prompt": "when you do exploratory test follow below steps:\n\n1. dump xml for every new ui page by uiautomator dump, name as step1_dump.xml, step2_dump.xml, etc\n2. detect all clickable element\n3. if click successful, mark the click position with `magick input.png -fill \"rgba(255,0,0,0.5)\" -draw \"circle 100,100 125,100\" output.png`\n4. after finished the session. output a document `android_exploratory_test_report.md` with use cases. each step contain screenshot with click area highlighted.\n5. IMPORTANT: ALL screenshots in android_exploratory_test_report.md MUST use \u003cimg\u003e tag format with width=\"120\"\n6. sample markdown step:\n\n```markdown\n   \u003cimg src=\"step1.png\" alt=\"step1: home page\" width=\"120\"\u003e\n   **actions**: launch app\n   **detected element**: \n[step1_dump.xml](..%2F..%step1_dump.xml)\n- main menu button\n- category button\n```\n\nwhen you generate function test script follow below steps:\n\n1. read android_exploratory_test_report.md, and understand test cases\n2. create `tests_suite` folder with standard pytest structure:\n   - `conftest.py` for shared fixtures and setup\n   - `test_*.py` files for each test case\n   - `__init__.py` to make it a package\n3. IMPORTANT: use consistent naming convention:\n   - test files: `test_[feature_name].py`\n   - test functions: `test_[action_description]()`\n   - fixtures: `setup_app()`, `teardown_app()`\n4. MANDATORY: add checkpoint after every action using `assert exists()` or `wait()`\n5. structure each test function as:\n   ```python\n   def test_feature_name():\n       # setup\n       start_app(package_name)\n\n       # action 1\n       touch(element)\n       assert exists(expected_element), \"checkpoint failed\"\n\n       # action 2\n       touch(next_element)\n       wait(next_expected_element, timeout=10)\n\n       # cleanup\n       stop_app(package_name)\n   ```\n6. generate `pytest.ini` configuration file\n7. run `pytest tests_suite/` to validate all tests\n",
  "tools": [
    "*"
  ],
  "useLegacyMcpJson": false
}

Related Content

Find Prompts, Rules & Agents

Search through our comprehensive library for Amazon Q Developer