Class: Capybara::Node::Element
- Inherits:
-
Object
- Object
- Capybara::Node::Element
- Defined in:
- lib/automation_helpers/extensions/capybara/node/element.rb
Overview
Additional useful methods to extend the Capybara::Node::Element class with
Instance Method Summary collapse
-
#horizontal_position ⇒ Integer
The Left-Most pixel’s horizontal position in the DOM (From element.rect).
-
#stale? ⇒ Boolean
Whether the element is in a stale state or not.
-
#vertical_position ⇒ Integer
The Left-Most pixel’s vertical position in the DOM (From element.rect).
Instance Method Details
#horizontal_position ⇒ Integer
The Left-Most pixel’s horizontal position in the DOM (From element.rect)
12 13 14 |
# File 'lib/automation_helpers/extensions/capybara/node/element.rb', line 12 def horizontal_position native.rect.x.to_i end |
#stale? ⇒ Boolean
Whether the element is in a stale state or not
26 27 28 |
# File 'lib/automation_helpers/extensions/capybara/node/element.rb', line 26 def stale? inspect == 'Obsolete #<Capybara::Node::Element>' end |
#vertical_position ⇒ Integer
The Left-Most pixel’s vertical position in the DOM (From element.rect)
19 20 21 |
# File 'lib/automation_helpers/extensions/capybara/node/element.rb', line 19 def vertical_position native.rect.y.to_i end |