calabash / run_loop

The bridge between Calabash iOS and Xcode command-line tools like instruments and simctl.
Other
32 stars 41 forks source link

Finish up keyboard issue #712

Closed JoeSSS closed 3 years ago

JoeSSS commented 5 years ago

The keyboard not appear issue was not completely fixed:

The fix is checking simulator health also in launch_cbx_runner

JoeSSS commented 5 years ago

It is not a stalled Simulator problem. The problem is in that that user can run Calabash test once and during debugging touch hard keyboard. After this is done the soft keyboard is automatically dismissed. And if this user runs the next test, run_loop will never check if soft keyboard is actually available. Everything it will check on that point is if Sim is launched by run_loop and DeviceAgent is up. That's why I moved the keyboard check method out of private and check it now in client.rb. also that was an easy way to just kill DeviceAgent, as the next check will require relaunch because of this.

jmoody commented 5 years ago

Gotcha! Thanks for the clarification. I think I understand the use case now.

The problem is that user can run Calabash test once and during debugging touch hard keyboard. After this is done the soft keyboard is automatically dismissed. And if this user runs the next test, run_loop will never check if soft keyboard is actually available.

I can see how during debugging you would want to use the hardware keyboard. What I don't understand is why the next cucumber test does not cause the simulator to relaunch with the correct settings.

  def launch_simulator(options={})
    merged_options = {
      :wait_for_stable => true
    }.merge(options)

   # Why does this return false?
    if !simulator_requires_relaunch?
JoeSSS commented 5 years ago

Because it never calls launch_simulator if the simulator and device agent are already launched. I will try to investigate where it happens in the code.