Skip to main content

Module robot_assertions

Module robot_assertions 

Source
Expand description

Assertion utilities for robot testing

This module provides assertion helpers specifically designed for validating UI state in robot tests.

Structs§

Bounds
Bounds of a UI element (x, y, width, height)

Traits§

SemanticElementLike
Generic semantic element trait for tree traversal This allows the helpers to work with both cranpose::SemanticElement and similar types

Functions§

assert_approx_eq
Assert that a value is within an expected range.
assert_contains_text
Assert that a list contains a specific text fragment.
assert_count
Assert that a collection has an expected count.
assert_not_contains_text
Assert that a list does not contain a specific text fragment.
assert_rect_approx_eq
Assert that a rectangle is approximately equal to another.
assert_rect_contains_point
Assert that a rectangle contains a point.
find_button_bounds
Find a clickable element (button) containing the specified text. Returns the bounds (x, y, width, height) if found.
find_elements_by_role
Find all elements matching a role (e.g., “Layout”, “Text”).
find_text_bounds
Find an element by text content and return full bounds.
find_text_center
Find an element by text content in the semantic tree. Returns the center coordinates (x, y) if found.