简体   繁体   English

在iOS上执行Calabash测试时出现“无法自动检测APP_BUNDLE_PATH”错误

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

I'm new to the Calabash iOS automated testing. 我是Calabash iOS自动化测试的新手。 I have installed “Xcode 4.2”, “Ruby version 2.0.0p643” and “calabash-cucumber gem” on Snow Leopard (version 10.6.8) 我已经在Snow Leopard(版本10.6.8)上安装了“ Xcode 4.2”,“ Ruby版本2.0.0p643”和“ calabash-cucumber gem”

I ran the command “calabash-ios setup” and created a target (test-cal target) for my test iOS project. 我运行了命令“ calabash-ios setup”,并为我的测试iOS项目创建了一个目标(test-cal目标)。 With this command, CFNetwork.framework and calabash.framework are added to the test-cal target. 使用此命令,CFNetwork.framework和calabash.framework被添加到test-cal目标。

After that, I ran “calabash-ios gen” in terminal and created a subdirectory called features and manually added features subdirectory to test-cal target. 之后,我在终端中运行“ calabash-ios gen” ,并创建了一个名为features的子目录,并手动将features子目录添加到test-cal目标。

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. 我在features文件夹下的“ sample.feature”文件中编写了一个测试脚本,然后在终端中执行了cucumber命令来测试该脚本。

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. 对于解决此问题的任何建议/想法,我将不胜感激。

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). 对于初学者,请确保至少使用OSX Yosemite或更高版本,Xcode 6或更高版本(最好> = 7),并且请确保您拥有最新的葫芦黄瓜(在撰写本文时为0.17.0)。 You can verify this by running 您可以通过运行来验证

calabash-ios version

Secondly, from where are you running the cucumber command? 其次,您在哪里运行cucumber命令? 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 . 如果要尝试从xcode项目在模拟器上运行测试,则需要与<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的文件夹)上运行测试,则可以改为运行:

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

(you can find the uuids of your simulators by running instruments -w devices ) (您可以通过运行instruments -w devices找到模拟器的uuid)

For what it's worth, I'd also recommend checking out the calabash-sandbox for a simplified ruby setup. 对于它的价值,我还建议您检查一下葫芦沙盒 ,以简化红宝石设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 “确保在测试套件运行过程中将APP_BUNDLE_PATH设置为此模拟器版本支持的版本”错误 - “Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator version” error in the middle of test suite run 使用Calabash测试应用关闭 - Test for app closing with Calabash calabash-ios物理设备测试,应用程序启动但崩溃 - calabash-ios physical device test, app starts but crashes calabash-ios:运行自动化时,该应用程序挂起 - calabash-ios: The app hangs when running automation Calabash iOS Cal应用程序在运行黄瓜时显示空白 - Calabash iOS cal app showing up blank when Running Cucumber 当我的应用程序在ios中处于后台时,有没有办法检测正在运行的应用程序? - Is there a way to detect the running app, while my app is in the background in ios? 执行Calabash iOS测试Xamarin测试云时出错 - Error executing Calabash iOS tests Xamarin Test Cloud 如何检测在 iOS 上的 Firebase 测试实验室中运行的应用程序? - How to detect app running in Firebase Test Lab on iOS? Wikitude错误-“在App资源包中找不到ARchitect世界路径” - Wikitude Error - “Unable to find ARchitect World path in App resouce bundle” 使用Calabash iOS运行多个设备 - Running multiple devices with calabash ios
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM