Class: Capybara::Driver::Base

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

Direct Known Subclasses

RackTest::Driver, Selenium::Driver

Instance Method Summary (collapse)

Instance Method Details

- (String) accept_modal(type, options = {}, &blk)

Execute the block, and then accept the modal opened.

Parameters:

  • type (:alert, :confirm, :prompt)
  • options (Hash) (defaults to: {})

    a customizable set of options

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

Returns:

  • (String)

    the message shown in the modal

Raises:



105
106
107
# File 'lib/capybara/driver/base.rb', line 105

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

- (Boolean) browser_initialized?

Returns:

  • (Boolean)


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

def browser_initialized?
  true
end

- (Object) close_window(handle)



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

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

- (Object) current_url

Raises:

  • (NotImplementedError)


2
3
4
# File 'lib/capybara/driver/base.rb', line 2

def current_url
  raise NotImplementedError
end

- (Object) current_window_handle



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

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

- (String) dismiss_modal(type, options = {}, &blk)

Execute the block, and then dismiss the modal opened.

Parameters:

  • type (:alert, :confirm, :prompt)
  • options (Hash) (defaults to: {})

    a customizable set of options

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

Returns:

  • (String)

    the message shown in the modal

Raises:



118
119
120
# File 'lib/capybara/driver/base.rb', line 118

def dismiss_modal(type, options={}, &blk)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#dismiss_modal'
end

- (Object) evaluate_script(script)



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

def evaluate_script(script)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#evaluate_script'
end

- (Object) execute_script(script)



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

def execute_script(script)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#execute_script'
end

- (Object) find_css(query)

Raises:

  • (NotImplementedError)


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

def find_css(query)
  raise NotImplementedError
end

- (Object) find_xpath(query)

Raises:

  • (NotImplementedError)


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

def find_xpath(query)
  raise NotImplementedError
end

- (Object) go_back



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

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

- (Object) go_forward



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

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

- (Object) html

Raises:

  • (NotImplementedError)


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

def html
  raise NotImplementedError
end

- (Object) invalid_element_errors



122
123
124
# File 'lib/capybara/driver/base.rb', line 122

def invalid_element_errors
  []
end

- (Object) maximize_window(handle)



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

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

- (Boolean) needs_server?

Returns:

  • (Boolean)


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

def needs_server?
  false
end

- (Object) no_such_window_error



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

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

- (Object) open_new_window



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

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

- (Object) reset!



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

def reset!
end

- (Object) resize_window_to(handle, width, height)



62
63
64
# File 'lib/capybara/driver/base.rb', line 62

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

- (Object) response_headers



42
43
44
# File 'lib/capybara/driver/base.rb', line 42

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

- (Object) save_screenshot(path, options = {})



38
39
40
# File 'lib/capybara/driver/base.rb', line 38

def save_screenshot(path, options={})
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#save_screenshot'
end

- (Object) status_code



46
47
48
# File 'lib/capybara/driver/base.rb', line 46

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

- (Object) switch_to_window(handle)



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

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

- (Object) visit(path)

Raises:

  • (NotImplementedError)


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

def visit(path)
  raise NotImplementedError
end

- (Boolean) wait?

Returns:

  • (Boolean)


126
127
128
# File 'lib/capybara/driver/base.rb', line 126

def wait?
  false
end

- (Object) window_handles



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

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

- (Object) window_size(handle)



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

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

- (Object) within_frame(frame_handle)



50
51
52
# File 'lib/capybara/driver/base.rb', line 50

def within_frame(frame_handle)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#within_frame'
end

- (Object) within_window(locator)



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

def within_window(locator)
  raise Capybara::NotSupportedByDriverError, 'Capybara::Driver::Base#within_window'
end