[ Documentation ]
Your First Test

Your First Test

rnx supports two test runners. Maestro owns YAML tests; Detox runs imperative Jest specs through the rnx driver.

Maestro YAML

The simplest place to start. Create .maestro/smoke.yaml:

- launchApp: {}
- waitFor:
text: 'Welcome'
timeout: 10000
- tapOn: 'Get Started'
- waitForAnimationToEnd: true
- assertVisible: 'Home'
- takeScreenshot: home-screen

Run it:

terminal
rnx maestro test .maestro/smoke.yaml

Detox-style tests

If you want a familiar API, create e2e/my-app.test.ts:

import { by, element, expect } from 'detox'
test('shows home screen', async () => {
await expect(element(by.text('Welcome'))).toBeVisible()
await element(by.text('Get Started')).tap()
await expect(element(by.text('Home'))).toBeVisible()
})

Run with:

terminal
rnx detox

Existing Detox suites use the same command unchanged. rnx auto-detects the configuration and remaps import { by, element, expect } from 'detox' to its driver.

Test bridge API

All test drivers access the node tree through window.__sootsimTest:

// find elements
findByText(text) findById(id) findByTestId(testId)
findByLabel(label) findByRole(role) findAllByRole(role)
// inspect elements
getStyle(id) getLayout(id) getAbsolutePosition(id)
isVisible(id) getNodeCount()
// query
queryAll({ type?, hasText?, hasId?, hasRole?, hasLabel? })
// debug
dumpTree(maxDepth?) dumpAccessibilityTree(maxDepth?)
waitForTree()

Where to go next