Skip to main content

FailureCode

Enum FailureCode 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for FailureCode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for FailureCode

Source§

impl Debug for FailureCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for FailureCode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for FailureCode

Source§

impl Hash for FailureCode

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for FailureCode

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for FailureCode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for FailureCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.