PHP Class WebDriver\SauceLabs\SauceRest

Afficher le fichier Open project: instaclick/php-webdriver Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( string $userId, string $accessKey ) Constructor
createSubAccount ( array $accountInfo ) : array Create new sub-account: /rest/v1/users/:userId (POST)
deleteJob ( string $jobId ) : array Delete job: /rest/v1/:userId/jobs/:jobId (DELETE)
getAccountDetails ( string $userId ) : array Get account details: /rest/v1/users/:userId (GET)
getAccountLimits ( ) : array Check account limits: /rest/v1/limits (GET)
getActivity ( ) : array Get current account activity: /rest/v1/:userId/activity (GET)
getBrowsers ( string $termination = false ) : array Get currently supported browsers: /rest/v1/info/browsers (GET)
getCounter ( ) : array Get number of tests executed so far on Sauce Labs: /rest/v1/info/counter (GET)
getJob ( string $jobId ) : array Get full information for job: /rest/v1/:userId/jobs/:jobId (GET)
getJobs ( boolean $full = null ) : array Get jobs: /rest/v1/:userId/jobs (GET)
getStatus ( ) : array Get current status of Sauce Labs' services: /rest/v1/info/status (GET)
getTunnel ( string $tunnelId ) : array Get full information for a tunnel: /rest/v1/:userId/tunnels/:tunnelId (GET)
getTunnels ( ) : array Get running tunnels for a given user: /rest/v1/:userId/tunnels (GET)
getUsage ( string $start = null, string $end = null ) : array Get historical account usage: /rest/v1/:userId/usage (GET)
shutdownTunnel ( string $tunnelId ) : array Shut down a tunnel: /rest/v1/:userId/tunnels/:tunnelId (DELETE)
stopJob ( string $jobId ) : array Stop job: /rest/v1/:userId/jobs/:jobId/stop (PUT)
unsubscribeSubAccount ( string $userId ) : array Unsubscribe a sub-account: /rest/v1/users/:userId/subscription (DELETE)
updateJob ( string $jobId, array $jobInfo ) : array Update existing job: /rest/v1/:userId/jobs/:jobId (PUT)
updateSubAccount ( string $userId, string $plan ) : array Update sub-account service plan: /rest/v1/users/:userId/subscription (POST)

Méthodes protégées

Méthode Description
execute ( string $requestMethod, string $url, mixed $parameters = null ) : mixed Execute Sauce Labs REST API command

Method Details

__construct() public méthode

Constructor
public __construct ( string $userId, string $accessKey )
$userId string Your Sauce user name
$accessKey string Your Sauce API key

createSubAccount() public méthode

For "partners", $accountInfo also contains 'plan' => (one of 'free', 'small', 'team', 'com', or 'complus')
public createSubAccount ( array $accountInfo ) : array
$accountInfo array array('username' => ..., 'password' => ..., 'name' => ..., 'email' => ...)
Résultat array array('access_key' => ..., 'minutes' => ..., 'id' => ...)

deleteJob() public méthode

Delete job: /rest/v1/:userId/jobs/:jobId (DELETE)
public deleteJob ( string $jobId ) : array
$jobId string
Résultat array

execute() protected méthode

Execute Sauce Labs REST API command
See also: http://saucelabs.com/docs/saucerest
protected execute ( string $requestMethod, string $url, mixed $parameters = null ) : mixed
$requestMethod string HTTP request method
$url string URL
$parameters mixed Parameters
Résultat mixed

getAccountDetails() public méthode

Get account details: /rest/v1/users/:userId (GET)
public getAccountDetails ( string $userId ) : array
$userId string
Résultat array

getAccountLimits() public méthode

Check account limits: /rest/v1/limits (GET)
public getAccountLimits ( ) : array
Résultat array

getActivity() public méthode

Get current account activity: /rest/v1/:userId/activity (GET)
public getActivity ( ) : array
Résultat array

getBrowsers() public méthode

Get currently supported browsers: /rest/v1/info/browsers (GET)
public getBrowsers ( string $termination = false ) : array
$termination string Optional termination (one of "all", "selenium-rc", or "webdriver')
Résultat array

getCounter() public méthode

Get number of tests executed so far on Sauce Labs: /rest/v1/info/counter (GET)
public getCounter ( ) : array
Résultat array

getJob() public méthode

Get full information for job: /rest/v1/:userId/jobs/:jobId (GET)
public getJob ( string $jobId ) : array
$jobId string
Résultat array

getJobs() public méthode

Get jobs: /rest/v1/:userId/jobs (GET)
public getJobs ( boolean $full = null ) : array
$full boolean
Résultat array

getStatus() public méthode

Get current status of Sauce Labs' services: /rest/v1/info/status (GET)
public getStatus ( ) : array
Résultat array array('wait_time' => ..., 'service_operational' => ..., 'status_message' => ...)

getTunnel() public méthode

Get full information for a tunnel: /rest/v1/:userId/tunnels/:tunnelId (GET)
public getTunnel ( string $tunnelId ) : array
$tunnelId string
Résultat array

getTunnels() public méthode

Get running tunnels for a given user: /rest/v1/:userId/tunnels (GET)
public getTunnels ( ) : array
Résultat array

getUsage() public méthode

Get historical account usage: /rest/v1/:userId/usage (GET)
public getUsage ( string $start = null, string $end = null ) : array
$start string Optional start date YYYY-MM-DD
$end string Optional end date YYYY-MM-DD
Résultat array

shutdownTunnel() public méthode

Shut down a tunnel: /rest/v1/:userId/tunnels/:tunnelId (DELETE)
public shutdownTunnel ( string $tunnelId ) : array
$tunnelId string
Résultat array

stopJob() public méthode

Stop job: /rest/v1/:userId/jobs/:jobId/stop (PUT)
public stopJob ( string $jobId ) : array
$jobId string
Résultat array

unsubscribeSubAccount() public méthode

Unsubscribe a sub-account: /rest/v1/users/:userId/subscription (DELETE)
public unsubscribeSubAccount ( string $userId ) : array
$userId string User ID
Résultat array

updateJob() public méthode

Update existing job: /rest/v1/:userId/jobs/:jobId (PUT)
public updateJob ( string $jobId, array $jobInfo ) : array
$jobId string Job ID
$jobInfo array Job information
Résultat array

updateSubAccount() public méthode

Update sub-account service plan: /rest/v1/users/:userId/subscription (POST)
public updateSubAccount ( string $userId, string $plan ) : array
$userId string User ID
$plan string Plan
Résultat array