testudos.api.wait
testudos.api.wait
Waiting and lookup helpers.
wait_* helpers poll backend RPC actions until a condition is met or timeout.
get_* helpers perform a single immediate lookup and return None if not found.
Dict targets with type resolve via spy descriptors (qmlName / logicalName /
className) with findObjectByProperties as fallback. For UI exploration only,
see :mod:testudos.api.debug.
get_object
def get_object( target: str | dict[str, Any], *, parent: str | dict[str, Any] | QtObjectProxy | None = None) -> QtObjectProxy | NoneGet an object immediately by name or properties.
When parent is set and target is a QML id string, search only inside that
subtree (see :func:get_descendant).
Dict targets with type match spy qmlName / logicalName / className
fields, then fall back to findObjectByProperties.
Returns None when no object exists at call time.
wait_for_object
def wait_for_object( target: str | dict[str, Any], timeout: float = 5, *, parent: str | dict[str, Any] | QtObjectProxy | None = None) -> QtObjectProxyWait for an object to appear, then return a proxy.
str:findObject(useparentto scope duplicate QML ids).dictwithtype: spyqmlName/logicalName/className, thenfindObjectByPropertiesfallback.dictwithouttype:findObjectByProperties.
Arguments:
target- Object name (str) or property filter (dict).timeout- Maximum wait in seconds (default 5).parent- Optional container limiting search to a subtree (str targets only).
Raises:
TestudosTimeoutError- If the object is not found within timeout.
get_object_by_text
def get_object_by_text(text: str) -> QtObjectProxy | NoneGet an object by text immediately.
Returns None when no object matches at call time.
wait_for_object_by_text
def wait_for_object_by_text(text: str, timeout: float = 5) -> QtObjectProxyWait for an object whose readable string property equals text.
get_object_item
def get_object_item(list_obj: str | QtObjectProxy, item_text: str) -> QtObjectProxy | NoneGet a direct child item under list_obj by exact text.
Returns None when no item matches at call time.
wait_for_object_item
def wait_for_object_item(list_obj: str | QtObjectProxy, item_text: str, timeout: float = 5) -> QtObjectProxyWait for a concrete direct-child item under list_obj whose text equals item_text.
Uses backend RPC action findObjectItem.
wait_for
def wait_for(condition: Callable[[], bool], timeout: float = 5, poll_interval: float = 0.1) -> NonePoll a boolean condition until it becomes True or timeout is reached.
wait_for_text
def wait_for_text(target: str | dict[str, Any] | QtObjectProxy, expected_text: str, timeout: float = 5, poll_interval: float = 0.1) -> strWait until target.text equals expected_text and return the observed text.
wait_for_application_launch
def wait_for_application_launch( timeout: float = 10, poll_interval: float = 0.1, min_top_level_objects: int = 1) -> list[QtObjectProxy]Wait until AUT exposes at least min_top_level_objects top-level objects.