auto-uitest
Skill0 starsChanged 8 months agoMITView on GitHub
Drive a real iPhone or iPad through WebDriverAgent, including device discovery, device selection, installed-app lookup, WDA install/startup, UI tree capture, screenshot-assisted exploration, source-file hint extraction from iOS UI implementation files, and drafting iOS UI automation scripts. Use when Codex needs to explore a physical iOS device, pick from multiple connected phones, resolve a missing bundle identifier, bootstrap WDA from a prebuilt or source checkout, turn an observed flow into an Appium/XCUITest-style test script, or generate a UI testcase starting from iOS files such as ViewController.m, .swift, .xib, or storyboard files.
In this repositoryOne other file it gives its agents.
- jira-skillSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
44 rules. About 0 are common, 31 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈31
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Create or load a testcase bundle under the target project.
- Distinctive: line 18
Ensure WDA is installed and reachable.
- Distinctive: line 24
Every conversation must map to one testcase bundle under the target project, not under the skill repo.
- Distinctive: line 32
Start a new case:
- Distinctive: line 51
If the user asks to continue or reuse a known flow, load the existing case first.
- Distinctive: line 52
If multiple cases match a loose title, ask the user which one to reuse.
- Distinctive: line 53
If this is a new flow, create a fresh case before touching the device.
- Distinctive: line 54
Read references/testcase-bundles.md when you need the case directory schema or command patterns.
- Very specific: line 58
If the user gives you xxViewController.m, xxViewController.swift, .xib, or .storyboard files, extract static hints before touching the …
- Distinctive: line 75
Treat source-derived selectors and flows as hypotheses, not runtime truth.
- Distinctive: line 76
Prefer extracted accessibility ids and visible text when drafting the first test version.
- Very specific: line 77
Use extracted IBAction names to guess primary interactions that deserve a testcase.
- Distinctive: line 78
If source hints are the only input, be explicit that the result is draft-quality until validated on-device.
- Distinctive: line 79
Read references/source-driven-tests.md when the request starts from source files.
- Very specific: line 91
If exactly one selectable=true device is returned, use it without asking.
- Very specific: line 92
If multiple selectable devices are returned, ask the user to choose one.
- Distinctive: line 93
If no selectable device is returned, stop and tell the user what is missing: trust pairing, Developer Mode, DDI, cable/tunnel, or host …
- Distinctive: line 108
If the user already gave a bundle id, trust it unless the app lookup proves it is absent.
- Distinctive: line 110
If the prompt does not contain a bundle id, run:
- Distinctive: line 118
If the user named the app clearly and the lookup returns one obvious match, use that bundle id.
- Distinctive: line 119
If the lookup is ambiguous, show the candidate bundle ids and ask the user to choose.
- Distinctive: line 120
If the user gave only a product concept and not an app name, ask for the bundle id or the installed app name before exploring.
- Very specific: line 132
If wdaInstalled=true and /status is reachable, proceed.
- Very specific: line 133
If WDA is installed but /status is not reachable, start or repair the runner first.
- Distinctive: line 134
If WDA is not installed, ask the user which bootstrap path is available:
- Very specific: line 137
If source signing needs a provisioning profile, require the user to explicitly provide it.
- Distinctive: line 138
Do not pretend WDA can be installed without signing context.
- Distinctive: line 165
Read references/wda-setup.md when you need the real-device signing or prebuilt-WDA rationale.
- Distinctive: line 178
Prefer the automatic case-aware mode:
- Distinctive: line 187
If an external wrapper needs explicit filenames, you can still reserve them first:
- Distinctive: line 195
Prefer the XML tree first.
- Very specific: line 196
If the XML is incomplete or misleading, inspect the screenshot with view_image or another image-capable tool before guessing.
- Very specific: line 197
Use tap, swipe, and type-text only to explore the real flow.
- Distinctive: line 198
Keep a terse action log while exploring.
- Very specific: line 199
After each important capture or action cluster, append one timeline event with testcase_artifacts.py log.
- Distinctive: line 217
Read references/test-authoring.md before writing the final script.
- Very specific: line 221
If the flow was explored through ios_wda.py, first export a replay script from the timeline:
- Distinctive: line 231
If the target repo already has its own UI automation stack, you can still replace or adapt the generated replay script afterward.
- Distinctive: line 232
When final evidence is ready, mark the case reusable:
- Very specific: line 242
If the final result is partial or blocked, do not stop at the report alone.
- Very specific: line 243
When the user agrees to remediation and the target project is available locally, use the case evidence (report/index.html, captures/, …
- Distinctive: line 245
If source hints exist, merge them with runtime XML instead of choosing one source blindly.
- Distinctive: line 247
Keep the setup notes in the test or adjacent documentation: device assumptions, bundle id, and WDA assumptions.
- Distinctive: line 255
If WDA bootstrap was the blocker, report that explicitly instead of claiming the UI test script is validated.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Auto Uitest
Overview
Use this skill to turn a vague “帮我在真机上探索并写 UI 自动化” request into a repeatable host-side workflow. It provides a fixed decision tree plus helper scripts for device/app discovery, testcase persistence inside the target project, and direct WDA control, so Codex does not have to rediscover the real-device plumbing every turn.
Workflow
- Create or load a testcase bundle under the target project.
- Extract source-driven UI hints when the user provides iOS files.
- Resolve the target device.
- Resolve the target bundle identifier.
- Ensure WDA is installed and reachable.
- Explore the app with XML plus screenshots.
- Export a reusable replay script into the testcase bundle, render a visual report page, and finalize the case.
1. Create Or Load A Testcase
Every conversation must map to one testcase bundle under the target project, not under the skill repo.
Default location:
<target-project>/.auto-uitest/cases/<case-id>/Start a new case:
python3 scripts/testcase_artifacts.py init \
--project-root /path/to/target-project \
--title "<short case title>" \
--prompt "<original user prompt>" \
--bundle-id <optional bundle id>Reuse an older case:
python3 scripts/testcase_artifacts.py list --project-root /path/to/target-project
python3 scripts/testcase_artifacts.py show --project-root /path/to/target-project --selector "<case-id-or-title>"Apply these rules:
- If the user asks to continue or reuse a known flow, load the existing case first.
- If multiple cases match a loose title, ask the user which one to reuse.
- If this is a new flow, create a fresh case before touching the device.
- Read references/testcase-bundles.md when you need the case directory schema or command patterns.
2. Extract Source-Driven Hints
If the user gives you xxViewController.m, xxViewController.swift, .xib, or .storyboard files, extract static hints before touching the device:
python3 scripts/ios_source_hints.py /path/to/xxViewController.m --case-dir <case-dir>For paired implementation + interface files:
python3 scripts/ios_source_hints.py \
/path/to/xxViewController.m \
/path/to/xxViewController.xib \
--case-dir <case-dir>Apply these rules:
- Treat source-derived selectors and flows as hypotheses, not runtime truth.
- Prefer extracted accessibility ids and visible text when drafting the first test version.
- Use extracted
IBActionnames to guess primary interactions that deserve a testcase. - If source hints are the only input, be explicit that the result is draft-quality until validated on-device.
- Read references/source-driven-tests.md when the request starts from source files.
3. Resolve Device
Run:
python3 scripts/device_inventory.py devices --jsonApply these rules:
- If exactly one
selectable=truedevice is returned, use it without asking. - If multiple selectable devices are returned, ask the user to choose one. Prefer
request_user_inputover a free-form multiple choice message. - If no selectable device is returned, stop and tell the user what is missing: trust pairing, Developer Mode, DDI, cable/tunnel, or host permissions.
- Ignore paired-but-unusable devices unless the user explicitly wants to debug connection state. Use
--include-disconnectedonly for diagnosis.
Log important decisions back to the testcase:
python3 scripts/testcase_artifacts.py log \
--case-dir <case-dir> \
--kind "device_selected" \
--summary "Selected iPhone 13 mini for this case" \
--data-json '{"udid":"<UDID>"}'4. Resolve Bundle Identifier
If the user already gave a bundle id, trust it unless the app lookup proves it is absent.
If the prompt does not contain a bundle id, run:
python3 scripts/device_inventory.py apps --udid <UDID> --match "<app name guess>"Apply these rules:
- If the user named the app clearly and the lookup returns one obvious match, use that bundle id.
- If the lookup is ambiguous, show the candidate bundle ids and ask the user to choose.
- If the user gave only a product concept and not an app name, ask for the bundle id or the installed app name before exploring.
5. Ensure WDA
Inspect the device first:
python3 scripts/ios_wda.py status --udid <UDID> --probe-httpThen branch:
- If
wdaInstalled=trueand/statusis reachable, proceed. - If WDA is installed but
/statusis not reachable, start or repair the runner first. Usually this meansiproxyis missing, the runner is not active, or the device trust state changed. - If WDA is not installed, ask the user which bootstrap path is available:
- Preferred: a prebuilt
.xctestrunbundle orbootstrapPath. - Fallback: a local
WebDriverAgentsource checkout plus a valid signing team.
- Preferred: a prebuilt
- If source signing needs a provisioning profile, require the user to explicitly provide it. Do not assume the skill bundle carries a reusable
.mobileprovisionfile. - Do not pretend WDA can be installed without signing context. If neither a prebuilt bundle nor a signable source checkout exists, stop and ask for one.
Use these commands:
python3 scripts/ios_wda.py start-prebuilt \
--udid <UDID> \
--bootstrap-path /path/to/prebuilt-wda \
--pid-file .tmp/wda-iproxy.pid \
--log-file .tmp/wda-iproxy.log \
--runner-pid-file .tmp/wda-runner.pid \
--runner-log-file .tmp/wda-runner.logpython3 scripts/ios_wda.py start-source \
--udid <UDID> \
--wda-repo /path/to/WebDriverAgent \
--team-id <TEAM_ID> \
--provisioning-profile-specifier "<user-provided profile name if needed>" \
--allow-provisioning-updates \
--pid-file .tmp/wda-iproxy.pid \
--log-file .tmp/wda-iproxy.log \
--runner-pid-file .tmp/wda-runner.pid \
--runner-log-file .tmp/wda-runner.logRead references/wda-setup.md when you need the real-device signing or prebuilt-WDA rationale.
Log the chosen bootstrap path and attach any runner logs into the testcase with testcase_artifacts.py attach.
6. Explore The App
Launch the app and create a session:
python3 scripts/ios_wda.py launch-app --udid <UDID> --bundle-id <BUNDLE_ID>
python3 scripts/ios_wda.py open-session --udid <UDID> --session-file .tmp/wda-session.jsonPrefer the automatic case-aware mode:
python3 scripts/ios_wda.py open-session --case-dir <case-dir> --udid <UDID> --bundle-id <BUNDLE_ID>
python3 scripts/ios_wda.py snapshot --case-dir <case-dir> --label "login-home"This automatically uses <case-dir>/session/wda-session.json, writes captures under <case-dir>/captures/, and appends timeline events.
If an external wrapper needs explicit filenames, you can still reserve them first:
python3 scripts/testcase_artifacts.py paths --case-dir <case-dir> --label "login-home"Apply these rules:
- Prefer the XML tree first. It exposes stable accessibility ids, labels, names, values, and hierarchy.
- If the XML is incomplete or misleading, inspect the screenshot with
view_imageor another image-capable tool before guessing. - Use
tap,swipe, andtype-textonly to explore the real flow. Do not ship coordinate-only logic as the final test unless the app truly exposes no stable accessibility hooks. - Keep a terse action log while exploring. The final test should reflect the observed flow, not a reconstructed narrative.
- After each important capture or action cluster, append one timeline event with
testcase_artifacts.py log.
Common exploration commands:
python3 scripts/ios_wda.py tap --session-file .tmp/wda-session.json --x 180 --y 640
python3 scripts/ios_wda.py swipe --session-file .tmp/wda-session.json --x1 200 --y1 700 --x2 200 --y2 250
python3 scripts/ios_wda.py type-text --session-file .tmp/wda-session.json --text "hello"Close the session when done:
python3 scripts/ios_wda.py close-session --session-file .tmp/wda-session.json --delete-session-file7. Export The Final Test
Read references/test-authoring.md before writing the final script.
Apply these rules:
- If the flow was explored through
ios_wda.py, first export a replay script from the timeline:
python3 scripts/render_case_script.py \
--case-dir <case-dir> \
--assert-text "<final success text>"- By default this writes a reusable Python replay script into
<case-dir>/generated/. testcase_artifacts.py finalizenow also renders<case-dir>/report/index.html, which shows the timeline, screenshots, and whether the generated script passed an execution check.- If the target repo already has its own UI automation stack, you can still replace or adapt the generated replay script afterward.
- When final evidence is ready, mark the case reusable:
python3 scripts/testcase_artifacts.py finalize \
--case-dir <case-dir> \
--status success \
--script <case-dir>/generated/<rendered-script>.py \
--summary "Validated on device and exported replay script."- If the final result is
partialorblocked, do not stop at the report alone. Summarize the failure from the evidence, then ask the user whether Codex should patch the target project and rerun the same case until it passes. - When the user agrees to remediation and the target project is available locally, use the case evidence (
report/index.html,captures/,timeline.jsonl, generated script) to drive the fix -> rerun -> verify loop. - Promote stable selectors from the XML tree into the final test.
- If source hints exist, merge them with runtime XML instead of choosing one source blindly.
- Downgrade coordinate taps to comments or temporary TODOs unless they are the only workable interaction.
- Keep the setup notes in the test or adjacent documentation: device assumptions, bundle id, and WDA assumptions.
- Copy the final script into
<case-dir>/generated/even if the target repo also stores it elsewhere.
8. Validate And Finalize
- Re-run the explored flow or at least the key checkpoints after authoring the script.
- Report exactly which parts were validated on-device and which parts were only inferred from XML or screenshots.
- Report when any selector or assertion came only from source-file analysis.
- If WDA bootstrap was the blocker, report that explicitly instead of claiming the UI test script is validated.
- Finalize the case so later turns can reuse it directly:
python3 scripts/testcase_artifacts.py finalize \
--case-dir <case-dir> \
--status success \
--script /path/to/final_test.py \
--summary "<validated scope, selector notes, and known caveats>"Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

