Title: | R Wrapper for 'SauceLabs' REST API |
---|---|
Description: | Retrieve, update, delete job information from <https://saucelabs.com/>. Poll the 'SauceLabs' services current status and access supported platforms. Send and retrieve files from 'SauceLabs' and manage tunnels associated with 'SauceConnect'. |
Authors: | John Harrison [aut, cre] |
Maintainer: | John Harrison <[email protected]> |
License: | GPL-3 |
Version: | 0.1.7 |
Built: | 2024-11-18 05:24:20 UTC |
Source: | https://github.com/johndharrison/rsaucelabs |
Creates a wrapper around the httr authenticate
function. Adds an "account" class.
account(user = Sys.getenv("SLUSER"), password = Sys.getenv("SLPASS"))
account(user = Sys.getenv("SLUSER"), password = Sys.getenv("SLPASS"))
user |
The SauceLabs user. By default an environmental variable "SLUSER" is looked for. |
password |
The SauceLabs password for user. By default an environmental variable "SLPASS" is looked for. |
returns an object of class "account".
## Not run: myAcc <- account() ## End(Not run)
## Not run: myAcc <- account() ## End(Not run)
Change access key of an account
changeAccessKey(account, username = Sys.getenv("SLUSER"), ...)
changeAccessKey(account, username = Sys.getenv("SLUSER"), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
... |
Additonal function arguments - Currently unused. |
Other accountMethods: createUser
,
getListOfSiblingAccounts
,
getListOfSubAccounts
,
getSubAccountInformation
,
getUserConcurrency
, getUser
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
Create a sub account
createUser(account, username = Sys.getenv("SLUSER"), newUsername, password, name, email, ...)
createUser(account, username = Sys.getenv("SLUSER"), newUsername, password, name, email, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
newUsername |
The username of the new user you wish to create |
password |
The password for the new user you wish to create |
name |
The name of the new user you wish to create |
email |
The email of the new user you wish to create |
... |
Additonal function arguments - Currently unused. |
Other accountMethods: changeAccessKey
,
getListOfSiblingAccounts
,
getListOfSubAccounts
,
getSubAccountInformation
,
getUserConcurrency
, getUser
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
Removes the job from the system with all the linked assets
deleteJob(account, username = Sys.getenv("SLUSER"), jobID, ...)
deleteJob(account, username = Sys.getenv("SLUSER"), jobID, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
jobID |
Id of the job to delete |
... |
Additonal function arguments - Currently unused. |
Other jobMethods: deleteJobAssets
,
getJobAssetFiles
,
getJobAssetNames
, getJobs
,
stopJob
, updateJob
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
Delete all the assets captured during a test run. This includes the screencast recording, logs, and all screenshots.
deleteJobAssets(account, username = Sys.getenv("SLUSER"), jobID, ...)
deleteJobAssets(account, username = Sys.getenv("SLUSER"), jobID, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
jobID |
Id of the job to delete assests from |
... |
Additonal function arguments - Currently unused. |
Other jobMethods: deleteJob
,
getJobAssetFiles
,
getJobAssetNames
, getJobs
,
stopJob
, updateJob
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
Shuts down a tunnel given its ID
deleteTunnel(account, username = Sys.getenv("SLUSER"), tunnelID, ...)
deleteTunnel(account, username = Sys.getenv("SLUSER"), tunnelID, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
tunnelID |
id of the tunnel to shutdown |
... |
Additonal function arguments - Currently unused. |
Other tunnelMethods: getTunnels
,
getTunnel
## Not run: myAcc <- account() myTunnels <- getTunnels(myAcc) #> myTunnels #list() # A tunnel needs to be started with sauceConnect # ./sc-4.3.16-linux/bin/sc -u seleniumPipes -k ##########-####-####-####-####### # we start one myTunnels <- getTunnels(myAcc) #> myTunnels #[[1]] #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" tunnelInfo <- getTunnel(myAcc, tunnelID = myTunnels[[1]]) #> tunnelInfo[c("status", "host", "owner", "id")] #$status #[1] "running" # #$host #[1] "maki81013.miso.saucelabs.com" # #$owner #[1] "seleniumPipes" # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" res <- deleteTunnel(myAcc, tunnelID = myTunnels[[1]]) #> res #$jobs_running #[1] 0 # #$result #[1] TRUE # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" #> getTunnels(myAcc) #list() ## End(Not run)
## Not run: myAcc <- account() myTunnels <- getTunnels(myAcc) #> myTunnels #list() # A tunnel needs to be started with sauceConnect # ./sc-4.3.16-linux/bin/sc -u seleniumPipes -k ##########-####-####-####-####### # we start one myTunnels <- getTunnels(myAcc) #> myTunnels #[[1]] #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" tunnelInfo <- getTunnel(myAcc, tunnelID = myTunnels[[1]]) #> tunnelInfo[c("status", "host", "owner", "id")] #$status #[1] "running" # #$host #[1] "maki81013.miso.saucelabs.com" # #$owner #[1] "seleniumPipes" # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" res <- deleteTunnel(myAcc, tunnelID = myTunnels[[1]]) #> res #$jobs_running #[1] 0 # #$result #[1] TRUE # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" #> getTunnels(myAcc) #list() ## End(Not run)
Get a list of Appium end-of-life dates. Dates are displayed in Unix time.
getAppiumEolDates(account, ...)
getAppiumEolDates(account, ...)
account |
An object of class "account". An account object see |
... |
Additonal function arguments - Currently unused. |
Other infoMethods: getSauceLabsStatus
,
getSupportedPlatforms
## Not run: myAcc <- account() getSauceLabsStatus(myAcc) #$wait_time #[1] 1580.536 # #$service_operational #[1] TRUE # #$status_message #[1] "Basic service status checks passed." supportedPlatforms <- getSupportedPlatforms(myAcc) supportedPlatforms[os == "Linux" & api_name == "chrome" & short_version > 44 , .(api_name, long_version)] #api_name long_version #1: chrome 45.0.2454.85. #2: chrome 46.0.2490.71 #3: chrome 47.0.2526.73 #4: chrome 48.0.2564.97 getAppiumEolDates(myAcc) #$`1.4.0` #[1] "2016-04-09 PDT" # #$`1.4.3` #[1] "2016-04-09 PDT" #.... ## End(Not run)
## Not run: myAcc <- account() getSauceLabsStatus(myAcc) #$wait_time #[1] 1580.536 # #$service_operational #[1] TRUE # #$status_message #[1] "Basic service status checks passed." supportedPlatforms <- getSupportedPlatforms(myAcc) supportedPlatforms[os == "Linux" & api_name == "chrome" & short_version > 44 , .(api_name, long_version)] #api_name long_version #1: chrome 45.0.2454.85. #2: chrome 46.0.2490.71 #3: chrome 47.0.2526.73 #4: chrome 48.0.2564.97 getAppiumEolDates(myAcc) #$`1.4.0` #[1] "2016-04-09 PDT" # #$`1.4.3` #[1] "2016-04-09 PDT" #.... ## End(Not run)
Download job assets. After a job completes, all assets created during the job are available via this API. These include the screencast recording, logs, and screenshots taken on crucial steps. The job assests will be deleted from the test page after 30 days. Thus, after 30 days all your test commands, logs, screenshots and the screencast recording will be gone. This is the reason why we strongly recommend to download your job assets if this is an information that you must keep in your records.
getJobAssetFiles(account, username = Sys.getenv("SLUSER"), jobID, fileName = "selenium-server.log", ...)
getJobAssetFiles(account, username = Sys.getenv("SLUSER"), jobID, fileName = "selenium-server.log", ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
jobID |
Id of the job to get assets from |
fileName |
Accepted Values for fileName "selenium-server.log" "video.flv" "XXXXscreenshot.png" (where XXXX is a number between 0000 and 9999) "final_screenshot.png" |
... |
Additonal function arguments - Currently unused. |
Other jobMethods: deleteJobAssets
,
deleteJob
, getJobAssetNames
,
getJobs
, stopJob
,
updateJob
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
Get details about the static assets collected for a specific job
getJobAssetNames(account, username = Sys.getenv("SLUSER"), jobID, ...)
getJobAssetNames(account, username = Sys.getenv("SLUSER"), jobID, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
jobID |
Id of the job to stop |
... |
Additonal function arguments - Currently unused. |
Other jobMethods: deleteJobAssets
,
deleteJob
, getJobAssetFiles
,
getJobs
, stopJob
,
updateJob
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
List recent jobs belonging to a specific user
getJobs(account, username = Sys.getenv("SLUSER"), limit = 100L, getFullJobs = FALSE, skipJobs = 0L, to = NULL, from = NULL, ...)
getJobs(account, username = Sys.getenv("SLUSER"), limit = 100L, getFullJobs = FALSE, skipJobs = 0L, to = NULL, from = NULL, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
limit |
Specifies the number of jobs to return. Default is 100 and max is 500. |
getFullJobs |
Get full job information, rather than just IDs. Default is FALSE. |
skipJobs |
Skips the specified number of jobs. Default is 0. |
to |
Get jobs until the specified time (POSIXct) |
from |
Get jobs since the specified time (POSIXct) |
... |
Additonal function arguments - Currently unused. |
returns a named list. "data" is the job data minus the tags and custom-data. tagsAndCD are a list of tags and custom-data for each job. If getFullJobs = FALSE then data only contains the job ids and tagsAndCD contains empty lists for each job.
Other jobMethods: deleteJobAssets
,
deleteJob
, getJobAssetFiles
,
getJobAssetNames
, stopJob
,
updateJob
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
Get the status of your JS unit tests
getJsUnitTestStatus(account, username = Sys.getenv("SLUSER"), js_tests, ...)
getJsUnitTestStatus(account, username = Sys.getenv("SLUSER"), js_tests, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
js_tests |
a vector of job ids. |
... |
Additonal function arguments - Currently unused. |
Other jsUnitTestMethods: startJsUnitTests
## Not run: # use test example from #https://wiki.saucelabs.com/display/DOCS/JavaScript+Unit+Testing+Methods platforms <- list(c("Windows 7", "firefox", "27"), c("Linux", "googlechrome", "") ) appUrl <- "https://saucelabs.com/test_helpers/front_tests/index.html" framework <- "jasmine" myAcc <- account() myTest <- startJsUnitTests(myAcc, platforms = platforms, url = appUrl, framework = framework) #> unlist(myTest, use.names = FALSE) #[1] "bc8b9ef6e6184ed8a7e5270344115999" "bf43cef30bca429eaa2ed08da09dbdce" testIds <- unlist(myTest, use.names = FALSE) testRes <- getJsUnitTestStatus(myAcc,js_tests = testIds) ## End(Not run)
## Not run: # use test example from #https://wiki.saucelabs.com/display/DOCS/JavaScript+Unit+Testing+Methods platforms <- list(c("Windows 7", "firefox", "27"), c("Linux", "googlechrome", "") ) appUrl <- "https://saucelabs.com/test_helpers/front_tests/index.html" framework <- "jasmine" myAcc <- account() myTest <- startJsUnitTests(myAcc, platforms = platforms, url = appUrl, framework = framework) #> unlist(myTest, use.names = FALSE) #[1] "bc8b9ef6e6184ed8a7e5270344115999" "bf43cef30bca429eaa2ed08da09dbdce" testIds <- unlist(myTest, use.names = FALSE) testRes <- getJsUnitTestStatus(myAcc,js_tests = testIds) ## End(Not run)
Get a list of sibling accounts associated with provided account
getListOfSiblingAccounts(account, username = Sys.getenv("SLUSER"), page = NULL, per_page = 50L, ...)
getListOfSiblingAccounts(account, username = Sys.getenv("SLUSER"), page = NULL, per_page = 50L, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
page |
optional defaults to NULL |
per_page |
results per page (max 50L). Defaults to 50L |
... |
Additonal function arguments - Currently unused. |
Other accountMethods: changeAccessKey
,
createUser
,
getListOfSubAccounts
,
getSubAccountInformation
,
getUserConcurrency
, getUser
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
Get a list of sub accounts associated with a parent account
getListOfSubAccounts(account, username = Sys.getenv("SLUSER"), from = NULL, limit = 100L, ...)
getListOfSubAccounts(account, username = Sys.getenv("SLUSER"), from = NULL, limit = 100L, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
from |
Get user from this user number. Defaults to NULL |
limit |
The limit on users returned. Defaults to 50L (50L is the max). |
... |
Additonal function arguments - Currently unused. |
Other accountMethods: changeAccessKey
,
createUser
,
getListOfSiblingAccounts
,
getSubAccountInformation
,
getUserConcurrency
, getUser
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
Get information about concurrency, minutes and jobs used by the user over a specific duration (default 90 days). Concurrency is separated in mean and peak concurrency.
getRealTimeJobActivity(account, username = Sys.getenv("SLUSER"), ...)
getRealTimeJobActivity(account, username = Sys.getenv("SLUSER"), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
... |
Additonal function arguments - Currently unused. |
Other actUsageMethods: getUserAccountUsage
,
getUserActivity
## Not run: myAcc <- account() jobActivity <- getRealTimeJobActivity(myAcc) #> jobActivity$concurrency$self$allowed #$manual #[1] 5 # #$mac #[1] 5 # #$overall #[1] 5 # #$real_device #[1] 0 userActivity <- getUserActivity(myAcc) #> userActivity$subaccounts$rsaucelabs #$`in progress` #[1] 0 # #$all #[1] 0 # #$queued #[1] 0 userAccUsage <- getUserAccountUsage(myAcc) #> userAccUsage #user_name date no_of_jobs vm_minutes #1: seleniumPipes 2016-8-12 2 239 #2: seleniumPipes 2016-8-13 65 6399 #3: seleniumPipes 2016-8-15 36 7235 #4: seleniumPipes 2016-8-16 7 1101 ## End(Not run)
## Not run: myAcc <- account() jobActivity <- getRealTimeJobActivity(myAcc) #> jobActivity$concurrency$self$allowed #$manual #[1] 5 # #$mac #[1] 5 # #$overall #[1] 5 # #$real_device #[1] 0 userActivity <- getUserActivity(myAcc) #> userActivity$subaccounts$rsaucelabs #$`in progress` #[1] 0 # #$all #[1] 0 # #$queued #[1] 0 userAccUsage <- getUserAccountUsage(myAcc) #> userAccUsage #user_name date no_of_jobs vm_minutes #1: seleniumPipes 2016-8-12 2 239 #2: seleniumPipes 2016-8-13 65 6399 #3: seleniumPipes 2016-8-15 36 7235 #4: seleniumPipes 2016-8-16 7 1101 ## End(Not run)
Get the current status of Sauce Labs services
getSauceLabsStatus(account, ...)
getSauceLabsStatus(account, ...)
account |
An object of class "account". An account object see |
... |
Additonal function arguments - Currently unused. |
Other infoMethods: getAppiumEolDates
,
getSupportedPlatforms
## Not run: myAcc <- account() getSauceLabsStatus(myAcc) #$wait_time #[1] 1580.536 # #$service_operational #[1] TRUE # #$status_message #[1] "Basic service status checks passed." supportedPlatforms <- getSupportedPlatforms(myAcc) supportedPlatforms[os == "Linux" & api_name == "chrome" & short_version > 44 , .(api_name, long_version)] #api_name long_version #1: chrome 45.0.2454.85. #2: chrome 46.0.2490.71 #3: chrome 47.0.2526.73 #4: chrome 48.0.2564.97 getAppiumEolDates(myAcc) #$`1.4.0` #[1] "2016-04-09 PDT" # #$`1.4.3` #[1] "2016-04-09 PDT" #.... ## End(Not run)
## Not run: myAcc <- account() getSauceLabsStatus(myAcc) #$wait_time #[1] 1580.536 # #$service_operational #[1] TRUE # #$status_message #[1] "Basic service status checks passed." supportedPlatforms <- getSupportedPlatforms(myAcc) supportedPlatforms[os == "Linux" & api_name == "chrome" & short_version > 44 , .(api_name, long_version)] #api_name long_version #1: chrome 45.0.2454.85. #2: chrome 46.0.2490.71 #3: chrome 47.0.2526.73 #4: chrome 48.0.2564.97 getAppiumEolDates(myAcc) #$`1.4.0` #[1] "2016-04-09 PDT" # #$`1.4.3` #[1] "2016-04-09 PDT" #.... ## End(Not run)
Check which files are in your temporary storage
getStoredFiles(account, username = Sys.getenv("SLUSER"), ...)
getStoredFiles(account, username = Sys.getenv("SLUSER"), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
... |
Additonal function arguments - Currently unused. |
Other tempStorageMethods: uploadFile
## Not run: myAcc <- account() # create a temporary file myTempFile <- file.path(tempdir(), "notsecret.html") write("SUPER SECRET STUFF", myTempFile) # check stored files myStoredFiles <- getStoredFiles(myAcc) # upload new file res <- uploadFile(myAcc, file = myTempFile) #> res #$username #[1] "seleniumPipes" # #$size #[1] 19 # #$md5 #[1] "e459fe3803b78d64cc5c2998804909a9" # #$filename #[1] "notsecret.html" #> digest::digest(file = myTempFile, algo = "md5") #[1] "e459fe3803b78d64cc5c2998804909a9" myStoredFiles <- getStoredFiles(myAcc) #> rbindlist(myStoredFiles$files) #size mtime name md5 #1: 19 1472401537 notsecret.html e459fe3803b78d64cc5c2998804909a9 #2: 14 1472350499 testDoc.R adfc8afc373f0b3fd6f93c3891bdd11b ## End(Not run)
## Not run: myAcc <- account() # create a temporary file myTempFile <- file.path(tempdir(), "notsecret.html") write("SUPER SECRET STUFF", myTempFile) # check stored files myStoredFiles <- getStoredFiles(myAcc) # upload new file res <- uploadFile(myAcc, file = myTempFile) #> res #$username #[1] "seleniumPipes" # #$size #[1] 19 # #$md5 #[1] "e459fe3803b78d64cc5c2998804909a9" # #$filename #[1] "notsecret.html" #> digest::digest(file = myTempFile, algo = "md5") #[1] "e459fe3803b78d64cc5c2998804909a9" myStoredFiles <- getStoredFiles(myAcc) #> rbindlist(myStoredFiles$files) #size mtime name md5 #1: 19 1472401537 notsecret.html e459fe3803b78d64cc5c2998804909a9 #2: 14 1472350499 testDoc.R adfc8afc373f0b3fd6f93c3891bdd11b ## End(Not run)
Get information about a sub account
getSubAccountInformation(account, username = Sys.getenv("SLUSER"), ...)
getSubAccountInformation(account, username = Sys.getenv("SLUSER"), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
... |
Additonal function arguments - Currently unused. |
Other accountMethods: changeAccessKey
,
createUser
,
getListOfSiblingAccounts
,
getListOfSubAccounts
,
getUserConcurrency
, getUser
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
Get a list of objects describing all the OS and browser platforms currently supported on Sauce Labs. Choose the automation API you need, bearing in mind that WebDriver and Selenium RC are each compatible with a different set of platforms.
getSupportedPlatforms(account, autoAPI = "webdriver", ...)
getSupportedPlatforms(account, autoAPI = "webdriver", ...)
account |
An object of class "account". An account object see |
autoAPI |
Accepted Values for autoAPI "all", "appium", "webdriver". Defaults to "webdriver" |
... |
Additonal function arguments - Currently unused. |
Other infoMethods: getAppiumEolDates
,
getSauceLabsStatus
## Not run: myAcc <- account() getSauceLabsStatus(myAcc) #$wait_time #[1] 1580.536 # #$service_operational #[1] TRUE # #$status_message #[1] "Basic service status checks passed." supportedPlatforms <- getSupportedPlatforms(myAcc) supportedPlatforms[os == "Linux" & api_name == "chrome" & short_version > 44 , .(api_name, long_version)] #api_name long_version #1: chrome 45.0.2454.85. #2: chrome 46.0.2490.71 #3: chrome 47.0.2526.73 #4: chrome 48.0.2564.97 getAppiumEolDates(myAcc) #$`1.4.0` #[1] "2016-04-09 PDT" # #$`1.4.3` #[1] "2016-04-09 PDT" #.... ## End(Not run)
## Not run: myAcc <- account() getSauceLabsStatus(myAcc) #$wait_time #[1] 1580.536 # #$service_operational #[1] TRUE # #$status_message #[1] "Basic service status checks passed." supportedPlatforms <- getSupportedPlatforms(myAcc) supportedPlatforms[os == "Linux" & api_name == "chrome" & short_version > 44 , .(api_name, long_version)] #api_name long_version #1: chrome 45.0.2454.85. #2: chrome 46.0.2490.71 #3: chrome 47.0.2526.73 #4: chrome 48.0.2564.97 getAppiumEolDates(myAcc) #$`1.4.0` #[1] "2016-04-09 PDT" # #$`1.4.3` #[1] "2016-04-09 PDT" #.... ## End(Not run)
Get information for a tunnel given its ID
getTunnel(account, username = Sys.getenv("SLUSER"), tunnelID, ...)
getTunnel(account, username = Sys.getenv("SLUSER"), tunnelID, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
tunnelID |
id of the tunnel to get more information on |
... |
Additonal function arguments - Currently unused. |
Other tunnelMethods: deleteTunnel
,
getTunnels
## Not run: myAcc <- account() myTunnels <- getTunnels(myAcc) #> myTunnels #list() # A tunnel needs to be started with sauceConnect # ./sc-4.3.16-linux/bin/sc -u seleniumPipes -k ##########-####-####-####-####### # we start one myTunnels <- getTunnels(myAcc) #> myTunnels #[[1]] #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" tunnelInfo <- getTunnel(myAcc, tunnelID = myTunnels[[1]]) #> tunnelInfo[c("status", "host", "owner", "id")] #$status #[1] "running" # #$host #[1] "maki81013.miso.saucelabs.com" # #$owner #[1] "seleniumPipes" # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" res <- deleteTunnel(myAcc, tunnelID = myTunnels[[1]]) #> res #$jobs_running #[1] 0 # #$result #[1] TRUE # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" #> getTunnels(myAcc) #list() ## End(Not run)
## Not run: myAcc <- account() myTunnels <- getTunnels(myAcc) #> myTunnels #list() # A tunnel needs to be started with sauceConnect # ./sc-4.3.16-linux/bin/sc -u seleniumPipes -k ##########-####-####-####-####### # we start one myTunnels <- getTunnels(myAcc) #> myTunnels #[[1]] #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" tunnelInfo <- getTunnel(myAcc, tunnelID = myTunnels[[1]]) #> tunnelInfo[c("status", "host", "owner", "id")] #$status #[1] "running" # #$host #[1] "maki81013.miso.saucelabs.com" # #$owner #[1] "seleniumPipes" # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" res <- deleteTunnel(myAcc, tunnelID = myTunnels[[1]]) #> res #$jobs_running #[1] 0 # #$result #[1] TRUE # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" #> getTunnels(myAcc) #list() ## End(Not run)
Retrieves all running tunnels for a specific user
getTunnels(account, username = Sys.getenv("SLUSER"), ...)
getTunnels(account, username = Sys.getenv("SLUSER"), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
... |
Additonal function arguments - Currently unused. |
Other tunnelMethods: deleteTunnel
,
getTunnel
## Not run: myAcc <- account() myTunnels <- getTunnels(myAcc) #> myTunnels #list() # A tunnel needs to be started with sauceConnect # ./sc-4.3.16-linux/bin/sc -u seleniumPipes -k ##########-####-####-####-####### # we start one myTunnels <- getTunnels(myAcc) #> myTunnels #[[1]] #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" tunnelInfo <- getTunnel(myAcc, tunnelID = myTunnels[[1]]) #> tunnelInfo[c("status", "host", "owner", "id")] #$status #[1] "running" # #$host #[1] "maki81013.miso.saucelabs.com" # #$owner #[1] "seleniumPipes" # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" res <- deleteTunnel(myAcc, tunnelID = myTunnels[[1]]) #> res #$jobs_running #[1] 0 # #$result #[1] TRUE # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" #> getTunnels(myAcc) #list() ## End(Not run)
## Not run: myAcc <- account() myTunnels <- getTunnels(myAcc) #> myTunnels #list() # A tunnel needs to be started with sauceConnect # ./sc-4.3.16-linux/bin/sc -u seleniumPipes -k ##########-####-####-####-####### # we start one myTunnels <- getTunnels(myAcc) #> myTunnels #[[1]] #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" tunnelInfo <- getTunnel(myAcc, tunnelID = myTunnels[[1]]) #> tunnelInfo[c("status", "host", "owner", "id")] #$status #[1] "running" # #$host #[1] "maki81013.miso.saucelabs.com" # #$owner #[1] "seleniumPipes" # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" res <- deleteTunnel(myAcc, tunnelID = myTunnels[[1]]) #> res #$jobs_running #[1] 0 # #$result #[1] TRUE # #$id #[1] "cbfb1981c9dd45d1a1ecb9dc47de5ba4" #> getTunnels(myAcc) #list() ## End(Not run)
Access basic account information
getUser(account, username = Sys.getenv("SLUSER"), ...)
getUser(account, username = Sys.getenv("SLUSER"), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
... |
Additonal function arguments - Currently unused. |
Other accountMethods: changeAccessKey
,
createUser
,
getListOfSiblingAccounts
,
getListOfSubAccounts
,
getSubAccountInformation
,
getUserConcurrency
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
Access historical account usage data
getUserAccountUsage(account, username = Sys.getenv("SLUSER"), ...)
getUserAccountUsage(account, username = Sys.getenv("SLUSER"), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
... |
Additonal function arguments - Currently unused. |
The result is a breakdown summarizing the total number of jobs and VM time used, in seconds, by day.
Other actUsageMethods: getRealTimeJobActivity
,
getUserActivity
## Not run: myAcc <- account() jobActivity <- getRealTimeJobActivity(myAcc) #> jobActivity$concurrency$self$allowed #$manual #[1] 5 # #$mac #[1] 5 # #$overall #[1] 5 # #$real_device #[1] 0 userActivity <- getUserActivity(myAcc) #> userActivity$subaccounts$rsaucelabs #$`in progress` #[1] 0 # #$all #[1] 0 # #$queued #[1] 0 userAccUsage <- getUserAccountUsage(myAcc) #> userAccUsage #user_name date no_of_jobs vm_minutes #1: seleniumPipes 2016-8-12 2 239 #2: seleniumPipes 2016-8-13 65 6399 #3: seleniumPipes 2016-8-15 36 7235 #4: seleniumPipes 2016-8-16 7 1101 ## End(Not run)
## Not run: myAcc <- account() jobActivity <- getRealTimeJobActivity(myAcc) #> jobActivity$concurrency$self$allowed #$manual #[1] 5 # #$mac #[1] 5 # #$overall #[1] 5 # #$real_device #[1] 0 userActivity <- getUserActivity(myAcc) #> userActivity$subaccounts$rsaucelabs #$`in progress` #[1] 0 # #$all #[1] 0 # #$queued #[1] 0 userAccUsage <- getUserAccountUsage(myAcc) #> userAccUsage #user_name date no_of_jobs vm_minutes #1: seleniumPipes 2016-8-12 2 239 #2: seleniumPipes 2016-8-13 65 6399 #3: seleniumPipes 2016-8-15 36 7235 #4: seleniumPipes 2016-8-16 7 1101 ## End(Not run)
Get currently running job counts broken down by account and job status.
getUserActivity(account, username = Sys.getenv("SLUSER"), ...)
getUserActivity(account, username = Sys.getenv("SLUSER"), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
... |
Additonal function arguments - Currently unused. |
Other actUsageMethods: getRealTimeJobActivity
,
getUserAccountUsage
## Not run: myAcc <- account() jobActivity <- getRealTimeJobActivity(myAcc) #> jobActivity$concurrency$self$allowed #$manual #[1] 5 # #$mac #[1] 5 # #$overall #[1] 5 # #$real_device #[1] 0 userActivity <- getUserActivity(myAcc) #> userActivity$subaccounts$rsaucelabs #$`in progress` #[1] 0 # #$all #[1] 0 # #$queued #[1] 0 userAccUsage <- getUserAccountUsage(myAcc) #> userAccUsage #user_name date no_of_jobs vm_minutes #1: seleniumPipes 2016-8-12 2 239 #2: seleniumPipes 2016-8-13 65 6399 #3: seleniumPipes 2016-8-15 36 7235 #4: seleniumPipes 2016-8-16 7 1101 ## End(Not run)
## Not run: myAcc <- account() jobActivity <- getRealTimeJobActivity(myAcc) #> jobActivity$concurrency$self$allowed #$manual #[1] 5 # #$mac #[1] 5 # #$overall #[1] 5 # #$real_device #[1] 0 userActivity <- getUserActivity(myAcc) #> userActivity$subaccounts$rsaucelabs #$`in progress` #[1] 0 # #$all #[1] 0 # #$queued #[1] 0 userAccUsage <- getUserAccountUsage(myAcc) #> userAccUsage #user_name date no_of_jobs vm_minutes #1: seleniumPipes 2016-8-12 2 239 #2: seleniumPipes 2016-8-13 65 6399 #3: seleniumPipes 2016-8-15 36 7235 #4: seleniumPipes 2016-8-16 7 1101 ## End(Not run)
Check account concurrency limits
getUserConcurrency(account, username = Sys.getenv("SLUSER"), ...)
getUserConcurrency(account, username = Sys.getenv("SLUSER"), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
... |
Additonal function arguments - Currently unused. |
Other accountMethods: changeAccessKey
,
createUser
,
getListOfSiblingAccounts
,
getListOfSubAccounts
,
getSubAccountInformation
,
getUser
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
## Not run: myAcc <- account() appData <- getUser(myAcc) createUser(myAcc, newUsername = "superstartester", password = "johndoe" , name = "John", email = "[email protected]") # $errors # [1] "Subaccount capacity exhausted." uC <- getUserConcurrency(myAcc) #> rbindlist(uC$concurrency$self[c("allowed", "current")], fill = TRUE) #manual mac overall real_device #1: 5 5 5 0 #2: 0 0 0 NA users <- getListOfSubAccounts(myAcc) #> users$users_total #[1] 1 siblings <- getListOfSiblingAccounts(myAcc) #> getListOfSiblingAccounts(myAcc) #list() subAcc <- getSubAccountInformation(myAcc) # change accesskey for a user # changeAccessKey(myAcc, "rsaucelabs") ## End(Not run)
queryAPI
A function to send a query to SauceLabs. Intended for seleniumPipes
internal use mainly.
queryAPI(verb = GET, account, url, source, ...)
queryAPI(verb = GET, account, url, source, ...)
verb |
The http method to use. See |
account |
An object of class "account". An account object see |
url |
The url of the remote server endpoint. |
source |
The name of the RSauceLabs function that called queryDriver. |
... |
Additonal function arguments - Currently unused. |
The contents of the response from the remote server. See content
for details.
## Not run: # function intended for internal use ## End(Not run)
## Not run: # function intended for internal use ## End(Not run)
Start your JavaScript unit tests on as many browsers as you like with a single request
startJsUnitTests(account, username = Sys.getenv("SLUSER"), platforms, url, framework, ...)
startJsUnitTests(account, username = Sys.getenv("SLUSER"), platforms, url, framework, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
platforms |
A list of platforms (see example) |
url |
should point to the page that hosts your tests |
framework |
can be "qunit", "jasmine", "YUI Test", "mocha", or "custom" |
... |
Additonal function arguments - Currently unused. |
Other jsUnitTestMethods: getJsUnitTestStatus
## Not run: # use test example from #https://wiki.saucelabs.com/display/DOCS/JavaScript+Unit+Testing+Methods platforms <- list(c("Windows 7", "firefox", "27"), c("Linux", "googlechrome", "") ) appUrl <- "https://saucelabs.com/test_helpers/front_tests/index.html" framework <- "jasmine" myAcc <- account() myTest <- startJsUnitTests(myAcc, platforms = platforms, url = appUrl, framework = framework) #> unlist(myTest, use.names = FALSE) #[1] "bc8b9ef6e6184ed8a7e5270344115999" "bf43cef30bca429eaa2ed08da09dbdce" testIds <- unlist(myTest, use.names = FALSE) testRes <- getJsUnitTestStatus(myAcc,js_tests = testIds) ## End(Not run)
## Not run: # use test example from #https://wiki.saucelabs.com/display/DOCS/JavaScript+Unit+Testing+Methods platforms <- list(c("Windows 7", "firefox", "27"), c("Linux", "googlechrome", "") ) appUrl <- "https://saucelabs.com/test_helpers/front_tests/index.html" framework <- "jasmine" myAcc <- account() myTest <- startJsUnitTests(myAcc, platforms = platforms, url = appUrl, framework = framework) #> unlist(myTest, use.names = FALSE) #[1] "bc8b9ef6e6184ed8a7e5270344115999" "bf43cef30bca429eaa2ed08da09dbdce" testIds <- unlist(myTest, use.names = FALSE) testRes <- getJsUnitTestStatus(myAcc,js_tests = testIds) ## End(Not run)
Terminates a running job
stopJob(account, username = Sys.getenv("SLUSER"), jobID, ...)
stopJob(account, username = Sys.getenv("SLUSER"), jobID, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
jobID |
Id of the job to stop |
... |
Additonal function arguments - Currently unused. |
Other jobMethods: deleteJobAssets
,
deleteJob
, getJobAssetFiles
,
getJobAssetNames
, getJobs
,
updateJob
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
Edit an existing job
updateJob(account, username = Sys.getenv("SLUSER"), jobID, name = NULL, tags = NULL, public = NULL, passed = NULL, build = NULL, custom_data = NULL, ...)
updateJob(account, username = Sys.getenv("SLUSER"), jobID, name = NULL, tags = NULL, public = NULL, passed = NULL, build = NULL, custom_data = NULL, ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
jobID |
Id of the job to edit |
name |
Change the job name |
tags |
Change the job tags |
public |
Set job visibility to "public", "public restricted", "share" (true), "team" (false) or "private" |
passed |
Set whether the job passed or not on the user end |
build |
The build number tested by this test |
custom_data |
A set of key-value pairs with any extra info that a user would like to add to the job. Note that the max data allowed is 64KB |
... |
Additonal function arguments - Currently unused. |
Other jobMethods: deleteJobAssets
,
deleteJob
, getJobAssetFiles
,
getJobAssetNames
, getJobs
,
stopJob
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
## Not run: myAcc <- account() myJobs <- getJobs(myAcc) #> myJobs$data[1,] #id #1: 4152e0a185f945bfa43e091eef1e7c30 myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(id, browser)] #id browser #1: 4152e0a185f945bfa43e091eef1e7c30 googlechrome testId <- myJobs$data[1, id] #> myJobs$data[1,.(build, passed)] #build passed #1: 24 FALSE # update this job updateJob(myAcc, jobID = testId, passed = TRUE, build = 20) myJobs <- getJobs(myAcc, getFullJobs = TRUE) #> myJobs$data[1,.(build, passed)] #build passed #1: 20 TRUE # deleteJob(myAcc, jobID = testId) stopJob(myAcc, jobID = testId) jobAssets <- getJobAssetNames(myAcc, jobID = testId) #> jobAssets[["selenium-log"]] #[1] "selenium-server.log" jobLog <- getJobAssetFiles(myAcc, jobID = testId) # deleteJobAssets(myAcc, jobID = testId) ## End(Not run)
Uploads a file to the temporary sauce storage. The storage will only retain the files for seven days.
uploadFile(account, username = Sys.getenv("SLUSER"), file, SLfileName = basename(file), ...)
uploadFile(account, username = Sys.getenv("SLUSER"), file, SLfileName = basename(file), ...)
account |
An object of class "account". An account object see |
username |
SauceLabs username |
file |
file to upload |
SLfileName |
name to give the file on SauceLabs. (Defaults to the current name of the file) |
... |
Additonal function arguments - Currently unused. |
Other tempStorageMethods: getStoredFiles
## Not run: myAcc <- account() # create a temporary file myTempFile <- file.path(tempdir(), "notsecret.html") write("SUPER SECRET STUFF", myTempFile) # check stored files myStoredFiles <- getStoredFiles(myAcc) # upload new file res <- uploadFile(myAcc, file = myTempFile) #> res #$username #[1] "seleniumPipes" # #$size #[1] 19 # #$md5 #[1] "e459fe3803b78d64cc5c2998804909a9" # #$filename #[1] "notsecret.html" #> digest::digest(file = myTempFile, algo = "md5") #[1] "e459fe3803b78d64cc5c2998804909a9" myStoredFiles <- getStoredFiles(myAcc) #> rbindlist(myStoredFiles$files) #size mtime name md5 #1: 19 1472401537 notsecret.html e459fe3803b78d64cc5c2998804909a9 #2: 14 1472350499 testDoc.R adfc8afc373f0b3fd6f93c3891bdd11b ## End(Not run)
## Not run: myAcc <- account() # create a temporary file myTempFile <- file.path(tempdir(), "notsecret.html") write("SUPER SECRET STUFF", myTempFile) # check stored files myStoredFiles <- getStoredFiles(myAcc) # upload new file res <- uploadFile(myAcc, file = myTempFile) #> res #$username #[1] "seleniumPipes" # #$size #[1] 19 # #$md5 #[1] "e459fe3803b78d64cc5c2998804909a9" # #$filename #[1] "notsecret.html" #> digest::digest(file = myTempFile, algo = "md5") #[1] "e459fe3803b78d64cc5c2998804909a9" myStoredFiles <- getStoredFiles(myAcc) #> rbindlist(myStoredFiles$files) #size mtime name md5 #1: 19 1472401537 notsecret.html e459fe3803b78d64cc5c2998804909a9 #2: 14 1472350499 testDoc.R adfc8afc373f0b3fd6f93c3891bdd11b ## End(Not run)