Reputation: 1318
I am in the process of integrating Calabash into a large project. I have Calabash working in a test app, so I know my installation and environment are set up correctly. I am using accessibility labels and .feature files to tap buttons and type text into fields. It works great.
However, my "real" project is much larger and more complex. Even though the configuration is identical to my test app (see stats below,) when I run a simple .feature file on the real app, I get erratic results: about 80% of the time, it hangs up before it even passes the "Given" line of the .feature file, and eventually times out with this message:
Retrying.. HTTPClient::ReceiveTimeoutError: (execution expired)
I have noticed that in these instances, the app is totally non-responsive when I try to interact with it using the mouse. It seems to have frozen up. There's also a UIAlertView that should be appearing, but never does. Note that when I launch the simulator from XCode (the same "-cal" target), it never freezes up. I can interact with it, the UIAlert comes up, everything works fine.
The other 20% of the time, it will make it a little further into my .feature file than that- it will effectively pass the "Given" line, and possibly others, so long as they do not involve interacting with the screen. Any tapping or typing commands will cause it to hang and eventually time out with the same "execution expired" message as above.
After lots of investigating, I have eliminated any possible differentiation between the environment/configuration of this app and my test app, and determined that there must be something about my app that Calabash just really doesn't like! Unfortunately I'm too unfamiliar with Calabash to know where to begin looking. Any help would be appreciated.
Diagnostics as requested by the Calabash team:
> xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
> xcodebuild -version
Xcode 6.1
Build version 6A1052d
> calabash-ios version
0.11.3
> calabash.framework/Resources/version
0.11.3
irb(main):006:0> server_version
{
"app_version" => "0.10",
"outcome" => "SUCCESS",
"app_id" => "<redacted>",
"simulator_device" => "iPhone",
"version" => "0.11.3",
"app_name" => "<redacted>",
"iphone_app_emulated_on_ipad" => false,
"4inch" => true,
"git" => {
"remote_origin" => "[email protected]:calabash/calabash-ios-server.git",
"branch" => "master",
"revision" => "40c6245"
},
"screen_dimensions" => {
"scale" => 2,
"width" => 640,
"sample" => 1,
"height" => 1136
},
"iOS_version" => "8.1",
"system" => "x86_64",
"simulator" => ""
}
Upvotes: 2
Views: 717
Reputation: 2480
There's also a UIAlertView that should be appearing, but never does. Note that when I launch the simulator from XCode (the same "-cal" target), it never freezes up. I can interact with it, the UIAlert comes up, everything works fine.
The other 20% of the time, it will make it a little further into my .feature file than that- it will effectively pass the "Given" line, and possibly others, so long as they do not involve interacting with the screen. Any tapping or typing commands will cause it to hang and eventually time out with the same "execution expired" message as above.
Calabash tries to dismiss privacy alerts automatically. At the moment, there is no way to opt out of this behavior (there is an open issue in run-loop).
I think what is happening is that the UIAlertView is appearing before instruments can take control of your app. A detailed discussion about this topic and solutions can be found on the Managing Privacy Alerts wiki page.
Briefly, you need to delay the appearance of the UIAlertView.
Upvotes: 0
Reputation: 505
have you tried updating calabash to .13? and have you added the CFNetwork framework?
and did you add -force_load "$(SRCROOT)/calabash.framework/calabash" -lstdc++?
sorry with the lack of info, this is all i could come up with? if you have solved the issue. could you close it?
Upvotes: 1
Reputation: 934
Can you launch the simulator successfully using calabash-ios console ?
Try edit and use this to run already build -cal target
DEBUG=1 DEVICE_TARGET='iPhone 5s (7.1 Simulator)' SDK_VERSION=7.1 PLATFORM=iphone cucumber -v --format html --out iphone.html $BASE_PATH/your-app/features/TESTCASE.feature
Upvotes: 0