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, initial_cache = {}) ⇒ Node

Returns a new instance of Node.



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

def initialize(driver, native, initial_cache = {})
  @driver = driver
  @native = native
  @initial_cache = initial_cache
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

#initial_cacheObject (readonly)

Returns the value of attribute initial_cache.



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

def initial_cache
  @initial_cache
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



138
139
140
# File 'lib/capybara/driver/node.rb', line 138

def ==(other)
  eql?(other) || (other.respond_to?(:native) && native == other.native)
end

#[](name) ⇒ Object

Raises:

  • (NotImplementedError)


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

def [](name)
  raise NotImplementedError
end

#all_textObject

Raises:

  • (NotImplementedError)


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

def all_text
  raise NotImplementedError
end

#checked?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def checked?
  raise NotImplementedError
end

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

Raises:

  • (NotImplementedError)


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

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

#disabled?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def disabled?
  raise NotImplementedError
end

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

Raises:

  • (NotImplementedError)


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

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

#drag_to(element, **options) ⇒ Object

Raises:

  • (NotImplementedError)


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

def drag_to(element, **options)
  raise NotImplementedError
end

#drop(*args) ⇒ Object

Raises:

  • (NotImplementedError)


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

def drop(*args)
  raise NotImplementedError
end

#hoverObject

Raises:

  • (NotImplementedError)


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

def hover
  raise NotImplementedError
end

#inspectObject



132
133
134
135
136
# File 'lib/capybara/driver/node.rb', line 132

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

#multiple?Boolean

Returns:

  • (Boolean)


112
113
114
# File 'lib/capybara/driver/node.rb', line 112

def multiple?
  !!self[:multiple]
end

#obscured?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def obscured?
  raise NotImplementedError
end

#pathObject



120
121
122
# File 'lib/capybara/driver/node.rb', line 120

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

#readonly?Boolean

Returns:

  • (Boolean)


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

def readonly?
  !!self[:readonly]
end

#rectObject



116
117
118
# File 'lib/capybara/driver/node.rb', line 116

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

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

Raises:

  • (NotImplementedError)


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

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

#scroll_by(x, y) ⇒ Object

Raises:

  • (NotImplementedError)


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

def scroll_by(x, y)
  raise NotImplementedError
end

#scroll_to(element, alignment, position = nil) ⇒ Object

Raises:

  • (NotImplementedError)


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

def scroll_to(element, alignment, position = nil)
  raise NotImplementedError
end

#select_optionObject

Raises:

  • (NotImplementedError)


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

def select_option
  raise NotImplementedError
end

#selected?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def selected?
  raise NotImplementedError
end

#send_keys(*args) ⇒ Object

Raises:

  • (NotImplementedError)


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

def send_keys(*args)
  raise NotImplementedError
end

#set(value, **options) ⇒ Object

Parameters:

  • value (String, 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)


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

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

#shadow_rootObject



128
129
130
# File 'lib/capybara/driver/node.rb', line 128

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

#style(styles) ⇒ Object

Raises:

  • (NotImplementedError)


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

def style(styles)
  raise NotImplementedError
end

#tag_nameObject

Raises:

  • (NotImplementedError)


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

def tag_name
  raise NotImplementedError
end

#trigger(event) ⇒ Object



124
125
126
# File 'lib/capybara/driver/node.rb', line 124

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

#unselect_optionObject

Raises:

  • (NotImplementedError)


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

def unselect_option
  raise NotImplementedError
end

#valueObject

Raises:

  • (NotImplementedError)


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

def value
  raise NotImplementedError
end

#visible?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


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

def visible?
  raise NotImplementedError
end

#visible_textObject

Raises:

  • (NotImplementedError)


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

def visible_text
  raise NotImplementedError
end