#[non_exhaustive]pub enum FailureCode {
Show 13 variants
ElementNotFound,
NotVisible,
NotEnabled,
Ambiguous,
Timeout,
AssertionFailed,
AppNotRunning,
SimulatorNotBooted,
TapMissed,
CoordinateSpaceMismatch,
DriverError,
CaptureBackpressure,
AppNotInForeground,
}Expand description
All failure codes smix surfaces back to the SDK / MCP / CLI (SCREAMING_SNAKE_CASE wire).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ElementNotFound
Selector matched zero elements in the visible tree.
NotVisible
Element matched but failed the visibility filter.
NotEnabled
Element matched but enabled = false.
Ambiguous
Selector matched multiple elements (when uniqueness was required).
Timeout
Operation exceeded the implicit-wait budget.
AssertionFailed
expect assertion (e.g. toHaveText) did not hold.
AppNotRunning
Target app exited or never launched.
SimulatorNotBooted
Simulator device is not booted.
TapMissed
The touch was synthesised, and it did not land inside the element the selector matched.
Distinct from ElementNotFound because the two send a reader
somewhere different: not-found means fix the selector, missed
means the element was there and the touch went elsewhere — a
stale frame, or something moved between the tree fetch and the
tap.
CoordinateSpaceMismatch
The screen is described in one coordinate space and the touch would be delivered in another, so no aim can land where the tree says the element is.
Distinct from TapMissed, and the distinction is the whole
point: a miss says the element was there and the touch went
elsewhere, which invites another attempt with a better point.
There is no better point here — whatever is passed gets
recomputed against the app’s frame and then read against the
device’s. Retrying is the trap, and the consumer who found this
spent an afternoon in it.
DriverError
Catch-all for runner / driver / IO failures.
CaptureBackpressure
The device’s capture path is under load and refusing frames for a stated window — the screenshot pacer’s circuit is open.
Separate from Self::DriverError because the two want opposite
responses and only one of them is a defect. A driver error means
something is broken; this means “not now, try again shortly”, and
a caller with time left can simply keep waiting. It arrived as a
DriverError until 7.1, which is how a consumer’s release gate
met it: FAIL [DRIVER_ERROR] from waitForAnimationToEnd, a
verb whose entire meaning is to wait.
AppNotInForeground
The app has no window in front — another app or the home screen is
there — so its elements cannot be read. Unlike Self::AppNotRunning
nothing crashed: bring it back with launchApp or its notification.
Implementations§
Source§impl FailureCode
impl FailureCode
Sourcepub const ALL: &'static [FailureCode]
pub const ALL: &'static [FailureCode]
Every code, once.
The one list: the SDK parity test and the errors guide read it
rather than keeping their own (a copy outside this crate let
CaptureBackpressure ship in 7.1 with no SDK declaring it, since
#[non_exhaustive] makes an outside match accept anything).
the_vocabulary_is_pinned guards it with an exhaustive match here.
Sourcepub fn may_be_outside_the_app(self) -> bool
pub fn may_be_outside_the_app(self) -> bool
Whether the target may be outside the app’s tree altogether — on a system popup or a notification banner — so those are worth a look.
Sourcepub fn judges_the_screen(self) -> bool
pub fn judges_the_screen(self) -> bool
Whether this code is a verdict about the screen, as opposed to
smix being unable to look at it. An optional step skips only a
verdict, and an end-to-end check judges a flow by its own rule only
on one — a runner answering garbage once read as “the scroll stopped
in the wrong place”. Exhaustive, so a new code must pick a side.