appium / appium-mac2-driver

Next-gen Appium macOS driver, backed by Apple XCTest
Apache License 2.0
115 stars 24 forks source link

All wda mac interface sets #283

Open HaoWShi opened 4 months ago

HaoWShi commented 4 months ago

I would like to know where I can see all the current set of interfaces? anybody know?

KazuCocoa commented 4 months ago

do you mean https://github.com/appium/appium-mac2-driver/blob/master/WebDriverAgentMac/WebDriverAgentLib/Commands/AMActionCommands.m for example? Then https://github.com/appium/appium-mac2-driver/tree/master/WebDriverAgentMac/WebDriverAgentLib/Commands

HaoWShi commented 4 months ago

I have read the files in https://github.com/appium/appium-mac2-driver/tree/master/WebDriverAgentMac/WebDriverAgentLib/Commands. In fact I mean https://github.com/appium/appium-mac2-driver/blob/master/lib/commands/app-management.js , there are interface I can use. The interface you mentioned, how should I use it?

KazuCocoa commented 4 months ago

The WDA's APIs are expected to be used via mac2 driver running on a host machine, so https://github.com/appium/appium-mac2-driver/blob/master/lib/commands/app-management.js like you addresses are endpoints.

Each method names defined in JavaScript code are mapped in https://github.com/appium/appium/blob/master/packages/base-driver/lib/protocol/routes.js . The Web API is defined in https://appium.io/docs/en/latest/commands/base-driver/ or https://appium.io/docs/en/latest/guides/execute-methods/ https://github.com/appium/appium-mac2-driver?tab=readme-ov-file#platform-specific-extensions

HaoWShi commented 4 months ago

Yes, It is what I want, I will read them firstly. Thank you very much By the way, I noticed the locked/unlock/lock interface on the phone, but on the Mac, I don't see it. Is it not supported? Or is it another interface?

KazuCocoa commented 4 months ago

XCUITest driver achieves it with https://developer.apple.com/documentation/xctest/xcuidevice?language=objc but it looks like the documentation does not say macOS support it. So potentially macOS has no method to lock the screen over XCTest framework

KazuCocoa commented 4 months ago

Instead, for lock, I wondered if Control-Command-Q: Immediately lock your screen. works https://support.apple.com/en-us/HT201236 https://github.com/appium/appium-mac2-driver?tab=readme-ov-file#macos-keys