[英]Scrolling in calabash-android
我正在嘗試在calabash-android中向下滾動,但無法。 這是我用於滾動部分的代碼
在功能文件中:
Then I scrolldown until I see "Engine Light On"
在calabash_steps.rb中:
Then /^I scroll until I see the "([^\\"]*)" text$/ do |text| q = query("TextView text:'#{text}'") while q.empty? scroll_down q = query("TextView text:'#{text}'") end end
我得到的錯誤:
我們可以在calasbash_steps.rb文件中使用以下代碼。
Then(/^I scroll view "([^"]*)" "([^"]*)"$/) do |view,direction|
scroll("#{view}",:"#{direction}")
end
在.feature文件中,我們可以按照您想要滾動的方式傳遞視圖和方向,這里是一個示例:
Then I scroll view "ExpandableListView" "down"
Then I scroll view "ExpandableListView" "up"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.