allwright

API ReferencePythonDesktop

Desktop

Native macOS application automation through the installable desktop-mac XCUITest plugin. Windows and Linux are not available yet.

desktop.mac.connect

MethodSince v0.1.21

Connects to the local macOS desktop and starts the bundled XCUITest runner automatically. Requires macOS 14 or newer, Xcode, and UI automation permission for the process running Xcode.

def connect(self, options: DesktopMacConnectOptions | None = None) -> MacDesktop

Example

mac = desktop.mac.connect()

MacDesktop.launch

MethodSince v0.1.21

Launches an installed macOS application by bundle identifier. The returned app supports native locators, actions, text reads, waits, screenshots, and accessibility snapshots.

def launch(self, options: DesktopMacLaunchOptions) -> MacApp

Example

app = mac.launch(DesktopMacLaunchOptions(app_id="com.apple.TextEdit"))

MacApp locators and actions

MethodSince v0.1.21

Uses native XCUITest selectors and the Playwright-style role, text, label, and test-id locator subset. App methods include click, fill, focus, press, count, text_content, inner_text, wait_for_selector, screenshot, and accessibility_snapshot.

def locator(self, selector: str) -> MacLocator
def get_by_role(self, role: str, options: RoleOptions | None = None) -> MacLocator