Naresh
Naresh

Reputation: 443

“Unable to auto detect APP_BUNDLE_PATH” error while running the Calabash test on iOS

I’m new to the Calabash iOS automated testing. I have installed “Xcode 4.2”, “Ruby version 2.0.0p643” and “calabash-cucumber gem” on Snow Leopard (version 10.6.8)

I ran the command “calabash-ios setup” and created a target (test-cal target) for my test iOS project. With this command, CFNetwork.framework and calabash.framework are added to the test-cal target.

After that, I ran “calabash-ios gen” in terminal and created a subdirectory called features and manually added features subdirectory to test-cal target.

I wrote a test script in “sample.feature” file under the features folder and then executed the cucumber command in terminal to test the script.

After running the command it is giving me following error:

Scenario: Sample test                          # features/sample.feature:3

 Unable to auto detect APP_BUNDLE_PATH.
  Have you built your app for simulator?

Searched dir: /Users/octaneconference/Library/Developer/Xcode/DerivedData/Test-frkimcejhwemmaaapwknwfwvhnmb

Please build your app from Xcode

You should build the -cal target.

  Alternatively, specify APP_BUNDLE_PATH in features/support/01_launch.rb
  This should point to the location of your built app linked with calabash.
   (RuntimeError)

  ./features/support/01_launch.rb:29:in `Before'
    Given the app has launched                   # features/steps/sample_steps.rb:1
    And then the Sound Enable screen will appear # features/sample.feature:5
    When click on "NO" button                    # features/sample.feature:6
    Then Menu screen will appear in the screen   # features/sample.feature:7
    Then take a picture                          # features/sample.feature:8

Failing Scenarios:

cucumber features/sample.feature:3 # Scenario: Sample test

1 scenario (1 failed)
5 steps (1 skipped, 4 undefined)
0m0.965s

You can implement step definitions for undefined steps with these snippets:

Given(/^then the Sound Enable screen will appear$/)
do

pending # Write code here that turns the phrase above into concrete actions
end

When(/^click on "([^"]*)" button$/) do |arg1|

  pending # Write code here that turns the phrase above into concrete actions
end

Then(/^Menu screen will appear in the screen$/) 

do
  pending # Write code here that turns the phrase above into concrete actions

end

Then(/^take a picture$/) do

pending # Write code here that turns the phrase above into concrete actions

end     

I’d appreciate any suggestions/thoughts regarding fixing this issue.

Upvotes: 0

Views: 243

Answers (1)

Christopher Fuentes
Christopher Fuentes

Reputation: 311

For starters, please ensure that you are using at least OSX Yosemite or later, Xcode 6 or later (preferably >= 7), and please ensure you have the latest calabash-cucumber gem (at the time of writing, 0.17.0). You can verify this by running

calabash-ios version

Secondly, from where are you running the cucumber command? If you are trying to get a test to run on a simulator from an xcode project, you'll need to be in the same directory as <app_name>.xcodeproj . As the error message suggests, you'll also need to make sure you've actually built the project for the simulator prior to running.

If you are trying to run the test on a simulator app bundle (a folder with a .app extension), then you can instead run:

APP_BUNDLE_PATH=/path/to/appname.app DEVICE_TARGET="<UUID>" cucumber

(you can find the uuids of your simulators by running instruments -w devices )

For what it's worth, I'd also recommend checking out the calabash-sandbox for a simplified ruby setup.

Upvotes: 2

Related Questions