appium / WebDriverAgent

A WebDriver server for iOS and tvOS
Other
1.2k stars 377 forks source link

add app switcher in api? #747

Open KevinChan168 opened 1 year ago

KevinChan168 commented 1 year ago

in the simulator, choose device, app switcher, the simulator will run the switcher do you consider add wda/appswitcher?

KazuCocoa commented 1 year ago

Do you have any idea how to achieve it via WDA?

I guess you would like to do like via assistive touch's app switcher in real devices. Afaik, we could enable the assistive touch via appium-ios-device, but WDA cannot interact with the assistive touch. So no good one API method for it. https://github.com/appium/appium-ios-device/issues/122

It possibly can do swipe-up action for non-physical home button devices but not sure of the necessity for automation purpose as Appium/WDA.

KevinChan168 commented 1 year ago

Do you have any idea how to achieve it via WDA?

I guess you would like to do like via assistive touch's app switcher in real devices. Afaik, we could enable the assistive touch via appium-ios-device, but WDA cannot interact with the assistive touch. So no good one API method for it. appium/appium-ios-device#122

It possibly can do swipe-up action for non-physical home button devices but not sure of the necessity for automation purpose as Appium/WDA. It has nothing to with assistive touch What I expect is simulating swipe up action to open app switcher in my automation case, I tried using XCUICoordinate offset dx:0 dy:1, to dx:0 dy:0, but it seems not working at all. I think there would be an api that can be called to open app switcher instead of swiping up to open the switcher.

KazuCocoa commented 1 year ago

I think there would be an api that can be called to open app switcher instead of swiping up to open the switcher.

It would be great if you could find out. Then, it is appreciated to share it with us. (I only found via assistive touch method, so no direct api)

The gesture approach works only non-physical home button devices, so personally, it would be nice to keep it as your implementation with w3c actions for your test case. For iPad usage, maybe some situation work, but some might not.

It is welcome to create a PR, btw. Perhaps if such API can confirm the app switcher is active, it may be great. For example the gesture approach works only when currently the device has no app switcher view. I haven't confirmed if we could do such detection though.