首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Calabash 2.0 tap问题

Calabash 2.0 tap问题
EN

Stack Overflow用户
提问于 2015-10-06 21:03:07
回答 1查看 99关注 0票数 0

我正在尝试测试一个混合webView应用程序,但在iPhone 6模拟器上使用tap方法时遇到了问题。Touch在与calabash-cucumber相同的应用程序中运行良好。

Xcode:版本7.0.1 (7A1001)

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

葫芦-黄瓜(0.16.4):

代码语言:javascript
复制
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在tap上挂起了一段时间,最终显示出一个错误。

calabash (2.0.0.pre4):

代码语言:javascript
复制
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>'

有什么建议吗?

EN

回答 1

Stack Overflow用户

发布于 2015-10-07 17:28:55

看起来像是个bug:

代码语言:javascript
复制
2.0.0.pre4/lib/calabash/ios/device/routes/uia_route_mixin.rb:138:
in `expect_uia_results_is_array'

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

在报告中,请注意Calabash iOS服务器版本。谢谢。

https://github.com/calabash/calabash

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32970715

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档