Class: Capybara::Email::Node

Inherits:
Driver::Node
  • Object
show all
Defined in:
lib/capybara/email/node.rb

Instance Method Summary collapse

Instance Method Details

#[](name) ⇒ Object


6
7
8
# File 'lib/capybara/email/node.rb', line 6

def [](name)
  string_node[name]
end

#all_textObject


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

def all_text
  Capybara::Helpers.normalize_whitespace(text)
end

#clickObject


22
23
24
# File 'lib/capybara/email/node.rb', line 22

def click
  driver.follow(self[:href].to_s)
end

#find(locator) ⇒ Object Also known as: find_xpath


34
35
36
# File 'lib/capybara/email/node.rb', line 34

def find(locator)
  native.xpath(locator).map { |node| self.class.new(driver, node) }
end

#tag_nameObject


26
27
28
# File 'lib/capybara/email/node.rb', line 26

def tag_name
  native.node_name
end

#textObject


2
3
4
# File 'lib/capybara/email/node.rb', line 2

def text
  native.text
end

#valueObject


10
11
12
# File 'lib/capybara/email/node.rb', line 10

def value
  string_node.value
end

#visible?Boolean

Returns:

  • (Boolean)

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

def visible?
  string_node.visible?
end

#visible_textObject


14
15
16
# File 'lib/capybara/email/node.rb', line 14

def visible_text
  Capybara::Helpers.normalize_whitespace(unnormalized_text)
end