38ec5a60ce5458b9558ffcd490bc49a3d60603e0
[yaffs-website] / vendor / jcalderonzumba / gastonjs / src / Browser / BrowserMouseEventTrait.php
1 <?php
2
3 namespace Zumba\GastonJS\Browser;
4
5 /**
6  * Trait BrowserMouseEventTrait
7  * @package Zumba\GastonJS\Browser
8  */
9 trait BrowserMouseEventTrait {
10   /**
11    * Click on a given page and element
12    * @param $pageId
13    * @param $elementId
14    * @return mixed
15    */
16   public function click($pageId, $elementId) {
17     return $this->command('click', $pageId, $elementId);
18   }
19
20   /**
21    * Triggers a right click on a page an element
22    * @param $pageId
23    * @param $elementId
24    * @return mixed
25    */
26   public function rightClick($pageId, $elementId) {
27     return $this->command('right_click', $pageId, $elementId);
28   }
29
30   /**
31    * Triggers a double click in a given page and element
32    * @param $pageId
33    * @param $elementId
34    * @return mixed
35    */
36   public function doubleClick($pageId, $elementId) {
37     return $this->command('double_click', $pageId, $elementId);
38   }
39
40   /**
41    * Hovers over an element in a given page
42    * @param $pageId
43    * @param $elementId
44    * @return mixed
45    */
46   public function hover($pageId, $elementId) {
47     return $this->command('hover', $pageId, $elementId);
48   }
49
50   /**
51    * Click on given coordinates, THIS DOES NOT depend on the page, it just clicks on where we are right now
52    * @param $coordX
53    * @param $coordY
54    * @return mixed
55    */
56   public function clickCoordinates($coordX, $coordY) {
57     return $this->command('click_coordinates', $coordX, $coordY);
58   }
59
60   /**
61    * Scrolls the page by a given left and top coordinates
62    * @param $left
63    * @param $top
64    * @return mixed
65    */
66   public function scrollTo($left, $top) {
67     return $this->command('scroll_to', $left, $top);
68   }
69 }