Class: Capybara::Driver::FireWatir::Node

Inherits:
Struct
  • Object
show all
Defined in:
lib/capybara/driver/firewatir_driver.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



5
6
7
# File 'lib/capybara/driver/firewatir_driver.rb', line 5

def node
  @node
end

Instance Method Details

#attribute(name) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/capybara/driver/firewatir_driver.rb', line 10

def attribute(name)
  value = if name.to_sym == :class
    node.class_name
  else
    node.send(name.to_sym)
  end
  return value if value and not value.empty?
end

#clickObject



19
20
21
# File 'lib/capybara/driver/firewatir_driver.rb', line 19

def click
  node.click
end

#tag_nameObject



23
24
25
26
27
# File 'lib/capybara/driver/firewatir_driver.rb', line 23

def tag_name
  # FIXME: this might be the dumbest way ever of getting the tag name
  # there has to be something better...
  node.to_xml[/^\s*<([a-z0-9\-\:]+)/, 1]
end

#textObject



6
7
8
# File 'lib/capybara/driver/firewatir_driver.rb', line 6

def text
  node.text
end