Closed KazuCocoa closed 1 year ago
Hey!
So the idea is to run the flutter app via its bundled tools from another process, grab the necessary urls for connection and pass to the driver?
Like the "utility to spawn process -> process runs flutter command -> process also starts flutter-driver", right?
Yes, when you do outside appium-flutter-driver as By using an existing method way.
This driver package itself can start the application under test process around https://github.com/appium-userland/appium-flutter-driver/blob/main/driver/lib/sessions/ios.ts#L29 instead of xcuitest driver in Appium. Then, it also needs to consider activateApp method's case as well.
hey @KazuCocoa! Is there any documentation about how to contribute into this driver? I would like to try to implement this feature, but first of all I'd like to figure out how to make this driver work for debug purposes
https://appium.github.io/appium/docs/en/2.0/ecosystem/build-drivers/ might help to catch up with dev environment in Appium 2.
The easiest way is build https://github.com/appium-userland/appium-flutter-driver/blob/main/driver/package.json (npm install
for example) and copy the build
directory into ~/.appium/node_modules/appium-flutter-driver/
.
it seems like Flutter will use xcdebug
to start a debug session.
Perhaps... then flutter:connectObservatoryWsUrl
way may help...? (since at least short term, 3rd party tooks won't work ios 17 x Xcode 15)
Could you please tell what will be an issue with iOS 17?
https://github.com/appium/appium/issues/18749
Launching an app via 3rd party tool may fail as com.apple.testmanagerd.lockdown.secure
driver.execute_script 'flutter:connectObservatoryWsUrl'
should help for this. So:
driver.execute_script 'flutter:connectObservatoryWsUrl'
Then, if the 2) detect the observatory url, it will establish a session
https://github.com/appium-userland/appium-flutter-driver#several-ways-to-start-an-application
https://github.com/appium-userland/appium-flutter-driver/issues/115#issuecomment-1467549554
Theoretically, it could. Appium XCUITest driver launches the app under test via XCTest API to follow how iOS launches the app as a black-box testing tool.
Maybe there are two options. Adding the possibility in https://github.com/appium/appium-ios-device, or use https://github.com/ios-control/ios-deploy or other tools like https://github.com/danielpaulus/go-ios to launch the app with a debugger for this driver specific. The appium-ios-device already has an ability to launch an app process via instrument, so potentially it could achieve with a few changes, or it needs more implementation.
By using an existing method, you also could manage the starting app part on your test code and gives the observatory URL with
appium:observatoryWsUri
capability. Then, this driver attempts to attach the websocekt against the given URL. In this case, you also could launch the app under test with flutter command as same.