0

I'm trying to test a hybrid webView application and having an issue with the tap method on an iPhone 6 simulator. Touch works fine in the same app with calabash-cucumber.

Xcode: Version 7.0.1 (7A1001)

OS: OSX Yosemite 10.10.5 (14F27)

calabash-cucumber (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"
    }
]

That works great.

Calabash 2.0 hangs for a while on tap, and eventually spits out an error.

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>'

Any suggestions?

tuggles
  • 21
  • 4

1 Answers1

-1

Looks like a bug:

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

The server is returning some unexpected output. Can you create an issue?

In the report, please note the Calabash iOS Server version. Thanks.

https://github.com/calabash/calabash

jmoody
  • 2,480
  • 1
  • 16
  • 22