calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 369 forks source link

calabash can't dismiss bluetooth springboard alert #1278

Closed cloffwang closed 7 years ago

cloffwang commented 7 years ago

ios: 10.2 run-loop version: 2.3.0 calabash version: 0.20.4

Would be nice to dismiss bluetooth alert automatically, thanks.

springboard info: {"title"=>"Turn On Bluetooth to Allow “Test App” to Connect to Accessories", "buttons"=>["Settings", "OK"], "tries"=>20, "error"=>"A SpringBoard alert is blocking test execution and it cannot be dismissed."}

joyzoursky commented 7 years ago

Having the same problem here on VPN Configurations springboard alert:

ios version: 10.2.1 run-loop version: 2.3.0 calabash version: 0.20.4

springboard info: {{"title"=>"“MyApp” Would Like to Add VPN Configurations", "buttons"=>["Allow", "Don’t Allow"], "tries"=>20, "error"=>"A SpringBoard alert is blocking test execution and it cannot be dismissed."}

The only commands that works when the alert pops are springboard_alert and springboard_alert_visible?. Other commands like touch, query, or touch_point are also not working.

calabash-ios 0.20.4> device_agent.springboard_alert
[
    [0] {
          "enabled" => true,
               "id" => "“MyApp” Would Like to Add VPN Configurations",
          "hitable" => true,
             "rect" => {
                 "y" => 244.5,
                 "x" => 52.5,
            "height" => 178.5,
             "width" => 270
        },
        "hit_point" => {
            "x" => 187.5,
            "y" => 333.75
        },
            "label" => "“MyApp” Would Like to Add VPN Configurations",
             "type" => "Alert"
    }
]

In my case, it works for some time before (although not very stable), but one day it keeps occurring and cannot dismiss the alert anymore. Also, this is the second time that I face this problem. In the first time, I upgraded it from iOS 9.3.2 to iOS 10.2.1 to resolve this (still happening after reset phone). But after running tests for a period of time it happens constantly again.

DragonClub commented 7 years ago

I have the same problem..

dismiss-springboard-alerts function does not seem to work..

WebDriverAgent works fine....

I hope the problem is solved..

jmoody commented 7 years ago

@DragonClub

What alerts are not being dismissed? Please follow the example of @joyzoursky and @cloffwang - post the error.

@joyzoursky and @cloffwang - thank you for the reports. These will be added to the alerts that are automatically dismissed.

jmoody commented 7 years ago

@cloffwang

The alert is saying, "Bluetooth for this device is not on."

We cannot automatically "turn on bluetooth in Settings" - you will have to configure your test device appropriately. I don't think touching "OK" to dismiss the alert is the correct behavior. I am afraid that this is not an alert Calabash can handle automatically. We are working on a feature that will allow users to manually interact with alerts.

@joyzoursky I am closing this issue, but I have captured your VPN issue.