Sha256: 91e3eabf30b06490fc256f4a97f2462185cf4abb37f49367dd9e790c9398a223

Contents?: true

Size: 1.91 KB

Versions: 7

Compression:

Stored size: 1.91 KB

Contents

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

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

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

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

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

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

    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

    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

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

    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

    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

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
honeydew-0.20.0 lib/honeydew/device_matchers.rb
honeydew-0.19.0 lib/honeydew/device_matchers.rb
honeydew-0.18.0 lib/honeydew/device_matchers.rb
honeydew-0.17.0 lib/honeydew/device_matchers.rb
honeydew-0.16.0 lib/honeydew/device_matchers.rb
honeydew-0.15.0 lib/honeydew/device_matchers.rb
honeydew-0.14.0 lib/honeydew/device_matchers.rb