Exception: Capybara::Cuprite::MouseEventFailed

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

Instance Attribute Summary collapse

Attributes inherited from ClientError

#response

Instance Method Summary collapse

Constructor Details

#initializeMouseEventFailed

Returns a new instance of MouseEventFailed.



69
70
71
72
73
74
# File 'lib/capybara/cuprite/errors.rb', line 69

def initialize(*)
  super
  data = /\A\w+: (\w+), (.+?), ([\d\.-]+), ([\d\.-]+)/.match(@response)
  @name, @selector = data.values_at(1, 2)
  @position = data.values_at(3, 4).map(&:to_f)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



67
68
69
# File 'lib/capybara/cuprite/errors.rb', line 67

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position.



67
68
69
# File 'lib/capybara/cuprite/errors.rb', line 67

def position
  @position
end

#selectorObject (readonly)

Returns the value of attribute selector.



67
68
69
# File 'lib/capybara/cuprite/errors.rb', line 67

def selector
  @selector
end

Instance Method Details

#messageObject



77
78
79
80
81
82
# File 'lib/capybara/cuprite/errors.rb', line 77

def message
  "Firing a #{name} at coordinates [#{position.join(", ")}] failed. Cuprite detected " \
    "another element with CSS selector \"#{selector}\" at this position. " \
    "It may be overlapping the element you are trying to interact with. " \
    "If you don't care about overlapping elements, try using node.trigger(\"#{name}\")."
end