Calabash android 滑动不工作

Calabash android swipe not working

我是运行一个android葫芦测试。我的屏幕上有两个选项卡,当我尝试 perform_action('swipe', 'right') 的一小部分时,可以在这两个选项卡之间切换屏幕滑动并返回到以前的状态而不切换到新选项卡。我什至尝试了 perform_action('drag', 86, 306, 143, 143, 10) 但没有得到任何回应。 当我打印查询时得到下面给出的响应。在这里我想在 chatscontacts.

之间切换
{  
  "id"      =>nil,
  "enabled"      =>true,
  "contentDescription"      =>nil,
  "text"      =>"Chats",
  "visible"      =>true,
  "tag"      =>nil,
  "description"      =>"android.support.v7.widget.AppCompatTextView@42569e98",
  "class"      =>"android.support.v7.widget.AppCompatTextView",
  "rect"      =>      {  
     "center_y"         =>157,
     "center_x"         =>119,
     "height"         =>29,
     "y"         =>143,
     "width"         =>67,
     "x"         =>86
  }
},
{  
  "id"      =>nil,
  "enabled"      =>true,
  "contentDescription"      =>nil,
  "visible"      =>true,
  "tag"      =>nil,
  "description"      =>"android.support.design.widget.TabLayout$TabView@4256b740",
  "class"      =>"android.support.design.widget.TabLayout$TabView",
  "rect"      =>      {  
     "center_y"         =>158,
     "center_x"         =>360,
     "height"         =>72,
     "y"         =>122,
     "width"         =>240,
     "x"         =>240
  }
},
{  
  "id"      =>nil,
  "enabled"      =>true,
  "contentDescription"      =>nil,
  "text"      =>"Contacts",
  "visible"      =>true,
  "tag"      =>nil,
  "description"      =>"android.support.v7.widget.AppCompatTextView@4256c690",
  "class"      =>"android.support.v7.widget.AppCompatTextView",
  "rect"      =>      {  
     "center_y"         =>157,
     "center_x"         =>359,
     "height"         =>29,
     "y"         =>143,
     "width"         =>107,
     "x"         =>306
  }

那些是非常古老且已弃用的操作。我建议只使用 pan_left 或类似的。您可以为这些方法指定百分比坐标

下面的代码是enough.no需要用到perform_action方法。 Then /^I pan right $/ do pan_right() end