appium / appium-idb

idb integration for Appium
Apache License 2.0
75 stars 13 forks source link

Command for setting location using underscore instead of hyphen #9

Closed studuffy closed 5 years ago

studuffy commented 5 years ago

Hey, I just started trying out this stuff, and got an error when setting the location. It's trying to use the command set_location, but I think idb is expecting set-location.

(I had a quick look at the other commands, and the same may be true for clear-keychain)

Here's the log from my run:

[HTTP]
[HTTP] --> POST /wd/hub/session/91236dbb-b00c-45ba-adf6-3c8f7f7cde66/location
[HTTP] {"location":{"altitude":0,"latitude":53.551086,"class":"org.openqa.selenium.html5.Location","longitude":9.993682}}
[debug] [W3C (91236dbb)] Calling AppiumDriver.setGeoLocation() with args: [{"altitude":0,"latitude":53.551086,"class":"org.openqa.selenium.html5.Location","longitude":9.993682},"91236dbb-b00c-45ba-adf6-3c8f7f7cde66"]
[debug] [XCUITest] Executing command 'setGeoLocation'
[debug] [IDB] Setting location (53.551086, 9.993682) on the device '8ACBF6E8-2D38-486B-A3BB-69880954A8F8'
[debug] [IDB] Running '/usr/local/bin/idb set_location 53.551086 9.993682 --udid 8ACBF6E8-2D38-486B-A3BB-69880954A8F8'
[debug] [W3C (91236dbb)] Encountered internal error running command: Error executing idb. Original error: 'Command '/usr/local/bin/idb set_location 53.551086 9.993682 --udid 8ACBF6E8-2D38-486B-A3BB-69880954A8F8' exited with code 2'; Stdout: ''; Stderr: 'usage: idb [-h]
[debug] [W3C (91236dbb)]            {add-media,approve,boot,clear-keychain,connect,contacts,crash,daemon,debugserver,describe,disconnect,dsym,dylib,file,focus,framework,install,instruments,kill,launch,list-apps,list-targets,log,open,pull,push,record,screenshot,set-location,terminate,ui,uninstall,video,record-video,xctest}
[debug] [W3C (91236dbb)]            ...
[debug] [W3C (91236dbb)] idb: error: argument root_command: invalid choice: 'set_location' (choose from 'add-media', 'approve', 'boot', 'clear-keychain', 'connect', 'contacts', 'crash', 'daemon', 'debugserver', 'describe', 'disconnect', 'dsym', 'dylib', 'file', 'focus', 'framework', 'install', 'instruments', 'kill', 'launch', 'list-apps', 'list-targets', 'log', 'open', 'pull', 'push', 'record', 'screenshot', 'set-location', 'terminate', 'ui', 'uninstall', 'video', 'record-video', 'xctest')'; Code: '2'
[debug] [W3C (91236dbb)] Error: Command '/usr/local/bin/idb set_location 53.551086 9.993682 --udid 8ACBF6E8-2D38-486B-A3BB-69880954A8F8' exited with code 2
[debug] [W3C (91236dbb)]     at ChildProcess.proc.on.code (/usr/local/lib/node_modules/appium/node_modules/teen_process/lib/exec.js:94:19)
[debug] [W3C (91236dbb)]     at ChildProcess.emit (events.js:188:13)
[debug] [W3C (91236dbb)]     at maybeClose (internal/child_process.js:978:16)
[debug] [W3C (91236dbb)]     at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
[HTTP] <-- POST /wd/hub/session/91236dbb-b00c-45ba-adf6-3c8f7f7cde66/location 500 463 ms - 2495
[HTTP]
mykola-mokhnach commented 5 years ago

Thanks for the report

mykola-mokhnach commented 5 years ago

The fixed module has been published. Please reinstall appium@beta to get it.

studuffy commented 5 years ago

Awesome, thanks!