Class: Capybara::Driver::Base
- Inherits:
-
Object
- Object
- Capybara::Driver::Base
show all
- Defined in:
- lib/capybara/driver/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
-
#accept_modal(type, **options, &blk) ⇒ String
Execute the block, and then accept the modal opened.
-
#active_element ⇒ Object
-
#close_window(handle) ⇒ Object
-
#current_url ⇒ Object
-
#current_window_handle ⇒ Object
-
#dismiss_modal(type, **options, &blk) ⇒ String
Execute the block, and then dismiss the modal opened.
-
#evaluate_async_script(script, *args) ⇒ Object
-
#evaluate_script(script, *args) ⇒ Object
-
#execute_script(script, *args) ⇒ Object
-
#find_css(query, **options) ⇒ Object
-
#find_xpath(query, **options) ⇒ Object
-
#frame_title ⇒ Object
-
#frame_url ⇒ Object
-
#fullscreen_window(handle) ⇒ Object
-
#go_back ⇒ Object
-
#go_forward ⇒ Object
-
#html ⇒ Object
-
#invalid_element_errors ⇒ Object
-
#maximize_window(handle) ⇒ Object
-
#needs_server? ⇒ Boolean
-
#no_such_window_error ⇒ Object
-
#open_new_window ⇒ Object
-
#refresh ⇒ Object
-
#reset! ⇒ Object
-
#resize_window_to(handle, width, height) ⇒ Object
-
#response_headers ⇒ Object
-
#save_screenshot(path, **options) ⇒ Object
-
#send_keys ⇒ Object
-
#session_options ⇒ Object
-
#status_code ⇒ Object
-
#switch_to_frame(frame) ⇒ Object
-
#switch_to_window(handle) ⇒ Object
-
#visit(path) ⇒ Object
-
#wait? ⇒ Boolean
-
#window_handles ⇒ Object
-
#window_size(handle) ⇒ Object
Instance Attribute Details
#session=(value) ⇒ Object
Sets the attribute session
4
5
6
|
# File 'lib/capybara/driver/base.rb', line 4
def session=(value)
@session = value
end
|
Instance Method Details
#accept_modal(type, **options, &blk) ⇒ String
Execute the block, and then accept the modal opened.
138
139
140
|
# File 'lib/capybara/driver/base.rb', line 138
def accept_modal(type, **options, &blk)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#accept_modal'
end
|
#close_window(handle) ⇒ Object
108
109
110
|
# File 'lib/capybara/driver/base.rb', line 108
def close_window(handle)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#close_window'
end
|
#current_url ⇒ Object
6
7
8
|
# File 'lib/capybara/driver/base.rb', line 6
def current_url
raise NotImplementedError
end
|
#current_window_handle ⇒ Object
88
89
90
|
# File 'lib/capybara/driver/base.rb', line 88
def current_window_handle
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#current_window_handle'
end
|
#dismiss_modal(type, **options, &blk) ⇒ String
Execute the block, and then dismiss the modal opened.
151
152
153
|
# File 'lib/capybara/driver/base.rb', line 151
def dismiss_modal(type, **options, &blk)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#dismiss_modal'
end
|
#evaluate_async_script(script, *args) ⇒ Object
46
47
48
|
# File 'lib/capybara/driver/base.rb', line 46
def evaluate_async_script(script, *args)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#evaluate_script_asnyc'
end
|
#evaluate_script(script, *args) ⇒ Object
42
43
44
|
# File 'lib/capybara/driver/base.rb', line 42
def evaluate_script(script, *args)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#evaluate_script'
end
|
#execute_script(script, *args) ⇒ Object
38
39
40
|
# File 'lib/capybara/driver/base.rb', line 38
def execute_script(script, *args)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#execute_script'
end
|
#find_css(query, **options) ⇒ Object
22
23
24
|
# File 'lib/capybara/driver/base.rb', line 22
def find_css(query, **options)
raise NotImplementedError
end
|
#find_xpath(query, **options) ⇒ Object
18
19
20
|
# File 'lib/capybara/driver/base.rb', line 18
def find_xpath(query, **options)
raise NotImplementedError
end
|
#frame_title ⇒ Object
78
79
80
|
# File 'lib/capybara/driver/base.rb', line 78
def frame_title
find_xpath('/html/head/title').map(&:all_text).first.to_s
end
|
#fullscreen_window(handle) ⇒ Object
104
105
106
|
# File 'lib/capybara/driver/base.rb', line 104
def fullscreen_window(handle)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#fullscreen_window'
end
|
#html ⇒ Object
26
27
28
|
# File 'lib/capybara/driver/base.rb', line 26
def html
raise NotImplementedError
end
|
#invalid_element_errors ⇒ Object
155
156
157
|
# File 'lib/capybara/driver/base.rb', line 155
def invalid_element_errors
[]
end
|
#maximize_window(handle) ⇒ Object
100
101
102
|
# File 'lib/capybara/driver/base.rb', line 100
def maximize_window(handle)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#maximize_window'
end
|
#needs_server? ⇒ Boolean
165
166
167
|
# File 'lib/capybara/driver/base.rb', line 165
def needs_server?
false
end
|
#no_such_window_error ⇒ Object
124
125
126
|
# File 'lib/capybara/driver/base.rb', line 124
def no_such_window_error
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#no_such_window_error'
end
|
#open_new_window ⇒ Object
116
117
118
|
# File 'lib/capybara/driver/base.rb', line 116
def open_new_window
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#open_new_window'
end
|
#refresh ⇒ Object
14
15
16
|
# File 'lib/capybara/driver/base.rb', line 14
def refresh
raise NotImplementedError
end
|
#reset! ⇒ Object
163
|
# File 'lib/capybara/driver/base.rb', line 163
def reset!; end
|
#resize_window_to(handle, width, height) ⇒ Object
96
97
98
|
# File 'lib/capybara/driver/base.rb', line 96
def resize_window_to(handle, width, height)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#resize_window_to'
end
|
#save_screenshot(path, **options) ⇒ Object
50
51
52
|
# File 'lib/capybara/driver/base.rb', line 50
def save_screenshot(path, **options)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#save_screenshot'
end
|
#session_options ⇒ Object
169
170
171
|
# File 'lib/capybara/driver/base.rb', line 169
def session_options
session&.config || Capybara.session_options
end
|
#switch_to_frame(frame) ⇒ Object
74
75
76
|
# File 'lib/capybara/driver/base.rb', line 74
def switch_to_frame(frame)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#switch_to_frame'
end
|
#switch_to_window(handle) ⇒ Object
120
121
122
|
# File 'lib/capybara/driver/base.rb', line 120
def switch_to_window(handle)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#switch_to_window'
end
|
#visit(path) ⇒ Object
10
11
12
|
# File 'lib/capybara/driver/base.rb', line 10
def visit(path)
raise NotImplementedError
end
|
#wait? ⇒ Boolean
159
160
161
|
# File 'lib/capybara/driver/base.rb', line 159
def wait?
false
end
|
#window_size(handle) ⇒ Object