alexschwarz89 / browserstack
Client library for Browserstack Screenshot API
Installs: 5 784
Dependents: 0
Suggesters: 0
Security: 0
Stars: 7
Watchers: 5
Forks: 2
Open Issues: 0
Requires
- php: >=5.3.3
- tzfrs/curl: 1.0
Requires (Dev)
- phpunit/phpunit: 4.4.0
This package is not auto-updated.
Last update: 2024-11-09 17:14:19 UTC
README
An easy-to-use PHP library for the Browserstack Screenshots API. Working examples included.
Install
Install via composer:
{ "require": { "alexschwarz89/browserstack": "0.0.2" } }
Run composer install
.
Example usage
Get an array of available browsers
use Alexschwarz89\Browserstack\Screenshots\Api; $api = new Api('username', 'password'); $browserList = $api->getBrowsers();
Generate a screenshot
use Alexschwarz89\Browserstack\Screenshots\Api; use Alexschwarz89\Browserstack\Screenshots\Request; $api = new Api('account', 'password'); $request = Request::buildRequest('http://www.example.org', 'Windows', '8.1', 'ie', '11.0'); $response = $api->sendRequest( $request ); $jobId = $response->jobId;
Query information about the request
$status = $api->getJobStatus('browserstack_jobid'); if ($status->isFinished()) { foreach ($status->finishedScreenshots as $screenshot) { print $screenshot->image_url ."\n"; } }