【问题标题】:Calabash-ios, can't launch .ipa file when running cucumberCalabash-ios,运行黄瓜时无法启动.ipa文件
【发布时间】:2016-08-14 20:56:22
【问题描述】:

尝试在物理设备上启动 .ipa 文件时遇到困难。

在控制台中,我已经能够启动应用程序并点击不同的按钮等,所以我认为我已经正确设置了所有内容。我还将 .ipa 文件放在我运行黄瓜的目录中。

[**********@calabash-sandbox]$ cucumber
Feature: test Feature

  Scenario: test Scenario            # features/test.feature:3
  Recursively searched these directories to depth 5:

  /Users/********/features

  but could not find any .app for the simulator that links the Calabash iOS server.

  Make sure you have built your app for a simulator target from Xcode.

  If you are testing a stand-alone .app (you don't have an Xcode project), put
  your .app in the same directory (or below) the directory you run `cucumber` from.
   (RunLoop::NoSimulatorAppFoundError)
  ./features/support/01_launch.rb:27:in `Before'
    Given the app has launched       # features/test.feature:4
    And I have done a specific thing # features/test.feature:5
    When I do something              # features/test.feature:6

Heading
=======

    Then something should happen     # features/test.feature:7

Failing Scenarios:
cucumber features/test.feature:3 # Scenario: test Scenario

1 scenario (1 failed)
4 steps (4 undefined)
0m0.171s

我使用的 ipa 文件是独立的,不是通过 xcode 构建的。 app上的calabash框架版本和我的calabash-ios版本是一样的 0.19.0 ,

下面是01_launch.rb,我认为是标准的

require 'calabash-cucumber/launcher'

# You can find examples of more complicated launch hooks in these
# two repositories:
#
# https://github.com/calabash/ios-smoke-test-app/blob/master/CalSmokeApp/features/support/01_launch.rb
# https://github.com/calabash/ios-webview-test-app/blob/master/CalWebViewApp/features/support/01_launch.rb

module Calabash::Launcher
  @@launcher = nil

  def self.launcher
    @@launcher ||= Calabash::Cucumber::Launcher.new
  end

  def self.launcher=(launcher)
    @@launcher = launcher
  end
end

Before do |scenario|
  launcher = Calabash::Launcher.launcher
  options = {
    # Add launch options here.
  }

  launcher.relaunch(options)
  launcher.calabash_notify(self)
end

After do |scenario|
  # Calabash can shutdown the app cleanly by calling the app life cycle methods
  # in the UIApplicationDelegate.  This is really nice for CI environments, but
  # not so good for local development.
  #
  # See the documentation for NO_STOP for a nice debugging workflow
  #
  # http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html#label-NO_STOP
  # http://calabashapi.xamarin.com/ios/Calabash/Cucumber/Core.html#console_attach-instance_method
  unless launcher.calabash_no_stop?
    calabash_exit
  end
end

不用说我是葫芦新手,任何帮助将不胜感激

【问题讨论】:

    标签: ios iphone automation automated-tests calabash-ios


    【解决方案1】:

    要在物理设备上测试 .ipa,您需要先在设备上安装 ipa。

    CalSmokeApp 中有一些示例代码,展示了如何使用ideviceinstaller 在物理设备上安装 .ipa。

    您还应该看到Testing on Physical Devices wiki 页面。

    $ DEVICE_TARGET=<udid> \
        DEVICE_ENDPOINT=http://<ip>:37265 \
        BUNDLE_ID=com.example.MyApp \
        cucumber
    

    【讨论】:

    • 感谢您的回复,.ipa文件已安装在设备上,我已经能够查询不同的页面并点击应用程序上的不同元素。问题是尝试运行黄瓜时文件。
    • 在上面的陈述中,我的意思是带有黄瓜 cmd 的功能文件。我想我可能已经发现了问题,我想知道您是否可以确认我是否朝着正确的方向前进。构建 ipa 时没有正确的签名,将其更改为 ios developer 然后我可以在控制台中启动应用程序并进行查询。修改后的签名直接部署到手机上。我机器上目录中的 ipa 文件不包含正确的签名,因为必须创建一个解决方法来构建具有正确签名的新 .ipa 文件。
    • 抱歉,如果我在描述问题时不够清楚。我们的开发团队告诉我,我们的构建环境总是分配一个特定的签名,并且必须创建一个解决方法,非常感谢
    【解决方案2】:

    都是关于xcode的,确保你已经通过xcode在模拟器上构建,如果模拟器已经显示,然后运行黄瓜

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-07-21
      • 2019-09-19
      相关资源
      最近更新 更多