annotate vendor/jcalderonzumba/gastonjs/src/Exception/MouseEventFailed.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Zumba\GastonJS\Exception;
Chris@0 4
Chris@0 5 /**
Chris@0 6 * Class MouseEventFailed
Chris@0 7 * @package Zumba\GastonJS\Exception
Chris@0 8 */
Chris@0 9 class MouseEventFailed extends NodeError {
Chris@0 10
Chris@0 11 /**
Chris@0 12 * Gets the name of the event
Chris@0 13 * @return string
Chris@0 14 */
Chris@0 15 public function getName() {
Chris@0 16 return $this->response["args"][0];
Chris@0 17 }
Chris@0 18
Chris@0 19 /**
Chris@0 20 * Selector of the element to act with the mouse
Chris@0 21 * @return string
Chris@0 22 */
Chris@0 23 public function getSelector() {
Chris@0 24 return $this->response["args"][1];
Chris@0 25 }
Chris@0 26
Chris@0 27 /**
Chris@0 28 * Returns the position where the click was done
Chris@0 29 * @return array
Chris@0 30 */
Chris@0 31 public function getPosition() {
Chris@0 32 $position = array();
Chris@0 33 $position[0] = $this->response["args"][1]['x'];
Chris@0 34 $position[1] = $this->response["args"][2]['y'];
Chris@0 35 return $position;
Chris@0 36 }
Chris@0 37
Chris@0 38 /**
Chris@0 39 * @return string
Chris@0 40 */
Chris@0 41 public function message() {
Chris@0 42 $name = $this->getName();
Chris@0 43 $position = implode(",", $this->getPosition());
Chris@0 44 return "Firing a $name at co-ordinates [$position] failed. Poltergeist detected
Chris@0 45 another element with CSS selector '#{selector}' at this position.
Chris@0 46 It may be overlapping the element you are trying to interact with.
Chris@0 47 If you don't care about overlapping elements, try using node.trigger('$name').";
Chris@0 48 }
Chris@0 49 }