Imported from willyu1007/Fun-ForumAI (
.ai/skills/testing/test-mobile-detox/SKILL.md). Install upstream withnpx skills add willyu1007/Fun-ForumAI --skill test-mobile-detox. Copyright stays with the author.
name: test-mobile-detox description: Detox mobile E2E automation for React Native: bootstrap, author flows, run/debug, and produce reliable artifacts for CI.
Detox Mobile E2E Automation (workflow)
Operating mode (token-efficient)
- Treat this skill as a router + governor.
- Do not load multiple procedures. Select exactly one procedure below and follow it end-to-end.
- Optimize for determinism and reproducible artifacts.
Routing (pick one procedure)
| Task | Open this procedure | Optional examples |
|---|---|---|
| Bootstrap Detox in a React Native repo | reference/procedures/bootstrap.md |
reference/examples/detox.config.mjs |
| Add a new Detox E2E test | reference/procedures/add-test.md |
reference/examples/smoke.e2e.ts |
| Run locally (debug) | reference/procedures/run-local.md |
ā |
| Triage failures / reduce flaky | reference/procedures/triage-failures.md |
ā |
Shared non-negotiables (apply to all procedures)
-
Stable selectors
- Prefer RN
testIDand accessibility identifiers as the primary locator strategy. - Avoid text-only selectors when localization or dynamic content exists.
- Prefer RN
-
No fixed sleeps
- Do not rely on arbitrary delays.
- Use Detox synchronization and explicit waits/assertions.
-
Test isolation
- Each test must be runnable independently.
- Reset app state between tests (relaunch) unless explicitly optimized.
-
Artifact contract (for CI + triage)
- Standardize under:
artifacts/detox/ - Must include: logs + screenshots on failure (and video if your setup supports it).
- Standardize under:
-
No secrets in repo
- Test credentials must come from CI secrets / local env vars.
- Never commit real user credentials.
Minimal inputs you should capture before changing code
- Platforms: iOS / Android (one or both)
- Device targets: simulator/emulator names + OS versions
- Build variants: debug vs release
- Auth model and whether a test-only bypass exists
- Test data strategy (seeded test tenant vs local mock)
Verification
-
If you changed skills:
- Prefer host-repo tooling if present:
node .ai/scripts/lint-skills.mjs --strict
- Always run the local validator:
node .ai/skills/testing/test-mobile-detox/scripts/validate-skill.mjs
- Prefer host-repo tooling if present:
-
If you changed tests/config:
npx detox --version- Build + test (configuration name varies by repo):
npx detox build -c <config>npx detox test -c <config>
Boundaries
- Do not edit
.codex/skills/or.claude/skills/directly (generated). - Do not introduce a second RN E2E framework unless Detox is insufficient for a documented reason.
- Do not rely on production services without explicit approval and isolation.