appium / appium-flutter-driver

Appium Flutter Driver is a test automation tool for Flutter apps on multiple platforms/OSes. Appium Flutter Driver is part of the Appium mobile test automation tool maintained by community
MIT License
440 stars 179 forks source link

Flutter driver "doctor" checks and errors out for xcode on non mac platforms #680

Closed zaphodikus closed 2 months ago

zaphodikus commented 3 months ago

https://github.com/appium/appium-flutter-driver/blob/6f352104a086754b8f38c648367700a766187645/driver/package.json#L30

Is there a way to just not have appium-doctor error when we use the flutter driver on a non-mac platform? c:> appium driver doctor flutter … ERR! Xcode Cannot determine the path to Xcode by running ‘xcode-select -p’ command. Original error: ‘xcode-select’ executable is not found neither in the process working folder (C:\Users\cb) nor in any folders specified in the PATH environment variable (C:\Python311\Scripts;C:\Python311;C:\Program Files\OpenLogic\jdk-8.0.372.07-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Git\cmd;C:\Program Files\PuTTY;C:\Users\cb\AppData\Local\Android\Sdk\platform-tools;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Tools\gnirehtet;C:\Users\cb\AppData\Local\Microsoft\WindowsApps;C:\Users\cb\AppData\Roaming\npm;C:\ProgramData\chocolatey\lib\chromedriver\tools;C:\Users\cb\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts;) … The command fails when it's not possible/logical to install xcode and the xcuitest drivers on Windows anyway. This makes using the doctor function in an automated CI/CD as a pure command-line tool harder to do than it really needs to be. Is this possible in the package rules?

zaphodikus commented 3 months ago

Probably unrelated, but the tool also outputs this incorrectly spelled string, which might make finding it in code or output and relying on it harder in future. "Fix the problems xCode tools are compliaining about"

KazuCocoa commented 3 months ago

Perhaps making both env, android and ios, optional is a possible method in current doctor command's behavior https://github.com/appium/appium-flutter-driver/blob/main/driver/package.json#L31 https://github.com/appium/appium-flutter-driver/blob/main/driver/package.json#L33

Or possibly it can skip ios check for non-macOS env since iOS env should not work for them.

The spelling thing is in https://github.com/appium/appium-xcuitest-driver related.

KazuCocoa commented 2 months ago

Perhaps https://github.com/appium/appium-xcuitest-driver/pull/2381 helps for this. I haven't decided but for example we could control what check should be skipped with env var. (As the command, currently it does not expect to add more args)

ANDROID=false appium driver doctor flutter
IOS=false appium driver doctor flutter
zaphodikus commented 2 months ago

Thanks, not touched package dependency tooling really before so no idea how they even work even though I rely on so many different ones to prepare machines. An environment variable mechanism sounds like a fair way to pas args in for users like me. It's always a decision with other careful considerations for maintainers.

KazuCocoa commented 2 months ago

As https://github.com/appium/appium-flutter-driver?tab=readme-ov-file#doctor, the command can skip check with env var. Please check the usage in the README.