1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00
teamcapybara--capybara/lib/capybara/driver/base.rb

141 lines
3.8 KiB
Ruby
Raw Normal View History

class Capybara::Driver::Base
def current_url
2009-12-29 23:43:14 -05:00
raise NotImplementedError
end
def visit(path)
2009-12-29 23:43:14 -05:00
raise NotImplementedError
end
2009-12-29 23:43:14 -05:00
def find_xpath(query)
raise NotImplementedError
end
def find_css(query)
2009-12-29 23:43:14 -05:00
raise NotImplementedError
end
2009-12-29 23:43:14 -05:00
def html
2010-07-09 21:11:54 -04:00
raise NotImplementedError
2009-12-14 09:30:29 -05:00
end
2009-12-29 23:43:14 -05:00
def go_back
2013-10-29 05:04:32 -04:00
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#go_back'
end
def go_forward
2013-10-29 05:04:32 -04:00
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#go_forward'
end
2010-07-09 21:11:54 -04:00
def execute_script(script)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#execute_script'
end
2009-12-29 23:43:14 -05:00
2010-07-09 21:11:54 -04:00
def evaluate_script(script)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#evaluate_script'
end
def save_screenshot(path, options={})
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#save_screenshot'
end
def response_headers
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#response_headers'
end
2010-10-29 07:41:49 -04:00
def status_code
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#status_code'
end
2009-12-29 23:43:14 -05:00
2013-01-08 03:40:12 -05:00
def within_frame(frame_handle)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#within_frame'
2010-01-12 14:40:10 -05:00
end
def current_window_handle
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#current_window_handle'
end
def window_size(handle)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#window_size'
end
def resize_window_to(handle, width, height)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#resize_window_to'
end
def maximize_window(handle)
2014-04-10 03:20:27 -04:00
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#maximize_current_window'
end
def close_window(handle)
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)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#within_window'
2010-08-27 15:00:08 -04:00
end
def no_such_window_error
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#no_such_window_error'
end
##
#
# 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 18:41:55 -04:00
def accept_modal(type, options={}, &blk)
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#accept_modal'
end
##
#
# 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 03:24:12 -04:00
def dismiss_modal(type, options={}, &blk)
2013-04-01 18:41:55 -04:00
raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#dismiss_modal'
end
2011-07-13 09:39:17 -04:00
def invalid_element_errors
[]
end
2010-07-09 21:11:54 -04:00
def wait?
false
end
2010-07-29 09:25:45 -04:00
def reset!
end
def needs_server?
false
end
def browser_initialized?
true
end
2009-12-29 23:43:14 -05:00
end