calabash / calabash-ios

Calabash for iOS
Other
1.81k stars 369 forks source link

DeviceAgent cannot dismiss alert when passing in data via a custom url scheme #1277

Closed lukebar closed 7 years ago

lukebar commented 7 years ago

My app is sometimes launched by a custom url that passes in configuration data. For instance, in an email, a user might tap on a url that looks like flashnotederby://launch?params=blablabla

To simulate this, my calabash tests launch my app and then use the command xcrun simctl openurl booted "flashnotederby://launch?params=blablabla

this brings up a dialog that says "Open in 'Flashnote'?" to confirm whether the data in the url should be processed by opening my app. (It doesn't matter that it is already open.) Previously, I could use uia_action to confirm processing the url with my app (by tapping the "Open" button, but device_agent yields only the dreaded...

Server replied with:

{"title"=>"Open in “Flashnote”?", "buttons"=>["Cancel", "Open"], "tries"=>20, "error"=>"A SpringBoard alert is blocking test execution and it cannot be dismissed."}

Screenshot of the dialog is attached. screen shot 2017-02-21 at 5 48 47 pm

jmoody commented 7 years ago

We are working on trying to fix this.

jmoody commented 7 years ago

@lukebar We have a solution, but we need a way to pop this alert by performing an action in the application under test. I can generate the alert that using xcrun simctl openurl booted (as you indicated), but I need a way to generate the alert on physical devices.

jmoody commented 7 years ago

FIXED!!! In run-loop 2.4.0, but only when running with Xcode 8+