testingbot / testingbot-php
TestingBot API 的 PHP 版本
Requires
- php: >=5.4.0
- appium/php-client: >=0.1.0
- brianium/paratest: >=0.12.1
- phpunit/phpunit-selenium: >=1.4.1
Requires (Dev)
- phpunit/phpunit: >=4.5.1
This package is auto-updated.
Last update: 2024-09-24 14:04:26 UTC
README
这是 TestingBot PHP 客户端,它使得与 TestingBot API 交互变得简单
许可证
Testingbot-PHP 在 Apache 2 许可证下可用。有关详细信息,请参阅 LICENSE.APACHE2
用法
TestingBot-PHP 与 Composer 一起分发,这意味着您可以将它包含在项目中
composer require testingbot/testingbot-php
或编辑 composer.json
文件并添加
{ "require": { "testingbot/testingbot-php": ">=1.0.0" } }
首先,创建一个新的 TestingBot\TestingBotAPI
对象,并传入您从 TestingBot 获得的密钥和密钥
$api = new TestingBot\TestingBotAPI($key, $secret);
现在您可以使用我们提供的各种方法与 API 交互
getBrowsers
获取可以测试的浏览器列表
$api->getBrowsers();
getDevices
获取可以测试的设备列表
$api->getDevices();
getAvailableDevices
获取可以测试的可用设备列表
$api->getAvailableDevices();
getDevice
获取特定设备的信息
$api->getDevice($deviceID);
getUserInfo
获取您的用户信息
$api->getUserInfo();
updateUserInfo
更新您的用户信息
$api->updateUserInfo(array('first_name' => 'test'));
updateJob
更新测试的元数据以在 TestingBot 上显示。例如,您可以指定测试名称以及测试是否成功或失败
$api->updateJob($webdriverSessionID, array('name' => 'mytest', 'success' => true));
getJob
通过传递在 TestingBot 上运行的测试的 WebDriver 会话ID,获取作业(测试)的元信息
$api->getJob($webdriverSessionID);
getJobs
获取您在 TestingBot 上运行的所有先前作业/测试列表,按最后运行顺序排列
$api->getJobs(0, 10); // last 10 tests
deleteJob
从 TestingBot 中删除测试
$api->deleteJob($webdriverSessionID);
stopJob
停止在 TestingBot 上运行测试
$api->stopJob($webdriverSessionID);
getBuilds
获取您在 TestingBot 上运行的所有构建列表,按最后运行顺序排列
$api->getBuilds(0, 10); // last 10 builds
getBuild
从 TestingBot 获取构建(一组测试)
$api->getBuild($buildIdentifier);
deleteBuild
从 TestingBot 中删除构建。
$api->deleteBuild($buildIdentifier);
getTunnels
获取您账户的活跃隧道列表。
$api->getTunnels();
deleteTunnel
删除一个活跃隧道。
$api->deleteTunnel($tunnelID);
uploadLocalFileToStorage
将本地文件 (.apk, .ipa, .zip) 上传到 TestingBot 存储。
$api->uploadLocalFileToStorage($pathToLocalFile);
uploadRemoteFileToStorage
将远程文件 (.apk, .ipa, .zip) 上传到 TestingBot 存储。
$api->uploadRemoteFileToStorage($urlToRemoteFile);
getStorageFile
从先前上传到 TestingBot 存储的文件获取元数据。AppUrl 是您之前从 TestingBot API 收到的 tb://
url。
$api->getStorageFile($appUrl);
getStorageFiles
从先前上传到 TestingBot 存储的所有文件获取元数据。
$api->getStorageFiles();
deleteStorageFile
删除先前上传到 TestingBot 存储的文件。AppUrl 是您之前从 TestingBot API 收到的 tb://
url。
$api->deleteStorageFile($appUrl);
getAuthenticationHash
计算与其他人共享测试所需的哈希值
$api->getAuthenticationHash($identifier);