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)


57
58
59
# File 'lib/honeydew/device_matchers.rb', line 57

def has_app_installed?(package_name)
  installed_packages.include?(package_name)
end

#has_app_installed_in_data?(package_name) ⇒ Boolean

Returns:

  • (Boolean)


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

def has_app_installed_in_data?(package_name)
  packages_in_data.grep(/#{package_name}/).count > 0
end

#has_button?(button_text) ⇒ Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/honeydew/device_matchers.rb', line 32

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

TODO: Look for a better way to express these similar looking matchers

Returns:

  • (Boolean)


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

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_child_count_greater_than?(parent_element_description, child_element_description, child_count) ⇒ Boolean

Returns:

  • (Boolean)


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

def has_child_count_greater_than?(parent_element_description, child_element_description, child_count)
  perform_assertion :is_child_count_greater_than,
    :parent_description => parent_element_description,
     :child_description => child_element_description,
     :child_count => child_count
end

#has_edit_text?(text) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#has_element_with_description?(description) ⇒ Boolean

Returns:

  • (Boolean)


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

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)


51
52
53
54
55
# File 'lib/honeydew/device_matchers.rb', line 51

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)


71
72
73
74
# File 'lib/honeydew/device_matchers.rb', line 71

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

#has_text?(text) ⇒ Boolean

Returns:

  • (Boolean)


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

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

#has_text_disappear?(text) ⇒ Boolean

Returns:

  • (Boolean)


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

def has_text_disappear?(text)
  perform_assertion :is_text_gone, :text => text, :type => 'TextView'
end

#has_textview_text?(text) ⇒ Boolean

Returns:

  • (Boolean)


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

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)


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

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)


66
67
68
69
# File 'lib/honeydew/device_matchers.rb', line 66

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)


61
62
63
64
# File 'lib/honeydew/device_matchers.rb', line 61

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