Class: Capybara::Driver::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/driver/base.rb

Direct Known Subclasses

RackTest::Driver, Selenium::Driver

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#session=(value) ⇒ Object (writeonly)

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.

Options Hash (**options):

  • :wait (Numeric)

    How long to wait for the modal to appear after executing the block.

  • :text (String, Regexp)

    Text to verify is in the message shown in the modal

  • :with (String)

    Text to fill in in the case of a prompt

Raises:



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

def accept_modal(type, **options, &blk)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#accept_modal'
end

#close_window(handle) ⇒ Object



86
87
88
# File 'lib/capybara/driver/base.rb', line 86

def close_window(handle)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#close_window'
end

#current_urlObject

Raises:

  • (NotImplementedError)


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

def current_url
  raise NotImplementedError
end

#current_window_handleObject



70
71
72
# File 'lib/capybara/driver/base.rb', line 70

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.

Options Hash (**options):

  • :wait (Numeric)

    How long to wait for the modal to appear after executing the block.

  • :text (String, Regexp)

    Text to verify is in the message shown in the modal

Raises:



129
130
131
# File 'lib/capybara/driver/base.rb', line 129

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) ⇒ Object

Raises:

  • (NotImplementedError)


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

def find_css(query)
  raise NotImplementedError
end

#find_xpath(query) ⇒ Object

Raises:

  • (NotImplementedError)


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

def find_xpath(query)
  raise NotImplementedError
end

#go_backObject



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

def go_back
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#go_back'
end

#go_forwardObject



34
35
36
# File 'lib/capybara/driver/base.rb', line 34

def go_forward
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#go_forward'
end

#htmlObject

Raises:

  • (NotImplementedError)


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

def html
  raise NotImplementedError
end

#invalid_element_errorsObject



133
134
135
# File 'lib/capybara/driver/base.rb', line 133

def invalid_element_errors
  []
end

#maximize_window(handle) ⇒ Object



82
83
84
# File 'lib/capybara/driver/base.rb', line 82

def maximize_window(handle)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#maximize_current_window'
end

#needs_server?Boolean



143
144
145
# File 'lib/capybara/driver/base.rb', line 143

def needs_server?
  false
end

#no_such_window_errorObject



102
103
104
# File 'lib/capybara/driver/base.rb', line 102

def no_such_window_error
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#no_such_window_error'
end

#open_new_windowObject



94
95
96
# File 'lib/capybara/driver/base.rb', line 94

def open_new_window
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#open_new_window'
end

#refreshObject

Raises:

  • (NotImplementedError)


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

def refresh
  raise NotImplementedError
end

#reset!Object



141
# File 'lib/capybara/driver/base.rb', line 141

def reset!; end

#resize_window_to(handle, width, height) ⇒ Object



78
79
80
# File 'lib/capybara/driver/base.rb', line 78

def resize_window_to(handle, width, height)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#resize_window_to'
end

#response_headersObject



54
55
56
# File 'lib/capybara/driver/base.rb', line 54

def response_headers
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#response_headers'
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_optionsObject



147
148
149
# File 'lib/capybara/driver/base.rb', line 147

def session_options
  (@session && @session.config) || Capybara.session_options
end

#status_codeObject



58
59
60
# File 'lib/capybara/driver/base.rb', line 58

def status_code
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#status_code'
end

#switch_to_frame(frame) ⇒ Object



66
67
68
# File 'lib/capybara/driver/base.rb', line 66

def switch_to_frame(frame)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#switch_to_frame'
end

#switch_to_window(handle) ⇒ Object



98
99
100
# File 'lib/capybara/driver/base.rb', line 98

def switch_to_window(handle)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#switch_to_window'
end

#visit(path) ⇒ Object

Raises:

  • (NotImplementedError)


10
11
12
# File 'lib/capybara/driver/base.rb', line 10

def visit(path)
  raise NotImplementedError
end

#wait?Boolean



137
138
139
# File 'lib/capybara/driver/base.rb', line 137

def wait?
  false
end

#window_handlesObject



90
91
92
# File 'lib/capybara/driver/base.rb', line 90

def window_handles
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#window_handles'
end

#window_size(handle) ⇒ Object



74
75
76
# File 'lib/capybara/driver/base.rb', line 74

def window_size(handle)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#window_size'
end