Open papatr0x opened 4 years ago
Try using device_agent.enter_text
. Whenever you are interacting with a SpringBoard, use the device_agent APIs.
Hi @jmoody, I've tried device_agent.enter_text() , this throws with "RuntimeError (Keyboard must be visible)", however keyboard in on screen.
calabash-ios 0.21.10> device_agent.set_dismiss_springboard_alerts_automatically(false)
DEBUG: HTTP: get http://192.168.102.201:27753/1.0/health {:retries=>1, :timeout=>0.5}
DEBUG: DeviceAgent says, "Calabash is ready and waiting."
DEBUG: HTTP: post http://192.168.102.201:27753/1.0/set-dismiss-springboard-alerts-automatically {:retries=>200, :timeout=>20}
false
calabash-ios 0.21.10> device_agent.enter_text("password")
DEBUG: HTTP: get http://192.168.102.201:27753/1.0/health {:retries=>1, :timeout=>0.5}
DEBUG: DeviceAgent says, "Calabash is ready and waiting."
DEBUG: HTTP: post http://192.168.102.201:27753/1.0/query {:retries=>200, :timeout=>20}
DEBUG: HTTP: post http://192.168.102.201:27753/1.0/dismiss-springboard-alerts {:retries=>200, :timeout=>20}
DEBUG: HTTP: post http://192.168.102.201:27753/1.0/dismiss-springboard-alerts {:retries=>200, :timeout=>20}
INFO: Embed is not available in this context. Will not embed.
Traceback (most recent call last):
9: from /Users/ppalma/.rbenv/versions/2.6.3/bin/irb:23:in `<main>'
8: from /Users/ppalma/.rbenv/versions/2.6.3/bin/irb:23:in `load'
7: from /Users/ppalma/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/irb-1.2.1/exe/irb:11:in `<top (required)>'
6: from (irb):26
5: from /Users/ppalma/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/calabash-cucumber-0.21.10/lib/calabash-cucumber/device_agent.rb:307:in `enter_text'
4: from /Users/ppalma/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/calabash-cucumber-0.21.10/lib/calabash-cucumber/device_agent.rb:467:in `with_screenshot_on_failure'
3: from /Users/ppalma/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/calabash-cucumber-0.21.10/lib/calabash-cucumber/device_agent.rb:471:in `rescue in with_screenshot_on_failure'
2: from /Users/ppalma/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/calabash-cucumber-0.21.10/lib/calabash-cucumber/failure_helpers.rb:88:in `fail'
1: from /Users/ppalma/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/calabash-cucumber-0.21.10/lib/calabash-cucumber/failure_helpers.rb:75:in `screenshot_and_raise'
RuntimeError (Keyboard must be visible)
calabash-ios 0.21.10>
Try using the DeviceAgent.iOS http API.
POST /1.0/gesture
{
"gesture" : "enter_text",
"string" : "<string to type>"
}
Alternatively, use the RunLoop API directly.
I am not allowed to investigate defects in Calabash iOS because it is no longer supported by Microsoft.
Currently I am trying to input a password in a textfield placed on a springboard alert. But command keyboard_enter_text() throws with "Keyboard is not visible", however keyboard is present on screen. Auto dismiss springboard alerts is disabled.
I looked into the code and it seems that query for keyboard into docked_keyboard_visible? function fails to get the right value.
The setup used for testing is: