Class: Furter::Accessors::Switch

Inherits:
View
  • Object
show all
Includes:
Furter
Defined in:
lib/furter/accessors/switch.rb

Constant Summary

Constants included from Furter

TIMEOUT, VERSION

Instance Method Summary collapse

Methods included from Furter

#exists?, #has_text?, included, #wait_for, #wait_for_and_touch, #wait_for_text

Methods inherited from View

#click, #enabled?, #initialize, #next_responders, #visible?

Constructor Details

This class inherits a constructor from Furter::Accessors::View

Instance Method Details

#on?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/furter/accessors/switch.rb', line 6

def on?
  frankly_map(selector, 'isOn')[0]
end

#set(on_or_off) ⇒ Object



10
11
12
# File 'lib/furter/accessors/switch.rb', line 10

def set(on_or_off)
  click if on_or_off != on?
end