Calabash-android 預定義steps,calabashandroid

來源:互聯網
上載者:User

Calabash-android 預定義steps,calabashandroid

Calabash-android目錄下的canned_steps.md中列出了一系列預定義的steps,這些steps的定義位於calabash-android\steps\目錄下。本文將介紹這些steps和用法。

1.斷言steps:定義在assert_steps.rb中

斷言看到了文本:

Then /^I see the text "([^\"]*)"$/Then /^I see "([^\"]*)"$/Then /^I should see "([^\"]*)"$/Then /^I should see text containing "([^\"]*)"$/

例:

 Feature: Hello word  Scenario: See hello word   The I see the text "Hello world"
斷言沒看到文本:

Then /^I should not see "([^\"]*)"$/Then /^I don't see the text "([^\"]*)"$/Then /^I don't see "([^\"]*)"$/  

2.輸入steps:定義在

點擊複選框

Then /^I toggle checkbox number (\d+)$/ do |index|
例:
#點擊第一個checkboxThen I togle checkbox number 1

context_menu_steps:

Then /^I long press "([^\"]*)"$/ do |text|例:Then I long press "Stop"長按其屬性text="Stop"的View

3.按鈕

點擊返回按鈕:

Then I go back
點擊Menu

Then I press the menu key
類比使用者在鍵盤上輸入entey

Then I press the enter button

4.手勢

往左滑動

Then I swipe left
往右側滑動

Then I swipe right

上下滑動,用於list控制項

Then I scroll downThen I scroll up

從menu中選擇menu_item

#從menu中選擇quitThen I select "quit" from menu

從一點拖動到另一點

Then /^I drag from (\d+):(\d+) to (\d+):(\d+) moving with (\d+) steps$/ do |from_x, from_y, to_x, to_y, steps|





聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.