2

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" => "git@github.com: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" => ""
}
todd412
  • 1,308
  • 2
  • 17
  • 24
  • Take a spindump focused on your app's process to see what its threads are up to. – Jeremy Huddleston Sequoia Oct 29 '14 at 01:47
  • Need more details on what is the code line you use to run the tests ? Do you build the app using build command ? or use the build from xcode ? Do you have several simulators if so Do you select a one ? Do your app name contains spaces in the middle ? – Chathura Palihakkara Oct 29 '14 at 18:16
  • 1
    I know this post is old, but, if your application is logging to much in xcode console then it will freeze. This is a bug introduced by Apple. You can read something about this here: [google groups](https://groups.google.com/forum/#!searchin/calabash-ios/sofia/calabash-ios/20UjTqsH-k0/nNAdQt8rYLkJ). – Sophy Swicz Jan 20 '15 at 20:22

3 Answers3

1

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?

s5v
  • 495
  • 5
  • 20
0

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
  • The SDK_VERSION variable is deprecated since Xcode 5.1. http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html#Deprecated_Variables – jmoody May 01 '15 at 13:18
  • And this use of PLATFORM is non-standard. Usually, the PLATFORM variable is used in cross-platform testing and can be `ios` or `android`. – jmoody May 01 '15 at 13:25
0

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.

Community
  • 1
  • 1
jmoody
  • 2,480
  • 1
  • 16
  • 22