Class: SK::Clickable
Instance Attribute Summary
Attributes inherited from Element
Instance Method Summary collapse
- #click(delay = @delay) ⇒ Object
-
#initialize(locator, delay: 0) ⇒ Clickable
constructor
a clickable element can be created with a custom delay so that the tester does not have to set the delay at every calling point…
Methods inherited from Element
#children, #displayed?, #enabled?, #exists?, #find, #find_child_el, #html, #parent_el, #search, #text, #to_s
Constructor Details
#initialize(locator, delay: 0) ⇒ Clickable
a clickable element can be created with a custom delay so that the tester does not have to set the delay at every calling point… just once at the creation oint
7 8 9 10 |
# File 'lib/clickable.rb', line 7 def initialize(locator,delay: 0) super(locator) # creates the el and locator @delay = delay end |
Instance Method Details
#click(delay = @delay) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/clickable.rb', line 12 def click(delay = @delay) if self.el # SK::Trace.trace "SK::Clickable.click #{self.locator} #{self.el}" self.el.click sleep delay else SK::Trace.error "SK::Clickable.click: element not initialized for #{locator}" end end |