alexschwarz89 / browserstack
此包最新版本(0.0.2)没有提供许可证信息。
Browserstack截图API客户端库
0.0.2
2015-01-21 09:31 UTC
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-09-14 16:34:38 UTC
README
一个易于使用的PHP库,用于Browserstack Screenshots API。包含工作示例。
安装
通过 Composer 安装
{ "require": { "alexschwarz89/browserstack": "0.0.2" } }
运行 composer install
。
示例用法
获取可用浏览器的数组
use Alexschwarz89\Browserstack\Screenshots\Api; $api = new Api('username', 'password'); $browserList = $api->getBrowsers();
生成截图
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;
查询请求信息
$status = $api->getJobStatus('browserstack_jobid'); if ($status->isFinished()) { foreach ($status->finishedScreenshots as $screenshot) { print $screenshot->image_url ."\n"; } }