Calabash-android pre-defined steps, calabashandroid

Source: Internet
Author: User

Calabash-android pre-defined steps, calabashandroid

The canned_steps.md In the Calabash-android directory lists a series of predefined steps, which are defined in the calabash-android \ steps \ directory. This article describes the steps and usage.

1. asserted steps: defined in assert_steps.rb

The assertions see the text:

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

Example:

 Feature: Hello word  Scenario: See hello word   The I see the text "Hello world"
No text is displayed for the assertion:

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

2. Input steps: defined in

Click the check box

Then /^I toggle checkbox number (\d+)$/ do |index|
Example:
# Click the first checkboxThen I togle checkbox number 1

Context_menu_steps:

Then/^ I long press "([^ \"] *) "$/do | text | example: then I long press "Stop" long press its attribute text = "Stop" View

3. Button

Click the return button:

Then I go back
Click Menu

Then I press the menu key
Enter entey on the keyboard

Then I press the enter button

4. gestures

Move to left

Then I swipe left
Slide to the right

Then I swipe right

Slide up and down for list controls

Then I scroll downThen I scroll up

Select menu_item from menu

# Select quitThen I select "quit" from menu

Drag from one point to another

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





Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.