Skip to content

Commit

Permalink
Renamed touch_when_element_exists to tap_when_element_exists
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasRoikjer committed Jun 13, 2014
1 parent 3f43f28 commit a777575
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions ruby-gem/lib/calabash-android/operations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def keyboard_enter_text(text, options = {})
end

def enter_text(uiquery, text, options = {})
touch_when_element_exists(uiquery, options)
tap_when_element_exists(uiquery, options)
sleep 0.5
keyboard_enter_text(text, options)
end
Expand Down Expand Up @@ -823,7 +823,7 @@ def press_menu_button

def select_options_menu_item(text, options={})
press_menu_button
touch_when_element_exists("DropDownListView * marked:'#{text}'", options)
tap_when_element_exists("DropDownListView * marked:'#{text}'", options)
end

def select_context_menu_item(view_uiquery, menu_item_query_string)
Expand All @@ -836,7 +836,7 @@ def select_context_menu_item(view_uiquery, menu_item_query_string)
touch(combined_query_string)
end

def touch_when_element_exists(uiquery, options={})
def tap_when_element_exists(uiquery, options={})
when_element_exists(uiquery, options)
end

Expand Down
2 changes: 1 addition & 1 deletion ruby-gem/lib/calabash-android/steps/check_box_steps.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Then /^I toggle checkbox number (\d+)$/ do |index|
touch_when_element_exists("android.widget.CheckBox index:#{index.to_i-1}")
tap_when_element_exists("android.widget.CheckBox index:#{index.to_i-1}")
end
4 changes: 2 additions & 2 deletions ruby-gem/lib/calabash-android/steps/context_menu_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

touch_index = index.to_i - 1

touch_when_element_exists("com.android.internal.view.menu.ListMenuItemView android.widget.TextView index:#{touch_index}")
tap_when_element_exists("com.android.internal.view.menu.ListMenuItemView android.widget.TextView index:#{touch_index}")
end

Then /^I long press "([^\"]*)" and select "([^\"]*)"$/ do |text_to_press, context_text|
puts 'Warning: This predefined step is deprecated. Implement a new, less vague step.'

long_press_when_element_exists("* {text CONTAINS '#{text_to_press}'}")
touch_when_element_exists("com.android.internal.view.menu.ListMenuItemView android.widget.TextView marked:'#{context_text}'")
tap_when_element_exists("com.android.internal.view.menu.ListMenuItemView android.widget.TextView marked:'#{context_text}'")
end

Then /^I long press "([^\"]*)"$/ do |text_to_press|
Expand Down
14 changes: 7 additions & 7 deletions ruby-gem/lib/calabash-android/steps/press_button_steps.rb
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
Given /^I press the "([^\"]*)" button$/ do |button_text|
touch_when_element_exists("android.widget.Button {text CONTAINS[c] '#{button_text}'}")
tap_when_element_exists("android.widget.Button {text CONTAINS[c] '#{button_text}'}")
end

Then /^I press button number (\d+)$/ do |button_number|
touch_when_element_exists("android.widget.Button index:#{button_number.to_i-1}")
tap_when_element_exists("android.widget.Button index:#{button_number.to_i-1}")
end

Then /^I press image button number (\d+)$/ do |button_number|
touch_when_element_exists("android.widget.ImageButton index:#{button_number.to_i-1}")
tap_when_element_exists("android.widget.ImageButton index:#{button_number.to_i-1}")
end

Then /^I press view with id "([^\"]*)"$/ do |view_id|
touch_when_element_exists("* id:'#{view_id}'")
tap_when_element_exists("* id:'#{view_id}'")
end

Then /^I press "([^\"]*)"$/ do |identifier|
touch_when_element_exists("* marked:'#{identifier}'")
tap_when_element_exists("* marked:'#{identifier}'")
end

Then /^I click on screen (\d+)% from the left and (\d+)% from the top$/ do |x, y|
perform_action('click_on_screen',x, y)
end

Then /^I touch the "([^\"]*)" text$/ do |text|
touch_when_element_exists("* {text LIKE[c] '#{text}'}")
tap_when_element_exists("* {text LIKE[c] '#{text}'}")
end

Then /^I press list item number (\d+)$/ do |line_index|
puts 'Warning: This predefined step is deprecated. Implement a new, less vague step.'

touch_when_element_exists("android.widget.ListView index:0 android.widget.TextView index:#{line_index.to_i-1}")
tap_when_element_exists("android.widget.ListView index:0 android.widget.TextView index:#{line_index.to_i-1}")
end

Then /^I long press list item number (\d+)$/ do |line_index|
Expand Down
4 changes: 2 additions & 2 deletions ruby-gem/lib/calabash-android/steps/spinner_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
spinner = query("android.widget.Spinner marked:'#{spinner_identifier}'")

if spinner.empty?
touch_when_element_exists("android.widget.Spinner * marked:'#{spinner_identifier}'")
tap_when_element_exists("android.widget.Spinner * marked:'#{spinner_identifier}'")
else
touch(spinner)
end

touch_when_element_exists("android.widget.PopupWindow$PopupViewContainer * marked:'#{item_text}'")
tap_when_element_exists("android.widget.PopupWindow$PopupViewContainer * marked:'#{item_text}'")
end

0 comments on commit a777575

Please sign in to comment.