Skip to content

Python client

Package tap-e2e, imported as tap_e2e. These pages are generated from the docstrings and type hints of clients/python/tap_e2e; a type in a signature links to its own entry. The Guide explains each feature with examples.

from tap_e2e import TapClient, res, res_id, text, desc, CONTAINS, DOWN, StabilitySignal
from tap_e2e import TapError, CommandError, WaitTimeoutError, AppLifecycleError, DeviceBusyError, ServerError
Page What is on it
Device Device, one attached device; Timeouts
Element Element, a lazy selector bound to a device; ElementWait
Selectors text, res, desc, … and the Selector they build; match modes
App App, from device.app(package_name)
Screen Screen, from device.screen
Client and connections TapClient, TapConnection, the server's device list, start_daemon / stop_daemon
Artifacts Screenshot, Hierarchy, DeviceInfo, DriverLog, Recording, Capture
Values ElementSnapshot, AppProcess, PermissionPrompt, Toast, Notification, Long, …
Enums Direction, Orientation, PermissionChoice, StandardAction, StabilitySignal, …
Snapshots and the event log ScreenSnapshot, ScreenNode, EventLog, LoggedEvent
Errors TapError and its subclasses; ErrorCode, FailureReason, WaitReason
pytest plugin the fixtures and TapConfig

Protocol messages

The server API's tap.v1 messages, for tools that store or exchange them.

Recordings, event logs and other documents embed tap.v1 messages (a Selector, a Command, an Error); this module is their public home. Import the per-file modules to generate code against them (from tap_e2e.proto import selector_pb2: protobuf registers each .proto file once per process, so a tool's own generated code must import these rather than generate tap.v1 again), or the messages by name (tap_e2e.proto.Command).

tap_e2e.proto.Selector is the message; tap_e2e.Selector is the builder that wraps one (Selector.from_proto / to_proto). Experimental: it follows the server API's tap.v1 schema and may change in any release. Generated *_pb2_grpc modules are also exposed for clients that need shared RPC capabilities without creating a TapConnection.