Fix to enable appium ruby console (arc) on windows;#119
Conversation
Removed unnecessary ruby based absolute path conversion in load_appium_txt, as it is done later in Driver::initialize; Simplified absolute_app_path method for resolving windows paths;
|
|
|
It isn't till we actually initialize a driver, that we need the app_path to be correct, and at that point it uses the absolute_app_path method to validate the path is correct. The Ruby expand path method doesn't take into account urls, app ID's, or saucelab connection parameters. Plus, it rewrites the path on windows in a style that can't be passed directly in a capabilities object on windows (replaces backslashes with forward slashes). Even in the case of the reload method, it isn't till the Driver is initialize that we need or even check that the APP_PATH is correct. |
…indows Fix to enable appium ruby console (arc) on windows;
|
Makes sense. Merged. |
|
It turns out I was correct and this ended up breaking the app I'm testing.
The issue is with relative paths and not calling File.expand_path. I think this needs some automated tests. |
|
Damn, sorry. I will get some tests written and see if I can reproduce your issue and get another fix in quickly. |
|
I pushed this fix to master. |
|
Looks like a good fix, and I think an improvement in general on the absolute path call to make it easier to use later. I do think there is a place for adding some Cucumber tests for the ruby_lib in general, to test these scenarios. I will take a stab at adding some basic test cases. |
|
I have some tests here, working on adding the tests for this issue now. |
|
Wow, didn't know those existed. Excellent. I will fork those and make sure they all pass/get extended for my future pull requests. |
|
I added a few tests and it turns out the file system needs to be mocked.
On OS X, that Windows path will never be valid. |
|
If you aren't aware of it, https://github.com/defunkt/fakefs is around to help with this. Never tried it to mock a windows bath on OSX though. |
|
That looks like it'll work. Opened #120 to track progress. |
|
fakefs fails on windows paths for me (running on OS X). I pushed the tests to github. I'm sure there's some way to mock the windows FS on non-Windows platforms. I'm out of time to spend on this particular issue though. |
Removed unnecessary ruby based absolute path conversion in load_appium_txt, as it is done later in Driver::initialize;
Simplified absolute_app_path method for resolving windows paths;