Skip to content

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.

NameTypeRequiredDefaultConstraintsDescription
pathstringYesDot-path into the store, e.g. “cart.items” or “auth.user.id”. Required.
storeTypestringNoRestrict to a specific store (“redux"
equalsunknownNoDeep-equal against this value.
existsbooleanNoWhen true, value must be defined and non-null. When false, value must be undefined or null. Implicit default if no other operator is supplied.
notExistsbooleanNoInverse of exists.
lengthnumberNointegerAsserts (Array
containsunknownNoAsserts an array contains this element (deep-equal).
gtnumberNoAsserts actual > this number.
ltnumberNoAsserts actual < this number.
gtenumberNoAsserts actual >= this number.
ltenumberNoAsserts actual <= this number.
timeoutMsnumberNomin: 0, integerPolling timeout in ms (default 0 = no retry). Useful for async state updates.
expect_redux(path: <string>)