X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fjcalderonzumba%2Fgastonjs%2Fsrc%2FBrowser%2FBrowserMouseEventTrait.php;fp=vendor%2Fjcalderonzumba%2Fgastonjs%2Fsrc%2FBrowser%2FBrowserMouseEventTrait.php;h=38ec5a60ce5458b9558ffcd490bc49a3d60603e0;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserMouseEventTrait.php b/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserMouseEventTrait.php new file mode 100644 index 000000000..38ec5a60c --- /dev/null +++ b/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserMouseEventTrait.php @@ -0,0 +1,69 @@ +command('click', $pageId, $elementId); + } + + /** + * Triggers a right click on a page an element + * @param $pageId + * @param $elementId + * @return mixed + */ + public function rightClick($pageId, $elementId) { + return $this->command('right_click', $pageId, $elementId); + } + + /** + * Triggers a double click in a given page and element + * @param $pageId + * @param $elementId + * @return mixed + */ + public function doubleClick($pageId, $elementId) { + return $this->command('double_click', $pageId, $elementId); + } + + /** + * Hovers over an element in a given page + * @param $pageId + * @param $elementId + * @return mixed + */ + public function hover($pageId, $elementId) { + return $this->command('hover', $pageId, $elementId); + } + + /** + * Click on given coordinates, THIS DOES NOT depend on the page, it just clicks on where we are right now + * @param $coordX + * @param $coordY + * @return mixed + */ + public function clickCoordinates($coordX, $coordY) { + return $this->command('click_coordinates', $coordX, $coordY); + } + + /** + * Scrolls the page by a given left and top coordinates + * @param $left + * @param $top + * @return mixed + */ + public function scrollTo($left, $top) { + return $this->command('scroll_to', $left, $top); + } +}