如何使用葫芦在iOS分页视图上在页面之间滑动 [英] how to swipe from page to page on an iOS pagination view using calabash

查看:66
本文介绍了如何使用葫芦在iOS分页视图上在页面之间滑动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法向左滑动才能在视图之间切换.因此我现在尝试使用屏幕底部的分页点来更改视图.

I could not get swipe left to work to go from view to view. so I am now trying to use the pagination dot at the bottom of the screen to change the view.

有人可以告诉我如何使用葫芦触摸点'n'吗?

Can someone please tell me how i can touch dot 'n' using calabash?

我将返回到代码,并尝试查看是否可以将可访问性标签设置为该点.但是,如果有某种方式可以使全世界的某个人已经解决了这个问题,那么它会很乐意.

I am going to go back to the code and try to see if I can set a accessibility label to the dot. But would love it if there was some way that someone out there in the wide world has already solved this.

我使用了以下代码:

Then /^I swipe left on the cell with name "([^\"]*)"$/ do |arg|
swipe :left, :query => "view marked:'#{arg}'",force: :strongs
end

此通过,但实际上并未滑动.

THIS passes, but it does not actually swipe.

根据我的发现,该点是绘制的,不是对象,但我可能会误会.所以我不能给它贴上标签. 我仍在尝试使用滑动来更改页面-

from what i noticed, the dot was drawn and is not an object, but i could be mistaken. so i could not give it a label. i am still trying to use swipe to change the page-

swipe :left, :query => "view marked:'#{arg}'", :offset => {:x => 0, :y => 0}, :"swipe-delta" => {:horizontal => {:dx=> 1000, :dy=>0} },force: :strong

推荐答案

感谢您误入歧途,为您提供帮助和指导. 对我有用的解决方案是:

thank you astray for your help and guidance. the solution that worked for me was this:

Then I swipe to the right

的定义:

Then /^I swipe to the (left|right|up|down)$/ do |direction|
scroll("scrollView marked:'SCROLL VIEW'", direction)
sleep(STEP_PAUSE) # optional
end 

我将使这一过程更加动态,但我想我最好在这里发布答案并结束问题. 另外,我也想说,尽管我们向左滑动",但由于我们必须移至右侧的页面或对象,因此我们必须向右滑动才能移至右侧的对象.

I will be making this more dynamic, but thought i might as well post the answer here and close the question. also, i would also like to say that though we are 'swiping' left, as we have to move to the page or object on the right, we have to swipe right to move to the object on the right.

这篇关于如何使用葫芦在iOS分页视图上在页面之间滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆