我正在运行一个android calabash测试。我在屏幕上有两个选项卡,当我尝试执行perform_action('swipe','right')屏幕的一小部分滑动时,可以在这两个选项卡之间切换,并且它可以返回到之前的状态,而无需切换到新的选项卡。我什至尝试了perform_action('drag',86,306,143,143,10)但没有反应。当我打印查询时,得到下面给出的响应。在这里,我想在聊天和联系人之间切换。
{
"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
}
下面的代码就足够了。不需要使用perform_action方法。Then /^I pan right $/ do pan_right() end
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句