X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fjcalderonzumba%2Fgastonjs%2Fsrc%2FBrowser%2FBrowser.php;fp=vendor%2Fjcalderonzumba%2Fgastonjs%2Fsrc%2FBrowser%2FBrowser.php;h=5c2a3374e9fefc2d2262696bd103b6fa232f33ae;hp=0000000000000000000000000000000000000000;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad diff --git a/vendor/jcalderonzumba/gastonjs/src/Browser/Browser.php b/vendor/jcalderonzumba/gastonjs/src/Browser/Browser.php new file mode 100644 index 000000000..5c2a3374e --- /dev/null +++ b/vendor/jcalderonzumba/gastonjs/src/Browser/Browser.php @@ -0,0 +1,120 @@ +phantomJSHost = $phantomJSHost; + $this->logger = $logger; + $this->debug = false; + $this->createApiClient(); + } + + /** + * Returns the value of a given element in a page + * @param $pageId + * @param $elementId + * @return mixed + */ + public function value($pageId, $elementId) { + return $this->command('value', $pageId, $elementId); + } + + /** + * Sets a value to a given element in a given page + * @param $pageId + * @param $elementId + * @param $value + * @return mixed + */ + public function set($pageId, $elementId, $value) { + return $this->command('set', $pageId, $elementId, $value); + } + + /** + * Tells whether an element on a page is visible or not + * @param $pageId + * @param $elementId + * @return bool + */ + public function isVisible($pageId, $elementId) { + return $this->command('visible', $pageId, $elementId); + } + + /** + * @param $pageId + * @param $elementId + * @return bool + */ + public function isDisabled($pageId, $elementId) { + return $this->command('disabled', $pageId, $elementId); + } + + /** + * Drag an element to a another in a given page + * @param $pageId + * @param $fromId + * @param $toId + * @return mixed + */ + public function drag($pageId, $fromId, $toId) { + return $this->command('drag', $pageId, $fromId, $toId); + } + + /** + * Selects a value in the given element and page + * @param $pageId + * @param $elementId + * @param $value + * @return mixed + */ + public function select($pageId, $elementId, $value) { + return $this->command('select', $pageId, $elementId, $value); + } + + /** + * Triggers an event to a given element on the given page + * @param $pageId + * @param $elementId + * @param $event + * @return mixed + */ + public function trigger($pageId, $elementId, $event) { + return $this->command('trigger', $pageId, $elementId, $event); + } + + /** + * TODO: not sure what this does, needs to do normalizeKeys + * @param int $pageId + * @param int $elementId + * @param array $keys + * @return mixed + */ + public function sendKeys($pageId, $elementId, $keys) { + return $this->command('send_keys', $pageId, $elementId, $this->normalizeKeys($keys)); + } +}