Module: Honeydew::DeviceMatchers

Included in:
Device
Defined in:
lib/honeydew/device_matchers.rb

Instance Method Summary collapse

Instance Method Details

#has_app_installed?(package_name) ⇒ Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/honeydew/device_matchers.rb', line 40

def has_app_installed?(package_name)
  adb('shell pm list packages').include?(package_name)
end

#has_button?(button_text) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/honeydew/device_matchers.rb', line 23

def has_button?(button_text)
  perform_assertion :is_button_present, :text => button_text
end

#has_child_count?(parent_element_description, child_element_description, child_count) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
30
31
32
# File 'lib/honeydew/device_matchers.rb', line 27

def has_child_count?(parent_element_description, child_element_description, child_count)
  perform_assertion :is_child_count_equal_to,
    :parent_description => parent_element_description,
     :child_description => child_element_description,
     :child_count => child_count
end

#has_edit_text?(text) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/honeydew/device_matchers.rb', line 11

def has_edit_text?(text)
  perform_assertion :is_text_present, :text => text, :type => 'EditText'
end

#has_element_with_description?(description) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/honeydew/device_matchers.rb', line 7

def has_element_with_description?(description)
  perform_assertion :is_text_present, :description => description
end

#has_element_with_nested_text?(parent_description, child_text) ⇒ Boolean

Returns:

  • (Boolean)


34
35
36
37
38
# File 'lib/honeydew/device_matchers.rb', line 34

def has_element_with_nested_text?(parent_description, child_text)
  perform_assertion :is_element_with_nested_text_present,
    :parent_description => parent_description,
     :child_text => child_text
end

#has_settings_menu_item?(item_name) ⇒ Boolean

Returns:

  • (Boolean)


54
55
56
57
# File 'lib/honeydew/device_matchers.rb', line 54

def has_settings_menu_item?(item_name)
  perform_assertion :has_settings_menu_item,
    :menuName => item_name
end

#has_text?(text) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
# File 'lib/honeydew/device_matchers.rb', line 3

def has_text?(text)
  perform_assertion :is_text_present, :text => text
end

#has_textview_text?(text) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/honeydew/device_matchers.rb', line 15

def has_textview_text?(text)
  perform_assertion :is_text_present, :text => text, :type => 'TextView'
end

#has_textview_with_text_and_description?(text, description) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/honeydew/device_matchers.rb', line 19

def has_textview_with_text_and_description?(text, description)
  perform_assertion :is_text_present, :text => text, :description => description, :type => 'TextView'
end

#is_option_in_setting_disabled?(item_name, option_names) ⇒ Boolean

Returns:

  • (Boolean)


49
50
51
52
# File 'lib/honeydew/device_matchers.rb', line 49

def is_option_in_setting_disabled?(item_name, option_names)
  perform_assertion :is_option_in_settings_menu_disabled,
    :menuName => item_name, :optionNames => option_names
end

#is_option_in_setting_enabled?(item_name, option_names) ⇒ Boolean

Returns:

  • (Boolean)


44
45
46
47
# File 'lib/honeydew/device_matchers.rb', line 44

def is_option_in_setting_enabled?(item_name, option_names)
  perform_assertion :is_option_in_settings_menu_enabled,
    :menuName => item_name, :optionNames => option_names
end