Exception: Capybara::Lightpanda::MouseEventFailed
- Defined in:
- lib/capybara/lightpanda/errors.rb
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.
Instance Method Summary collapse
-
#initialize(node, message = nil) ⇒ MouseEventFailed
constructor
A new instance of MouseEventFailed.
Constructor Details
#initialize(node, message = nil) ⇒ MouseEventFailed
Returns a new instance of MouseEventFailed.
53 54 55 56 57 58 59 60 |
# File 'lib/capybara/lightpanda/errors.rb', line 53 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.
49 50 51 |
# File 'lib/capybara/lightpanda/errors.rb', line 49 def node @node end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
49 50 51 |
# File 'lib/capybara/lightpanda/errors.rb', line 49 def position @position end |
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
49 50 51 |
# File 'lib/capybara/lightpanda/errors.rb', line 49 def selector @selector end |