detox

Detox React Native E2E testing. Use for RN testing.

7 stars

Best use case

detox is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Detox React Native E2E testing. Use for RN testing.

Teams using detox should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/detox/SKILL.md --create-dirs "https://raw.githubusercontent.com/G1Joshi/Agent-Skills/main/skills/testing/detox/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/detox/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How detox Compares

Feature / AgentdetoxStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Detox React Native E2E testing. Use for RN testing.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Detox

Detox is designed for React Native. Unlike Appium (Black-box), Detox works "Gray-box" by running _inside_ your app, monitoring the main thread. It _knows_ when the app is busy/idle, eliminating flaky waits.

## When to Use

- **React Native Apps**: The gold standard for RN E2E.
- **Speed & Stability**: Much less flaky than Appium for RN because of synchronization.
- **CI/CD**: Designed to be fast enough for CI.

## Quick Start

```javascript
describe("Example", () => {
  beforeAll(async () => {
    await device.launchApp();
  });

  it("should show hello screen after tap", async () => {
    await element(by.id("hello_button")).tap();
    await expect(element(by.text("Hello!!!"))).toBeVisible();
  });
});
```

## Core Concepts

### Synchronization

Detox monitors network requests, animations, and timers. It waits for the app to go "Idle" before executing the next command. No `sleep()` needed.

### Matchers

`by.id()`, `by.text()`, `by.label()`. Needs `testID` props on React Native components.

## Best Practices (2025)

**Do**:

- **Add `testID` props**: Add them to all interactive elements in your React Native code.
- **Use `device.reloadReactNative()`**: Faster than relaunching the whole app for every test.
- **Mock Metro**: Mock JS bundles to avoid network flakes in CI.

**Don't**:

- **Don't run animations**: Disable them in the test build for speed and stability.
- **Don't combine with Appium**: Choose one for your project.

## References

- [Detox Documentation](https://wix.github.io/Detox/)