Class: Capybara::Node::Element

Inherits:
Base
  • Object
show all
Defined in:
lib/capybara/core_ext/node/element.rb

Overview

Capybara::Node::Element namespace

Instance Method Summary collapse

Instance Method Details

#locationSelenium::WebDriver::Point

Returns the element absolute location on the page

Returns:

  • (Selenium::WebDriver::Point)


24
25
26
# File 'lib/capybara/core_ext/node/element.rb', line 24

def location
  synchronize { base.location }
end

#on_screen?(fully: false) ⇒ Boolean

Validates if the element on the displayed part of the page (screen!)

Returns:

  • (Boolean)


18
19
20
# File 'lib/capybara/core_ext/node/element.rb', line 18

def on_screen?(fully: false)
  synchronize { base.on_screen?(fully) }
end

#scroll_into_view!Capybara::Node::Element

Scrolls an element into view and return the element to allow method chaining



11
12
13
14
# File 'lib/capybara/core_ext/node/element.rb', line 11

def scroll_into_view!
  synchronize { base.scroll_into_view! }
  self
end

#sizeSelenium::WebDriver::Dimension

Returns the size of this element

Returns:

  • (Selenium::WebDriver::Dimension)


30
31
32
# File 'lib/capybara/core_ext/node/element.rb', line 30

def size
  synchronize { base.size }
end