appium / appium-mac2-driver

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

question: Why does there need to be an application under test? #202

Open kandji-joel opened 1 year ago

kandji-joel commented 1 year ago

I've read through this https://github.com/appium/appium-mac2-driver#application-under-test-concept and various issues. I did look much into the code yet. Is there a technical reason why the mac2 drive requires an application under test?

I'm seeing some annoying behavior where find elements fail because the application under test is getting pushed out of focus by notifications. To workaround this, I basically had to write a wrapper that checks app state and activates the expected application prior to trying to find element. This isn't perfect though and still fails occasionally

mykola-mokhnach commented 1 year ago

This concept is necessary to abstract https://developer.apple.com/documentation/xctest/xcuiapplication entity. Basically, for Apple's XCTest XCUIApplication must be always at the hierarchy root and all actions are performed on elements belonging to it.