Exception: Capybara::Apparition::JavascriptError

Inherits:
ClientError show all
Defined in:
lib/capybara/apparition/errors.rb

Instance Attribute Summary

Attributes inherited from ClientError

#response

Instance Method Summary collapse

Methods inherited from ClientError

#initialize

Constructor Details

This class inherits a constructor from Capybara::Apparition::ClientError

Instance Method Details

#javascript_errorsObject

def javascript_errors

response['args'].first.map { |data| JSErrorItem.new(data['message'], data['stack']) }

end



59
60
61
# File 'lib/capybara/apparition/errors.rb', line 59

def javascript_errors
  [message: response]
end

#messageObject



63
64
65
66
67
68
69
# File 'lib/capybara/apparition/errors.rb', line 63

def message
  'One or more errors were raised in the Javascript code on the page. ' \
    "If you don't care about these errors, you can ignore them by " \
    'setting js_errors: false in your Apparition configuration (see ' \
    'documentation for details).' \
    "\n\n#{javascript_errors.map { |err| err[:message] }.join("\n")}"
end