Calabash 2.0水龙头问题

时间:2015-10-06 13:03:07

标签: calabash calabash-ios

我正在尝试测试混合webView应用程序,并在iPhone 6模拟器上遇到tap方法的问题。 Touch在葫芦黄瓜的同一个应用程序中运行良好。

Xcode:版本7.0.1(7A1001)

操作系统:OSX Yosemite 10.10.5(14F27)

葫芦黄瓜(0.16.4):

irb(main):002:0> query "webView css:'.ion-navicon'"
[
    [0] {
             "center" => {
            "X" => 348.046875,
            "Y" => 53.90625000000001
        },
            "webView" => "<UIWebView: 0x7f8761935e60; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x7f8761921320>>",
           "nodeName" => "BUTTON",
                 "id" => "",
        "textContent" => "\n\t\t\t",
              "class" => "button button-icon button-clear ion-navicon",
               "rect" => {
                   "x" => 348.0469,
              "height" => 42,
                   "y" => 53.90625,
               "width" => 35,
                "left" => 280,
                 "top" => 25,
            "center_y" => 53.90625,
            "center_x" => 348.0469
        },
           "nodeType" => "ELEMENT_NODE"
    }
]

irb(main):004:0> touch "webView css:'.ion-navicon'"
[
    [0] {
             "center" => {
            "X" => 348.046875,
            "Y" => 53.90625000000001
        },
            "webView" => "<UIWebView: 0x7f8761935e60; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x7f8761921320>>",
           "nodeName" => "BUTTON",
                 "id" => "",
        "textContent" => "\n\t\t\t",
              "class" => "button button-icon button-clear ion-navicon",
               "rect" => {
                   "x" => 348.0469,
              "height" => 42,
                   "y" => 53.90625,
               "width" => 35,
                "left" => 280,
                 "top" => 25,
            "center_y" => 53.90625,
            "center_x" => 348.0469
        },
           "nodeType" => "ELEMENT_NODE"
    }
]

这很有效。

Calabash 2.0暂停了一段时间,最终发出错误。

calabash(2.0.0.pre4):

irb(main):030:0> query "webView css:'.ion-navicon'"
Getting: http://127.0.0.1:37265/map {}
[
    [0] {
             "center" => {
            "X" => 348.046875,
            "Y" => 53.90625000000001
        },
            "webView" => "<UIWebView: 0x7f8310705f10; frame = (0 0; 320 568); autoresize = W+H; layer = <CALayer: 0x7f83107303e0>>",
           "nodeName" => "BUTTON",
                 "id" => "",
        "textContent" => "\n\t\t\t",
              "class" => "button button-icon button-clear ion-navicon",
               "rect" => {
                   "x" => 348.0469,
              "height" => 42,
                   "y" => 53.90625,
               "width" => 35,
                "left" => 280,
                 "top" => 25,
            "center_y" => 53.90625,
            "center_x" => 348.0469
        },
           "nodeType" => "ELEMENT_NODE"
    }
]

irb(main):027:0> tap "webView css:'.ion-navicon'"
Getting: http://127.0.0.1:37265/map {}
Getting: http://127.0.0.1:37265/uia {}
RuntimeError: Expected '' to be an array.
  from /Users/szoradm/.rvm/gems/ruby-2.0.0-p643/gems/calabash-2.0.0.pre4/lib/calabash/ios/device/routes/uia_route_mixin.rb:138:in `expect_uia_results_is_array'
  from /Users/szoradm/.rvm/gems/ruby-2.0.0-p643/gems/calabash-2.0.0.pre4/lib/calabash/ios/device/routes/uia_route_mixin.rb:115:in `handle_uia_results'
  from /Users/szoradm/.rvm/gems/ruby-2.0.0-p643/gems/calabash-2.0.0.pre4/lib/calabash/ios/device/routes/uia_route_mixin.rb:105:in `uia_over_http'
  from /Users/szoradm/.rvm/gems/ruby-2.0.0-p643/gems/calabash-2.0.0.pre4/lib/calabash/ios/device/routes/uia_route_mixin.rb:43:in `uia_route'
  from /Users/szoradm/.rvm/gems/ruby-2.0.0-p643/gems/calabash-2.0.0.pre4/lib/calabash/ios/device/routes/uia_route_mixin.rb:56:in `uia_serialize_and_call'
  from /Users/szoradm/.rvm/gems/ruby-2.0.0-p643/gems/calabash-2.0.0.pre4/lib/calabash/ios/device/gestures_mixin.rb:107:in `_tap'
  from /Users/szoradm/.rvm/gems/ruby-2.0.0-p643/gems/calabash-2.0.0.pre4/lib/calabash/device.rb:145:in `tap'
  from /Users/szoradm/.rvm/gems/ruby-2.0.0-p643/gems/calabash-2.0.0.pre4/lib/calabash/gestures.rb:50:in `tap'
  from (irb):27
  from /Users/szoradm/.rvm/rubies/ruby-2.0.0-p643/bin/irb:12:in `<main>'

有什么建议吗?

1 个答案:

答案 0 :(得分:-1)

看起来像个错误:

2.0.0.pre4/lib/calabash/ios/device/routes/uia_route_mixin.rb:138:
in `expect_uia_results_is_array'

服务器返回一些意外的输出。你能创造一个问题吗?

在报告中,请注意Calabash iOS Server版本。感谢。

https://github.com/calabash/calabash