Class: Capybara::Driver::Base
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Inherits: | Object |
Defined in: | lib/capybara/driver/base.rb |
Instance Attribute Summary
- #needs_server? ⇒ Boolean readonly
- #session=(value) rw
- #wait? ⇒ Boolean readonly
- #session rw private
Instance Method Summary
-
#accept_modal(type, **options, &blk) ⇒ String
Execute the block, and then accept the modal opened.
- #active_element
- #close_window(handle)
- #current_url
- #current_window_handle
-
#dismiss_modal(type, **options, &blk) ⇒ String
Execute the block, and then dismiss the modal opened.
- #evaluate_async_script(script, *args)
- #evaluate_script(script, *args)
- #execute_script(script, *args)
- #find_css(query, **options)
- #find_xpath(query, **options)
- #frame_title
- #frame_url
- #fullscreen_window(handle)
- #go_back
- #go_forward
- #html
- #invalid_element_errors
- #maximize_window(handle)
- #no_such_window_error
- #open_new_window
- #refresh
- #reset!
- #resize_window_to(handle, width, height)
- #response_headers
- #save_screenshot(path, **options)
- #send_keys
- #session_options
- #status_code
- #switch_to_frame(frame)
- #switch_to_window(handle)
- #visit(path)
- #window_handles
- #window_size(handle)
Instance Attribute Details
#needs_server? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/capybara/driver/base.rb', line 165
def needs_server? false end
#session (rw, private)
[ GitHub ]# File 'lib/capybara/driver/base.rb', line 175
def session @session ||= nil end
#session=(value) (rw)
[ GitHub ]# File 'lib/capybara/driver/base.rb', line 4
attr_writer :session
#wait? ⇒ Boolean
(readonly)
[ GitHub ]
# File 'lib/capybara/driver/base.rb', line 159
def wait? false end
Instance Method Details
#accept_modal(type, **options, &blk) ⇒ String
Execute the block, and then accept the modal opened.
# File 'lib/capybara/driver/base.rb', line 138
def accept_modal(type, **, &blk) raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#accept_modal' end
#active_element
# File 'lib/capybara/driver/base.rb', line 66
def active_element raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#active_element' end
#close_window(handle)
# File 'lib/capybara/driver/base.rb', line 108
def close_window(handle) raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#close_window' end
#current_url
# File 'lib/capybara/driver/base.rb', line 6
def current_url raise NotImplementedError end
#current_window_handle
# 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.
# File 'lib/capybara/driver/base.rb', line 151
def dismiss_modal(type, **, &blk) raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#dismiss_modal' end
#evaluate_async_script(script, *args)
# 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)
# 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)
# 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)
# File 'lib/capybara/driver/base.rb', line 22
def find_css(query, ** ) raise NotImplementedError end
#find_xpath(query, **options)
# File 'lib/capybara/driver/base.rb', line 18
def find_xpath(query, ** ) raise NotImplementedError end
#frame_title
[ GitHub ]# File 'lib/capybara/driver/base.rb', line 78
def frame_title find_xpath('/html/head/title').map(&:all_text).first.to_s end
#frame_url
[ GitHub ]# File 'lib/capybara/driver/base.rb', line 82
def frame_url evaluate_script('document.location.href') rescue Capybara::NotSupportedByDriverError raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#frame_title' end
#fullscreen_window(handle)
# File 'lib/capybara/driver/base.rb', line 104
def fullscreen_window(handle) raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#fullscreen_window' end
#go_back
# File 'lib/capybara/driver/base.rb', line 30
def go_back raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#go_back' end
#go_forward
# File 'lib/capybara/driver/base.rb', line 34
def go_forward raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#go_forward' end
#html
# File 'lib/capybara/driver/base.rb', line 26
def html raise NotImplementedError end
#invalid_element_errors
[ GitHub ]# File 'lib/capybara/driver/base.rb', line 155
def invalid_element_errors [] end
#maximize_window(handle)
# File 'lib/capybara/driver/base.rb', line 100
def maximize_window(handle) raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#maximize_window' end
#no_such_window_error
# 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
# File 'lib/capybara/driver/base.rb', line 116
def open_new_window raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#open_new_window' end
#refresh
# File 'lib/capybara/driver/base.rb', line 14
def refresh raise NotImplementedError end
#reset!
[ GitHub ]# File 'lib/capybara/driver/base.rb', line 163
def reset!; end
#resize_window_to(handle, width, height)
# 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
#response_headers
# File 'lib/capybara/driver/base.rb', line 54
def response_headers raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#response_headers' end
#save_screenshot(path, **options)
# File 'lib/capybara/driver/base.rb', line 50
def save_screenshot(path, ** ) raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#save_screenshot' end
#send_keys
# File 'lib/capybara/driver/base.rb', line 62
def send_keys(*) raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#send_keys' end
#session_options
[ GitHub ]#status_code
# File 'lib/capybara/driver/base.rb', line 58
def status_code raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#status_code' end
#switch_to_frame(frame)
# 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)
# 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)
# File 'lib/capybara/driver/base.rb', line 10
def visit(path) raise NotImplementedError end
#window_handles
# File 'lib/capybara/driver/base.rb', line 112
def window_handles raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#window_handles' end
#window_size(handle)
# File 'lib/capybara/driver/base.rb', line 92
def window_size(handle) raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#window_size' end