API ReferenceGoDesktop
Desktop
Native macOS application automation through the installable desktop-mac XCUITest plugin. Windows and Linux are not available yet.
Desktop.Mac.Connect
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.
func (MacSurface) Connect(ctx context.Context, options DesktopMacConnectOptions) (*MacDesktop, error)Example
mac, err := allwright.Desktop.Mac.Connect(ctx, allwright.DesktopMacConnectOptions{})MacDesktop.Launch
Launches an installed macOS application by bundle identifier. The returned app supports native locators, actions, text reads, waits, screenshots, and accessibility snapshots.
func (d *MacDesktop) Launch(ctx context.Context, options DesktopMacLaunchOptions) (*MacApp, error)Example
app, err := mac.Launch(ctx, allwright.DesktopMacLaunchOptions{AppID: "com.apple.TextEdit"})MacApp locators and actions
Uses native XCUITest selectors and the Playwright-style role, text, label, and test-id locator subset. App methods include Click, Fill, Focus, Press, Count, TextContent, InnerText, WaitForSelector, Screenshot, and AccessibilitySnapshot.
func (p *MacApp) Locator(selector string) *MacLocator
func (p *MacApp) GetByRole(role string, options ...RoleOptions) *MacLocator