Class: Capybara::Driver::Node

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

Direct Known Subclasses

RackTest::Node, Selenium::Node

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver, native) ⇒ Node

Returns a new instance of Node



8
9
10
11
# File 'lib/capybara/driver/node.rb', line 8

def initialize(driver, native)
  @driver = driver
  @native = native
end

Instance Attribute Details

#driverObject (readonly)

Returns the value of attribute driver



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

def driver
  @driver
end

#nativeObject (readonly)

Returns the value of attribute native



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

def native
  @native
end

Instance Method Details

#==(other) ⇒ Object



109
110
111
# File 'lib/capybara/driver/node.rb', line 109

def ==(other)
  raise NotSupportedByDriverError, 'Capybara::Driver::Node#=='
end

#[](name) ⇒ Object

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/capybara/driver/node.rb', line 21

def [](name)
  raise NotImplementedError
end

#all_textObject

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/capybara/driver/node.rb', line 13

def all_text
  raise NotImplementedError
end

#checked?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


75
76
77
# File 'lib/capybara/driver/node.rb', line 75

def checked?
  raise NotImplementedError
end

#click(keys = [], options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


43
44
45
# File 'lib/capybara/driver/node.rb', line 43

def click(keys = [], options = {})
  raise NotImplementedError
end

#disabled?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


83
84
85
# File 'lib/capybara/driver/node.rb', line 83

def disabled?
  raise NotImplementedError
end

#double_click(keys = [], options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


51
52
53
# File 'lib/capybara/driver/node.rb', line 51

def double_click(keys = [], options = {})
  raise NotImplementedError
end

#drag_to(element) ⇒ Object

Raises:

  • (NotImplementedError)


63
64
65
# File 'lib/capybara/driver/node.rb', line 63

def drag_to(element)
  raise NotImplementedError
end

#hoverObject

Raises:

  • (NotImplementedError)


59
60
61
# File 'lib/capybara/driver/node.rb', line 59

def hover
  raise NotImplementedError
end

#inspectObject



103
104
105
106
107
# File 'lib/capybara/driver/node.rb', line 103

def inspect
  %(#<#{self.class} tag="#{tag_name}" path="#{path}">)
rescue NotSupportedByDriverError
  %(#<#{self.class} tag="#{tag_name}">)
end

#multiple?Boolean

Returns:

  • (Boolean)


91
92
93
# File 'lib/capybara/driver/node.rb', line 91

def multiple?
  !!self[:multiple]
end

#pathObject



95
96
97
# File 'lib/capybara/driver/node.rb', line 95

def path
  raise NotSupportedByDriverError, 'Capybara::Driver::Node#path'
end

#readonly?Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/capybara/driver/node.rb', line 87

def readonly?
  !!self[:readonly]
end

#right_click(keys = [], options = {}) ⇒ Object

Raises:

  • (NotImplementedError)


47
48
49
# File 'lib/capybara/driver/node.rb', line 47

def right_click(keys = [], options = {})
  raise NotImplementedError
end

#select_optionObject

Raises:

  • (NotImplementedError)


35
36
37
# File 'lib/capybara/driver/node.rb', line 35

def select_option
  raise NotImplementedError
end

#selected?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


79
80
81
# File 'lib/capybara/driver/node.rb', line 79

def selected?
  raise NotImplementedError
end

#send_keys(*args) ⇒ Object

Raises:

  • (NotImplementedError)


55
56
57
# File 'lib/capybara/driver/node.rb', line 55

def send_keys(*args)
  raise NotImplementedError
end

#set(value, **options) ⇒ Object

Parameters:

  • value

    String or Array. Array is only allowed if node has 'multiple' attribute

  • options (Hash{})

    Driver specific options for how to set a value on a node

Raises:

  • (NotImplementedError)


31
32
33
# File 'lib/capybara/driver/node.rb', line 31

def set(value, **options)
  raise NotImplementedError
end

#tag_nameObject

Raises:

  • (NotImplementedError)


67
68
69
# File 'lib/capybara/driver/node.rb', line 67

def tag_name
  raise NotImplementedError
end

#trigger(event) ⇒ Object



99
100
101
# File 'lib/capybara/driver/node.rb', line 99

def trigger(event)
  raise NotSupportedByDriverError, 'Capybara::Driver::Node#trigger'
end

#unselect_optionObject

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/capybara/driver/node.rb', line 39

def unselect_option
  raise NotImplementedError
end

#valueObject

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/capybara/driver/node.rb', line 25

def value
  raise NotImplementedError
end

#visible?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


71
72
73
# File 'lib/capybara/driver/node.rb', line 71

def visible?
  raise NotImplementedError
end

#visible_textObject

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/capybara/driver/node.rb', line 17

def visible_text
  raise NotImplementedError
end