Skip to main content

UxCoverageTracker

Struct UxCoverageTracker 

Source
pub struct UxCoverageTracker { /* private fields */ }
Expand description

UX Coverage Tracker

Implementations§

Source§

impl UxCoverageTracker

Source

pub fn new() -> Self

Create a new UX coverage tracker

Source

pub fn register_element( &mut self, element: ElementId, expected: &[InteractionType], )

Register an element with expected interactions

Source

pub fn register_button(&mut self, id: &str)

Register a button element (click expected)

Source

pub fn register_input(&mut self, id: &str)

Register an input element (focus, input, blur expected)

Source

pub fn register_clickable(&mut self, element_type: &str, id: &str)

Register a clickable element

Source

pub fn register_state(&mut self, state: StateId)

Register an expected state

Source

pub fn register_screen(&mut self, name: &str)

Register a screen state

Source

pub fn register_modal(&mut self, name: &str)

Register a modal state

Source

pub fn record_interaction( &mut self, element: &ElementId, interaction: InteractionType, )

Record an interaction

Source

pub fn record_visibility(&mut self, element: &ElementId)

Record element visibility

Source

pub fn record_reachability(&mut self, element: &ElementId)

Record element reachability

Source

pub fn record_state(&mut self, state: StateId)

Record a state visit

Source

pub fn end_journey(&mut self)

End current journey and start a new one

Source

pub fn element_coverage(&self) -> f64

Get overall element coverage percentage

Source

pub fn state_coverage(&self) -> f64

Get state coverage percentage

Source

pub fn overall_coverage(&self) -> f64

Get overall UX coverage percentage

Source

pub fn is_complete(&self) -> bool

Check if 100% coverage achieved

Source

pub fn uncovered_elements(&self) -> Vec<&ElementCoverage>

Get uncovered elements

Source

pub fn unvisited_states(&self) -> Vec<&StateId>

Get unvisited states

Source

pub fn journeys(&self) -> &[Vec<StateId>]

Get all recorded journeys

Source

pub fn generate_report(&self) -> UxCoverageReport

Generate a coverage report

Source

pub fn assert_coverage(&self, min_coverage: f64) -> ProbarResult<()>

Assert minimum coverage

Source

pub fn assert_complete(&self) -> ProbarResult<()>

Assert 100% coverage

Source

pub fn click(&mut self, id: &str)

Simple click recording - just pass the button ID

§Example
let mut tracker = UxCoverageTracker::new();
tracker.register_button("submit");
tracker.click("submit");
assert!(tracker.is_complete());
Source

pub fn input(&mut self, id: &str)

Simple input recording - records focus, input, and blur

Source

pub fn visit(&mut self, screen: &str)

Simple state/screen visit recording

Source

pub fn visit_modal(&mut self, modal: &str)

Simple modal visit recording

Source

pub fn summary(&self) -> String

Get a simple one-line summary

Returns: "GUI: 85% (17/20 elements, 4/5 screens)"

Source

pub fn percent(&self) -> f64

Get coverage as a simple percentage (0-100)

Source

pub fn meets(&self, threshold_percent: f64) -> bool

Check if coverage meets a threshold (as percentage 0-100)

Trait Implementations§

Source§

impl Debug for UxCoverageTracker

Source§

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

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

impl Default for UxCoverageTracker

Source§

fn default() -> UxCoverageTracker

Returns the “default value” for a type. Read more

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<R, P> ReadPrimitive<R> for P
where R: Read + ReadEndian<P>, P: Default,

Source§

fn read_from_little_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Source§

fn read_from_big_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Source§

fn read_from_native_endian(read: &mut R) -> Result<Self, Error>

Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.