3 namespace Zumba\GastonJS\Exception;
6 * Class MouseEventFailed
7 * @package Zumba\GastonJS\Exception
9 class MouseEventFailed extends NodeError {
12 * Gets the name of the event
15 public function getName() {
16 return $this->response["args"][0];
20 * Selector of the element to act with the mouse
23 public function getSelector() {
24 return $this->response["args"][1];
28 * Returns the position where the click was done
31 public function getPosition() {
33 $position[0] = $this->response["args"][1]['x'];
34 $position[1] = $this->response["args"][2]['y'];
41 public function message() {
42 $name = $this->getName();
43 $position = implode(",", $this->getPosition());
44 return "Firing a $name at co-ordinates [$position] failed. Poltergeist detected
45 another element with CSS selector '#{selector}' at this position.
46 It may be overlapping the element you are trying to interact with.
47 If you don't care about overlapping elements, try using node.trigger('$name').";