Test Bridge

The test bridge is exposed as window.__sootsimTest in the browser. All test drivers (Detox, Maestro, Playwright) use this API to query the SootSim node tree.

Find methods

findByText(text: string): SootSimNodeInfo | null
findById(id: string): SootSimNodeInfo | null
findByTestId(testId: string): SootSimNodeInfo | null
findByLabel(label: string): SootSimNodeInfo | null
findByRole(role: string): SootSimNodeInfo | null
findAllByRole(role: string): SootSimNodeInfo[]
findByA11yState(state: object): SootSimNodeInfo | null

Query

queryAll(filter: {
type?: string
hasText?: string
hasId?: string
hasRole?: string
hasLabel?: string
hasHint?: string
hasState?: object
}): SootSimNodeInfo[]

Inspect

getStyle(id: string): object
getLayout(id: string): { x, y, width, height }
getAbsolutePosition(id: string): { x, y }
isVisible(id: string): boolean
getNodeCount(): number

Debug

dumpTree(maxDepth?: number): string
dumpAccessibilityTree(maxDepth?: number): string
waitForTree(): Promise<void> // polls until root has children
waitForScreenTransitions(opts?: {
timeoutMs?: number
settleMs?: number
startWindowMs?: number
}): Promise<{
started: boolean
settled: boolean
timedOut: boolean
activeCount: number
peakActiveCount: number
waitedMs: number
}>

Runtime introspection and profiling

Beyond querying the tree, __sootsimTest is a full runtime debugger: the same surface the CLI’s debug and inspect commands drive. The categories:

  • Animation tracing: listAnimations, getAnimation, enableAnimationTrace / disableAnimationTrace, getAnimationTrace. Answer “did this animation actually run, or snap?” frame by frame.
  • Perf / diagnostics: getCullStats, getImageLoaderStats, getIncrementalYogaVerifier (checks the layout dirty-tracking against a full recompute), getWorkletSlotStats, workerDebugState.
  • Network interception: getRequests, getFailedRequests, getRequestCounts, clearRequests.
  • Input / text introspection: getFocusedNode, getFocusKeyboardSnapshot, getTextInputDisplayText, getTextSelection, getLoupeState, getEditMenuState.
  • Inspect tooling: inspectAt, inspectHoverAt, inspectSetStyleOverride.
  • Scroll / navigation state: getScrollState, getScrollSnapshots, getNavigationSnapshot, isNavigationIdle.
  • Direct dispatch: activatePressByText / activatePressById, openDeepLink, scrollTo.

Most debugging is easier through the CLI (sootsim debug, sootsim inspect, sootsim describe) than by calling these directly, since the CLI wraps this bridge with settling and formatting.

SootSimNodeInfo

{
type: string
id: string | null
testID: string | null
text: string | null
style: Record<string, unknown>
layout: { x: number; y: number; width: number; height: number }
absolutePosition: { x: number; y: number }
childCount: number
pressed: boolean
pressable: boolean
accessible: boolean
accessibilityLabel: string | null
accessibilityRole: string | null
accessibilityHint: string | null
accessibilityState: object | null
accessibilityValue: object | null
}

Ready to build?

Run your React Native app in the browser. No simulators, no native toolchain, no waiting.

curl -fsSL https://sootsim.com/install.sh | sh