pub struct TestFailure {
pub message: String,
pub stack: Option<String>,
pub diff: Option<String>,
pub screenshot: Option<Vec<u8>>,
}Expand description
A test failure with diagnostic information.
Fields§
§message: String§stack: Option<String>§diff: Option<String>§screenshot: Option<Vec<u8>>Screenshot on failure (auto-captured).
Implementations§
Source§impl TestFailure
impl TestFailure
Sourcepub fn wrap(prefix: impl Display, err: FerriError) -> Self
pub fn wrap(prefix: impl Display, err: FerriError) -> Self
Wrap a ferridriver::FerriError with a contextual prefix while
preserving the Playwright-style typed class name. The resulting
message reads "<prefix>: <Name>: <message>" for distinguishable
variants and "<prefix>: <message>" for unnamed ones, so consumers
that match on TimeoutError: still see the marker after the prefix.
Trait Implementations§
Source§impl Clone for TestFailure
impl Clone for TestFailure
Source§fn clone(&self) -> TestFailure
fn clone(&self) -> TestFailure
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TestFailure
impl Debug for TestFailure
Source§impl Display for TestFailure
impl Display for TestFailure
Source§impl Error for TestFailure
impl Error for TestFailure
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<&str> for TestFailure
impl From<&str> for TestFailure
Source§impl From<AssertionFailure> for TestFailure
impl From<AssertionFailure> for TestFailure
Source§fn from(a: AssertionFailure) -> Self
fn from(a: AssertionFailure) -> Self
Source§impl From<FerriError> for TestFailure
Enables ? on any Result<T, FerriError> inside test functions after
the migration to structured errors. Prepends the typed class name for
the variants Playwright distinguishes (TimeoutError / TargetClosedError)
so the TS bridge can re-hydrate a real class instance from the
<Name>: <message> shape — same convention ferridriver-node::error::to_napi
uses on the NAPI surface. Unnamed variants pass through verbatim.
impl From<FerriError> for TestFailure
Enables ? on any Result<T, FerriError> inside test functions after
the migration to structured errors. Prepends the typed class name for
the variants Playwright distinguishes (TimeoutError / TargetClosedError)
so the TS bridge can re-hydrate a real class instance from the
<Name>: <message> shape — same convention ferridriver-node::error::to_napi
uses on the NAPI surface. Unnamed variants pass through verbatim.
Source§fn from(err: FerriError) -> Self
fn from(err: FerriError) -> Self
Source§impl From<String> for TestFailure
Legacy bridge: kept so test bodies that hand-build a String error
(logging helpers, manual panic messages) keep ?-propagating through
TestFailure. Locator methods now return Result<T, FerriError> and
flow through the dedicated From<ferridriver::FerriError> impl below.
impl From<String> for TestFailure
Legacy bridge: kept so test bodies that hand-build a String error
(logging helpers, manual panic messages) keep ?-propagating through
TestFailure. Locator methods now return Result<T, FerriError> and
flow through the dedicated From<ferridriver::FerriError> impl below.
Auto Trait Implementations§
impl Freeze for TestFailure
impl RefUnwindSafe for TestFailure
impl Send for TestFailure
impl Sync for TestFailure
impl Unpin for TestFailure
impl UnsafeUnpin for TestFailure
impl UnwindSafe for TestFailure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more