class Browser in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/jcalderonzumba/gastonjs/src/Browser/Browser.php \Zumba\GastonJS\Browser\Browser
Class Browser @package Zumba\GastonJS
Hierarchy
- class \Zumba\GastonJS\Browser\BrowserBase
- class \Zumba\GastonJS\Browser\Browser uses BrowserAuthenticationTrait, BrowserConfigurationTrait, BrowserCookieTrait, BrowserFileTrait, BrowserFrameTrait, BrowserHeadersTrait, BrowserMouseEventTrait, BrowserNavigateTrait, BrowserNetworkTrait, BrowserPageElementTrait, BrowserPageTrait, BrowserRenderTrait, BrowserScriptTrait, BrowserWindowTrait
Expanded class hierarchy of Browser
1 file declares its use of Browser
- BasePhantomJSDriver.php in vendor/
jcalderonzumba/ mink-phantomjs-driver/ src/ BasePhantomJSDriver.php
6 string references to 'Browser'
- AssertContentTrait::parse in core/
modules/ simpletest/ src/ AssertContentTrait.php - Parse content returned from curlExec using DOM and SimpleXML.
- CommentPagerTest::clickLinkWithXPath in core/
modules/ comment/ src/ Tests/ CommentPagerTest.php - Follows a link found at a give xpath query.
- ImageFieldWidgetTest::testWidgetElement in core/
modules/ image/ src/ Tests/ ImageFieldWidgetTest.php - Tests file widget element.
- WebTestBase::clickLinkHelper in core/
modules/ simpletest/ src/ WebTestBase.php - Provides a helper for ::clickLink() and ::clickLinkPartialName().
- WebTestBase::curlExec in core/
modules/ simpletest/ src/ WebTestBase.php - Initializes and executes a cURL request.
File
- vendor/
jcalderonzumba/ gastonjs/ src/ Browser/ Browser.php, line 9
Namespace
Zumba\GastonJS\BrowserView source
class Browser extends BrowserBase {
use BrowserAuthenticationTrait;
use BrowserConfigurationTrait;
use BrowserCookieTrait;
use BrowserFileTrait;
use BrowserFrameTrait;
use BrowserHeadersTrait;
use BrowserMouseEventTrait;
use BrowserNavigateTrait;
use BrowserNetworkTrait;
use BrowserPageElementTrait;
use BrowserPageTrait;
use BrowserRenderTrait;
use BrowserScriptTrait;
use BrowserWindowTrait;
/**
* @param string $phantomJSHost
* @param mixed $logger
*/
public function __construct($phantomJSHost, $logger = null) {
$this->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));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Browser:: |
public | function | Drag an element to a another in a given page | |
Browser:: |
public | function | ||
Browser:: |
public | function |
Tells whether an element on a page is visible or not Overrides BrowserPageElementTrait:: |
|
Browser:: |
public | function | Selects a value in the given element and page | |
Browser:: |
public | function | TODO: not sure what this does, needs to do normalizeKeys | |
Browser:: |
public | function | Sets a value to a given element in a given page | |
Browser:: |
public | function | Triggers an event to a given element on the given page | |
Browser:: |
public | function | Returns the value of a given element in a page | |
Browser:: |
public | function | ||
BrowserAuthenticationTrait:: |
public | function | Sets basic HTTP authentication | |
BrowserBase:: |
protected | property | @var Client | |
BrowserBase:: |
protected | property | @var bool | |
BrowserBase:: |
protected | property | @var mixed | |
BrowserBase:: |
protected | property | @var string | |
BrowserBase:: |
public | function | Sends a command to the browser | |
BrowserBase:: |
protected | function | Creates an http client to consume the phantomjs API | |
BrowserBase:: |
public | function | ||
BrowserBase:: |
protected | function | ||
BrowserBase:: |
public | function | ||
BrowserBase:: |
public | function | ||
BrowserBase:: |
protected | function | TODO: not sure how to do the normalizeKeys stuff fix when needed | |
BrowserBase:: |
public | function | Restarts the browser | |
BrowserConfigurationTrait:: |
public | function | Set the debug mode on the browser | |
BrowserConfigurationTrait:: |
public | function | Set whether to fail or not on javascript errors found on the page | |
BrowserConfigurationTrait:: |
public | function | Set a blacklist of urls that we are not supposed to load | |
BrowserCookieTrait:: |
public | function | Clear all the cookies | |
BrowserCookieTrait:: |
public | function | Gets the cookies on the browser | |
BrowserCookieTrait:: |
public | function | Enables or disables the cookies con phantomjs | |
BrowserCookieTrait:: |
public | function | Deletes a cookie on the browser if exists | |
BrowserCookieTrait:: |
public | function | Sets a cookie on the browser, expires times is set in seconds | |
BrowserFileTrait:: |
public | function | Selects a file to send to the browser to a given page | |
BrowserFrameTrait:: |
public | function | Back to the parent of the iframe if possible | |
BrowserFrameTrait:: |
public | function | Goes into the iframe to do stuff | |
BrowserHeadersTrait:: |
public | function | Adds a header to the page making it permanent if needed | |
BrowserHeadersTrait:: |
public | function | Adds headers to current page overriding the existing ones for the next requests | |
BrowserHeadersTrait:: |
public | function | Returns the headers of the current page that will be used the next request | |
BrowserHeadersTrait:: |
public | function | Gets the response headers after a request | |
BrowserHeadersTrait:: |
public | function | Given an array of headers, set such headers for the requests, removing all others | |
BrowserMouseEventTrait:: |
public | function | Click on a given page and element | |
BrowserMouseEventTrait:: |
public | function | Click on given coordinates, THIS DOES NOT depend on the page, it just clicks on where we are right now | |
BrowserMouseEventTrait:: |
public | function | Triggers a double click in a given page and element | |
BrowserMouseEventTrait:: |
public | function | Hovers over an element in a given page | |
BrowserMouseEventTrait:: |
public | function | Triggers a right click on a page an element | |
BrowserMouseEventTrait:: |
public | function | Scrolls the page by a given left and top coordinates | |
BrowserNavigateTrait:: |
public | function | Gets the current url we are in | |
BrowserNavigateTrait:: |
public | function | Goes back on the browser history if possible | |
BrowserNavigateTrait:: |
public | function | Goes forward on the browser history if possible | |
BrowserNavigateTrait:: |
public | function | Reloads the current page we are in | |
BrowserNavigateTrait:: |
public | function | Send a visit command to the browser | |
BrowserNetworkTrait:: |
public | function | Clear the network traffic data stored on the phantomjs code | |
BrowserNetworkTrait:: |
public | function | Get all the network traffic that the page have created | |
BrowserPageElementTrait:: |
public | function | Returns the inner or outer html of the given page and element | |
BrowserPageElementTrait:: |
public | function | Returns the text of a given page and element | |
BrowserPageElementTrait:: |
public | function | Returns the attribute of an element by name in a given page | |
BrowserPageElementTrait:: |
public | function | Returns the attributes of an element in a given page | |
BrowserPageElementTrait:: |
public | function | Deletes the text of a given page and element | |
BrowserPageElementTrait:: |
public | function | Check if two elements are the same on a give | |
BrowserPageElementTrait:: |
public | function | Find elements given a method and a selector | |
BrowserPageElementTrait:: |
public | function | Find elements within a page, method and selector | |
BrowserPageElementTrait:: |
public | function | ||
BrowserPageElementTrait:: |
public | function | Sends the order to execute a key event on a given element | |
BrowserPageElementTrait:: |
public | function | Remove an attribute for a given page and element | |
BrowserPageElementTrait:: |
public | function | Sends the command to select and option given a value | |
BrowserPageElementTrait:: |
public | function | Set an attribute to the given element in the given page | |
BrowserPageElementTrait:: |
public | function | Gets the tag name of a given element and page | |
BrowserPageElementTrait:: |
public | function | Returns ONLY the visible text of a given page and element | |
BrowserPageTrait:: |
public | function | Returns the body of the response to a given browser request | |
BrowserPageTrait:: |
public | function | Returns the source of the current page | |
BrowserPageTrait:: |
public | function | Gets the status code of the request we are currently in | |
BrowserPageTrait:: |
public | function | Gets the current page title | |
BrowserPageTrait:: |
public | function | Resets the page we are in to a clean slate | |
BrowserPageTrait:: |
public | function | Resize the current page | |
BrowserRenderTrait:: |
protected | function | Check and fix render options | |
BrowserRenderTrait:: |
public | function | Renders a page or selection to a file given by path | |
BrowserRenderTrait:: |
public | function | Renders base64 a page or selection to a file given by path | |
BrowserRenderTrait:: |
public | function | Sets the paper size, useful when saving to PDF | |
BrowserScriptTrait:: |
public | function | Evaluates a script on the browser | |
BrowserScriptTrait:: |
public | function | Executes a script on the browser | |
BrowserScriptTrait:: |
public | function | Add desired extensions to phantomjs | |
BrowserWindowTrait:: |
public | function | Closes a window on the browser by a given handler name | |
BrowserWindowTrait:: |
public | function | Opens a new window on the browser | |
BrowserWindowTrait:: |
public | function | Zoom factor for a web page | |
BrowserWindowTrait:: |
public | function | Change the browser focus to another window | |
BrowserWindowTrait:: |
public | function | Returns the current window handle name in the browser | |
BrowserWindowTrait:: |
public | function | Returns all the window handles present in the browser | |
BrowserWindowTrait:: |
public | function | Gets the current request window name | |
BrowserWindowTrait:: |
public | function | Gets the window size |