expect_redux
Assert against Redux/Zustand store state at a path. Returns ok when the assertion matches; failResult with code=ASSERTION_FAILED when it does not. Operators (compose with AND): equals (deep), exists (default if no other op), notExists, length (array/string), contains (array), gt/lt/gte/lte (numbers). Pass timeoutMs to retry until match — useful when the store updates asynchronously after a tap. Differentiated capability over Maestro: Maestro asserts pixels; this asserts internal state.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Constraints | Description |
|---|---|---|---|---|---|
path | string | Yes | Dot-path into the store, e.g. “cart.items” or “auth.user.id”. Required. | ||
storeType | string | No | Restrict to a specific store (“redux" | ||
equals | unknown | No | Deep-equal against this value. | ||
exists | boolean | No | When true, value must be defined and non-null. When false, value must be undefined or null. Implicit default if no other operator is supplied. | ||
notExists | boolean | No | Inverse of exists. | ||
length | number | No | integer | Asserts (Array | |
contains | unknown | No | Asserts an array contains this element (deep-equal). | ||
gt | number | No | Asserts actual > this number. | ||
lt | number | No | Asserts actual < this number. | ||
gte | number | No | Asserts actual >= this number. | ||
lte | number | No | Asserts actual <= this number. | ||
timeoutMs | number | No | min: 0, integer | Polling timeout in ms (default 0 = no retry). Useful for async state updates. |
expect_redux(path: <string>)