Run test case
Skill hoangdh2001/apple-app-ui-test-automation/skills/run-test-case
Execute a single UI test case and return its result. Works across iPhone, iPad, and macOS — pass the platform param to adjust behavior. Requires the app to already be built and running before calling this skill. Returns: pass, flaky, or fail — with screenshot path, logs, and root cause on failure.From its SKILL.md
npx -y skills add hoangdh2001/apple-app-ui-test-automation --skill run-test-caseAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.5 KB, as published. Nobody here has run it
Skill: run-test-case
Input
test_case— one parsed test case object (id, name, feature, steps, expect)platform—"iphone"|"ipad"|"macos"udid— simulator UDID (omit for macOS)bundle_id— app bundle identifierreport_dir— path to write screenshots, e.g.tests/reports/screenshots
Step 1: Reset app state
iPhone / iPad:
Navigate to a known base state before running:
axe tap --label Dashboard --udid <UDID> --wait-timeout 3
If this fails (modal blocking, crash):
xcodebuildmcp simulator stop --simulator-id <UDID> --bundle-id <bundle>
xcodebuildmcp simulator launch-app --simulator-id <UDID> --bundle-id <bundle>
Then poll until interactive (max 30s, retry every 3s):
axe describe-ui --udid <UDID>
# Success: root element has "type": "Application"
macOS: Skip reset. macOS apps do not have a tab bar to navigate to. Proceed directly to Step 2.
Step 2: Execute interactions
Translate all YAML steps into a single axe batch call via stdin.
iPhone / iPad:
axe batch --udid <UDID> --stdin << 'EOF'
tap --label <label> --wait-timeout 5
type '<text>'
EOF
macOS:
axe batch --stdin << 'EOF'
tap --label <label> --wait-timeout 5
type '<text>'
EOF
Rules:
- Always use
--stdin, not--stepor--file - Add
--wait-timeoutto everytapandnavigatestep
Step 3: Verify expected state
Run describe-ui in a separate call (batch is fire-and-forget):
iPhone / iPad: axe describe-ui --udid <UDID>
macOS: axe describe-ui
For each expect entry:
ui_contains: "X"→ assert element withAXLabel == "X"existselement_not_exists: "X"→ assert NO element withAXLabel == "X"exists
If all pass, capture screenshot and return ✅:
iPhone / iPad: axe screenshot --udid <UDID> --output <report_dir>/<id>-pass.png
macOS: axe screenshot --output <report_dir>/<id>-pass.png
Step 4: Handle failure
If any assertion fails:
-
Capture error screenshot:
- iPhone/iPad:
axe screenshot --udid <UDID> --output <report_dir>/<id>-error.png - macOS:
axe screenshot --output <report_dir>/<id>-error.png
- iPhone/iPad:
-
Start log capture:
xcodebuildmcp logging start-simulator-log-capture \ --simulator-id <UDID> \ # omit on macOS --bundle-id <bundle> \ --capture-console true # Save the returned logSessionId -
Retry the failing step only with
--wait-timeout 5, then re-rundescribe-uiand assert again. -
Stop log capture:
xcodebuildmcp logging stop-simulator-log-capture --log-session-id <logSessionId> -
Determine result:
- Retry passed → ⚠️ flaky
- Retry failed → ❌ fail
-
Suggest root cause from logs:
- "Element not found" → label changed, wrong screen, animation still running
- "Multiple matches" → use coordinate-based tap fallback
- Crash in logs → report crash type
Output
{
id: string
name: string
feature: string
result: "pass" | "flaky" | "fail"
duration_s: number
screenshot: string
error?: string
logs?: string
suggested_cause?: string
}