Exception: Capybara::Lightpanda::MouseEventFailed
- Inherits:
-
BrowserError
- Object
- StandardError
- Error
- BrowserError
- Capybara::Lightpanda::MouseEventFailed
- Defined in:
- lib/capybara/lightpanda/errors.rb
Overview
— Cuprite/Ferrum drop-in compatibility surface — This gem never raises the three classes below (no coordinate-based mouse path, no multi-page API, no page-status tracking). They mirror the peer taxonomy (Cuprite’s MouseEventFailed, Ferrum’s NoSuchPageError/StatusError) so suites migrating from those drivers don’t NameError on rescue lists that reference them.
Constant Summary collapse
- PATTERN =
/at position \((\d+),\s*(\d+)\).*selector:\s*(.+)/i
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#selector ⇒ Object
readonly
Returns the value of attribute selector.
Attributes inherited from BrowserError
Instance Method Summary collapse
-
#initialize(node, message = nil) ⇒ MouseEventFailed
constructor
A new instance of MouseEventFailed.
Methods inherited from BrowserError
Constructor Details
#initialize(node, message = nil) ⇒ MouseEventFailed
Returns a new instance of MouseEventFailed.
115 116 117 118 119 120 121 122 |
# File 'lib/capybara/lightpanda/errors.rb', line 115 def initialize(node, = nil) @node = node if && (match = .match(PATTERN)) @position = { x: match[1].to_i, y: match[2].to_i } @selector = match[3] end super( || "Failed mouse event") end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
111 112 113 |
# File 'lib/capybara/lightpanda/errors.rb', line 111 def node @node end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
111 112 113 |
# File 'lib/capybara/lightpanda/errors.rb', line 111 def position @position end |
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
111 112 113 |
# File 'lib/capybara/lightpanda/errors.rb', line 111 def selector @selector end |