pub struct FailureInit {
pub code: Option<FailureCode>,
pub message: String,
pub selector: Option<Selector>,
pub suggestions: Vec<String>,
pub visible_elements: Vec<ElementSummary>,
pub hint: Option<String>,
pub screenshot: Option<String>,
pub device_log: Vec<String>,
pub visible_total: Option<usize>,
pub windows: Vec<WindowInfo>,
pub unreadable_windows: Option<u32>,
}Expand description
Builder/Init form for ergonomic construction.
Fields§
§code: Option<FailureCode>Optional failure code (defaults to DriverError if None).
message: StringHuman-readable / AI-readable message.
selector: Option<Selector>Originating selector, when one is available.
suggestions: Vec<String>Pre-built ranked near-miss suggestions.
visible_elements: Vec<ElementSummary>Captured visible+enabled elements at failure time.
hint: Option<String>Optional one-line hint string.
screenshot: Option<String>Optional base64 PNG screenshot at failure time.
device_log: Vec<String>Optional captured device log tail.
visible_total: Option<usize>§windows: Vec<WindowInfo>§unreadable_windows: Option<u32>Implementations§
Source§impl FailureInit
impl FailureInit
Sourcepub fn with_screen(self, facts: ScreenFacts) -> Self
pub fn with_screen(self, facts: ScreenFacts) -> Self
The screen the failure happened on: its elements (already in the order a reader should meet them), how many there were, whose windows they sat in, and how many windows could not be read.
One entry point, so a call site cannot hand over the list and forget the count that says it is a sample.
Sourcepub fn with_screen_from(self, earlier: &ExpectationFailure) -> Self
pub fn with_screen_from(self, earlier: &ExpectationFailure) -> Self
The screen an earlier failure described, carried into a new one.
For a failure that re-states another (a timeout reported as “not
visible”): copying visible_elements by hand left the count and
the windows behind, and the next field added would be left behind
the same way.