mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
8dbf3b8e31
* There's no need to poll for the modal when we have an event loop.
44 lines
730 B
Ruby
44 lines
730 B
Ruby
module Capybara::Webkit
|
|
class InvalidResponseError < StandardError
|
|
end
|
|
|
|
class NoResponseError < StandardError
|
|
end
|
|
|
|
class NodeNotAttachedError < Capybara::ElementNotFound
|
|
end
|
|
|
|
class ClickFailed < StandardError
|
|
end
|
|
|
|
class TimeoutError < Timeout::Error
|
|
end
|
|
|
|
class NoSuchWindowError < StandardError
|
|
end
|
|
|
|
class ConnectionError < StandardError
|
|
end
|
|
|
|
class ModalNotFound < StandardError
|
|
end
|
|
|
|
class JsonError
|
|
def initialize(response)
|
|
error = JSON.parse response
|
|
|
|
@class_name = error['class']
|
|
@message = error['message']
|
|
end
|
|
|
|
def exception
|
|
error_class.new @message
|
|
end
|
|
|
|
private
|
|
|
|
def error_class
|
|
Capybara::Webkit.const_get @class_name
|
|
end
|
|
end
|
|
end
|