2009-12-09 20:43:40 +00:00
|
|
|
class Capybara::Driver::Base
|
2009-12-16 14:16:52 +00:00
|
|
|
def current_url
|
2009-12-30 04:43:14 +00:00
|
|
|
raise NotImplementedError
|
2009-12-16 14:16:52 +00:00
|
|
|
end
|
|
|
|
|
2009-12-09 20:43:40 +00:00
|
|
|
def visit(path)
|
2009-12-30 04:43:14 +00:00
|
|
|
raise NotImplementedError
|
2009-12-09 20:43:40 +00:00
|
|
|
end
|
2009-12-30 04:43:14 +00:00
|
|
|
|
2013-02-19 17:03:26 +00:00
|
|
|
def find_xpath(query)
|
|
|
|
raise NotImplementedError
|
|
|
|
end
|
2013-10-05 18:23:51 +00:00
|
|
|
|
2013-02-19 17:03:26 +00:00
|
|
|
def find_css(query)
|
2009-12-30 04:43:14 +00:00
|
|
|
raise NotImplementedError
|
2009-12-09 20:43:40 +00:00
|
|
|
end
|
2009-12-30 04:43:14 +00:00
|
|
|
|
2012-09-10 01:05:17 +00:00
|
|
|
def html
|
2010-07-10 01:11:54 +00:00
|
|
|
raise NotImplementedError
|
2009-12-14 14:30:29 +00:00
|
|
|
end
|
2009-12-30 04:43:14 +00:00
|
|
|
|
2013-10-05 18:23:51 +00:00
|
|
|
def go_back
|
2013-10-29 09:04:32 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#go_back'
|
2013-10-05 18:23:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def go_forward
|
2013-10-29 09:04:32 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#go_forward'
|
2013-10-05 18:23:51 +00:00
|
|
|
end
|
|
|
|
|
2010-07-10 01:11:54 +00:00
|
|
|
def execute_script(script)
|
2013-03-09 03:44:40 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#execute_script'
|
2009-12-09 20:43:40 +00:00
|
|
|
end
|
2009-12-30 04:43:14 +00:00
|
|
|
|
2010-07-10 01:11:54 +00:00
|
|
|
def evaluate_script(script)
|
2013-03-09 03:44:40 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#evaluate_script'
|
2010-02-25 22:51:51 +00:00
|
|
|
end
|
|
|
|
|
2012-07-10 04:50:15 +00:00
|
|
|
def save_screenshot(path, options={})
|
2013-03-09 03:44:40 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#save_screenshot'
|
2012-07-10 04:50:15 +00:00
|
|
|
end
|
|
|
|
|
2009-12-18 17:50:55 +00:00
|
|
|
def response_headers
|
2013-03-09 03:44:40 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#response_headers'
|
2009-12-18 17:50:55 +00:00
|
|
|
end
|
2010-10-29 11:41:49 +00:00
|
|
|
|
2010-06-07 03:14:40 +00:00
|
|
|
def status_code
|
2013-03-09 03:44:40 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#status_code'
|
2010-06-07 01:13:57 +00:00
|
|
|
end
|
2009-12-30 04:43:14 +00:00
|
|
|
|
2013-01-08 08:40:12 +00:00
|
|
|
def within_frame(frame_handle)
|
2013-03-09 03:44:40 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#within_frame'
|
2010-01-12 19:40:10 +00:00
|
|
|
end
|
|
|
|
|
2014-04-08 21:28:16 +00:00
|
|
|
def current_window_handle
|
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#current_window_handle'
|
|
|
|
end
|
|
|
|
|
2014-04-24 22:38:42 +00:00
|
|
|
def window_size(handle)
|
2014-04-08 21:28:16 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#window_size'
|
|
|
|
end
|
|
|
|
|
2014-04-24 22:38:42 +00:00
|
|
|
def resize_window_to(handle, width, height)
|
2014-04-08 21:28:16 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#resize_window_to'
|
|
|
|
end
|
|
|
|
|
2014-04-24 22:38:42 +00:00
|
|
|
def maximize_window(handle)
|
2014-04-10 07:20:27 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#maximize_current_window'
|
|
|
|
end
|
|
|
|
|
2014-04-24 22:38:42 +00:00
|
|
|
def close_window(handle)
|
2014-04-08 21:28:16 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#close_window'
|
|
|
|
end
|
|
|
|
|
|
|
|
def window_handles
|
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#window_handles'
|
|
|
|
end
|
|
|
|
|
|
|
|
def open_new_window
|
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#open_new_window'
|
|
|
|
end
|
|
|
|
|
|
|
|
def switch_to_window(handle)
|
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#switch_to_window'
|
|
|
|
end
|
|
|
|
|
|
|
|
def within_window(locator)
|
2013-03-09 03:44:40 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#within_window'
|
2010-08-27 19:00:08 +00:00
|
|
|
end
|
|
|
|
|
2014-04-08 21:28:16 +00:00
|
|
|
def no_such_window_error
|
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#no_such_window_error'
|
|
|
|
end
|
2014-06-03 16:57:07 +00:00
|
|
|
|
2014-07-01 00:50:41 +00:00
|
|
|
|
|
|
|
##
|
|
|
|
#
|
|
|
|
# Execute the block, and then accept the modal opened.
|
|
|
|
# @param type [:alert, :confirm, :prompt]
|
|
|
|
# @option options [Numeric] :wait How long to wait for the modal to appear after executing the block.
|
|
|
|
# @option options [String, Regexp] :text Text to verify is in the message shown in the modal
|
|
|
|
# @option options [String] :with Text to fill in in the case of a prompt
|
|
|
|
# @return [String] the message shown in the modal
|
|
|
|
# @raise [Capybara::ModalNotFound] if modal dialog hasn't been found
|
|
|
|
#
|
2013-04-01 22:41:55 +00:00
|
|
|
def accept_modal(type, options={}, &blk)
|
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#accept_modal'
|
|
|
|
end
|
|
|
|
|
2014-07-01 00:50:41 +00:00
|
|
|
##
|
|
|
|
#
|
|
|
|
# Execute the block, and then dismiss the modal opened.
|
|
|
|
# @param type [:alert, :confirm, :prompt]
|
|
|
|
# @option options [Numeric] :wait How long to wait for the modal to appear after executing the block.
|
|
|
|
# @option options [String, Regexp] :text Text to verify is in the message shown in the modal
|
|
|
|
# @return [String] the message shown in the modal
|
|
|
|
# @raise [Capybara::ModalNotFound] if modal dialog hasn't been found
|
|
|
|
#
|
2014-07-01 07:24:12 +00:00
|
|
|
def dismiss_modal(type, options={}, &blk)
|
2013-04-01 22:41:55 +00:00
|
|
|
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#dismiss_modal'
|
|
|
|
end
|
2014-04-08 21:28:16 +00:00
|
|
|
|
2011-07-13 13:39:17 +00:00
|
|
|
def invalid_element_errors
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
|
2010-07-10 01:11:54 +00:00
|
|
|
def wait?
|
|
|
|
false
|
|
|
|
end
|
|
|
|
|
2010-07-29 13:25:45 +00:00
|
|
|
def reset!
|
|
|
|
end
|
2012-07-13 11:29:02 +00:00
|
|
|
|
|
|
|
def needs_server?
|
|
|
|
false
|
|
|
|
end
|
2014-09-19 21:18:50 +00:00
|
|
|
|
|
|
|
def browser_initialized?
|
|
|
|
true
|
|
|
|
end
|
2009-12-30 04:43:14 +00:00
|
|
|
end
|