node-saucelabs

SauceLabs Interface

The following commands are available via package or cli tool:

GET /v1.1/jobs/{id}
Get Job Information

Example:

api.getJobV1_1(id)
GET /v1.2/users/{username}/concurrency
User concurrency

Example:

api.getUserConcurrency(username)
GET /v1.1/users/{username}/organization
Org information

Example:

api.listUserOrganization(username)
GET /v1.1/{username}/jobs
Get all of a users jobs

Example:

api.listJobs(username, { ...options })

Options

  • limit: Number of results to return
  • subaccounts: Include subaccounts in list of jobs
  • full: Should the response result contain everything or just the basics
  • manual_only: Only return manual jobs
  • auto_only: No description available.
  • name: name of the job
  • owner_type: owner type for jobs
  • owner: username of owner of the jobs
  • from: receive jobs beginning of a specific timestamp
  • to: receive jobs until specific timestamp
GET /v1/dashboard_messages/{username}
Dashboard messages from Django

Example:

api.getDashboardMessageForUser(username)
GET /v1/info/platforms/{platform}
returns a list of supported platforms in the Sauce cloud

Example:

api.listPlatforms(platform)
GET /v1/info/status
Sauce Labs Status

Example:

api.getStatus()
DELETE /v1/manual
complete manual task

Example:

api.deleteManualJob(ids)
POST /v1/manual
Creates a manual job

Example:

api.createManualJob(capabilities)
GET /v1/manual/options/
returns a list of supported platforms in the Sauce cloud

Example:

api.listManualPlatforms()
GET /v1/manual/{taskId}
get manual task

Example:

api.getManualJob(taskId)
POST /v1/manual/{taskId}/screenshot
Take screenshot in manual session

Example:

api.createManualJobScreenshot(taskId)
GET /v1/me
Authenticated user cookie information

Example:

api.getCurrentUser()
DELETE /v1/tasks
complete manual task

Example:

api.deleteManualJobLegacy(ids)
POST /v1/tasks
Creates a manual job

Example:

api.createManualJobLegacy(capabilities)
GET /v1/users/{username}
User information

Example:

api.getUser(username)
GET /v1/users/{username}/subaccounts
User information

Example:

api.getSubaccounts(username)
GET /v1/users/{username}/activity
Get currently running job counts broken down by account and job status

Example:

api.getUserActivity(username)
GET /v1/users/{username}/monthly-minutes
User's monthly-minutes

Example:

api.getUserMinutes(username)
GET /v1/users_activity
Get job statistics for usernames

Example:

api.getUsersActivity()
GET /v1/users_last_job
The result returns dict of usersnames and time when they started last job.

Example:

api.usersLastJob()
GET /v1/whoami
Authenticated user information

Example:

api.getCurrentUserFull()
GET /v1/{username}/jobs/{id}
Get Job Information

Example:

api.getJob(username, id)
PUT /v1/{username}/jobs/{id}
Update Job Information

Example:

api.updateJob(username, id, body)
PUT /v1/{username}/jobs/{id}/stop
Stop Job Information

Example:

api.stopJob(username, id)
GET /v1/{username}/all_tunnels
Get all Tunnels

Example:

api.listAllTunnels(username)
GET /v1/{username}/tunnels
Get tunnels for the user or all the users in the team

Example:

api.listTunnels(username, { ...options })

Options

  • all: Should the response contain the same team user data
  • full: Should the response result contain everything or just the basics
DELETE /v1/{username}/tunnels/{id}
Delete a Tunnel

Example:

api.deleteTunnel(username, id)
GET /v1/{username}/tunnels/{id}
Get Tunnel by ID

Example:

api.getTunnel(username, id)
GET /v1/jobs/{id}/{assetName}
Get job asset

Example:

api.downloadJobAsset(id, filename, { ...options })

Options

  • filepath: file path to store the asset at
GET /v1.1/jobs
Get Job Information

Example:

api.getJobsV1_1(id, { ...options })

Options

  • full: Should the response result contain everything or just the basics
POST /storage/upload
Returns new application id after the upload.

Example:

api.uploadApp({ ...options })

Options

  • App-Type: Application type
  • App-Identifier: Your custom unique identifier for your app
  • App-DisplayName: Your custom display name
  • App-Active: If true makes uploaded application active one
  • body: No description available.
PUT /v1/appium/session/{sessionId}/skiptest
Report the result of a test as skipped.

Example:

api.markTestAsSkippedDeprecated(sessionId)
PUT /v1/appium/session/{sessionId}/test
Report the result of a test.

Example:

api.updateTestDeprecated(sessionId, { ...options })

Options

  • body: No description available.
PUT /v1/appium/suites/{batchId}
Updates the properties of a suite.

Example:

api.updateSuiteDeprecated(suiteId, { ...options })

Options

  • body: No description available.
GET /v1/appium/suites/{batchId}/deviceIds
Returns the IDs of the devices which you had selected for the specified suite.

Example:

api.readDeviceIdsDeprecated(suiteId)
POST /v1/appium/suites/{batchId}/reports/start
Start a new suite execution including its test executions.

Example:

api.startSuiteDeprecated(suiteId, { ...options })

Options

  • appId: The ID of the app version you wish to test
  • body: No description available.
PUT /v1/appium/suites/{batchId}/reports/{batchReportId}/finish
Marks all test executions contained in the specified suite execution as finished.

Example:

api.finishSuiteDeprecated(suiteId, batchReportId)
PUT /v1/appium/suites/{batchId}/reports/{batchReportId}/results/{testReportId}/finish
Sets the status of the specific test execution and marks it as finished.

Example:

api.finishTestReportDeprecated(suiteId, suiteReportId, testReportId, { ...options })

Options

  • body: No description available.
PUT /v1/appium/suites/{batchId}/reports/{batchReportId}/results/{testReportId}/skip
Mark test execution as skipped

Example:

api.skipTestReportDeprecated(suiteId, suiteReportId, testReportId)
GET /v1/devices
Returns a list containing all devices, including those not currently available for testing

Example:

api.getDescriptorsDeprecated()
GET /v1/devices/all
Returns a list containing all devices, including those not currently unavailable for testing. This endpoint requires API Key authentication and will also return your private devices.

Example:

api.getDescriptorsApiDeprecated()
GET /v1/devices/all/available
Returns a list containing the IDs of all devices currently available for testing. This endpoint requires API Key authentication and will also return your private devices.

Example:

api.getAvailableDescriptorIdsApiDeprecated()
GET /v1/devices/available
Returns a list containing the IDs of all devices currently available for testing

Example:

api.getAvailableDescriptorIdsDeprecated()
GET /v1/devices/reports
The session history reports provide information about user sessions. This includes device usage and test reports. By default reports of the last 30 days will be retrieved - limited to a maximum of 50 reports. If the authenticated user is the owner of the account, session reports of the entire team will be retrieved. Team members can only retrieve their own session history. This endpoint requires Password authentication.

Example:

api.getSessionReports({ ...options })

Options

  • userId: Your username.
  • lastDays: Number of days to report
  • offset: Offset for pagination
  • limit: Max number of results per page
GET /v1/devices/{deviceDescriptorId}
Returns information for a particular device. This endpoint requires API Key authentication.

Example:

api.getDescriptorDeprecated(deviceId)
GET /v1/devices/{deviceDescriptorId}/status
Returns a list containing device status infos for all device instances with the specified device ID on all pools. This endpoint requires API Key authentication and will also return your private devices.

Example:

api.getDeviceStatusInfosDeprecated(deviceId)
PUT /v2/appium/session/{sessionId}/skiptest
Report the result of a test as skipped.

Example:

api.markTestAsSkipped(sessionId)
PUT /v2/appium/session/{sessionId}/test
Report the result of a test.

Example:

api.updateTest(sessionId, { ...options })

Options

  • body: No description available.
PUT /v2/appium/suites/{batchId}
Updates the properties of a suite.

Example:

api.updateSuite(suiteId, { ...options })

Options

  • body: No description available.
GET /v2/appium/suites/{batchId}/deviceIds
Returns the IDs of the devices which you had selected for the specified suite.

Example:

api.readDeviceIds(suiteId)
POST /v2/appium/suites/{batchId}/reports/start
Start a new suite execution including its test executions.

Example:

api.startSuite(suiteId, { ...options })

Options

  • appId: The ID of the app version you wish to test
  • body: No description available.
PUT /v2/appium/suites/{batchId}/reports/{batchReportId}/finish
Marks all test executions contained in the specified suite execution as finished.

Example:

api.finishSuite(suiteId, batchReportId)
PUT /v2/appium/suites/{batchId}/reports/{batchReportId}/results/{testReportId}/finish
Sets the status of the specific test execution and marks it as finished.

Example:

api.finishTestReport(suiteId, suiteReportId, testReportId, { ...options })

Options

  • body: No description available.
PUT /v2/appium/suites/{batchId}/reports/{batchReportId}/results/{testReportId}/skip
Mark test execution as skipped

Example:

api.skipTestReport(suiteId, suiteReportId, testReportId)
GET /v2/batchReports/{batchReportId}
Returns the test report of a suite

Example:

api.readBatchReport({ ...options })

Options

  • body: No description available.
  • body: No description available.
GET /v2/batchReports/{batchReportId}/xml
Returns the test report of a suite as XML

Example:

api.junitStyleXmlReport({ ...options })

Options

  • body: No description available.
  • body: No description available.
GET /v2/devices
Returns a list per data center containing all devices, including private devices and those not currently available for testing. This endpoint requires API Key authentication.

Example:

api.getDescriptors()
GET /v2/devices/available
Returns a list per data center containing the IDs of all devices currently available for testing, including private devices. This endpoint requires API Key authentication.

Example:

api.getAvailableDescriptorIds()
GET /v2/devices/{deviceDescriptorId}
Returns information for a particular device per data center. This endpoint requires API Key authentication.

Example:

api.getDescriptor(deviceId)
GET /v2/logs/{testReportId}/appium
Returns Appium log for the specified test report

Example:

api.readAppiumLog(testReportId)
GET /v2/logs/{testReportId}/device
Returns device log for the specified test report

Example:

api.readDeviceLog(testReportId)
GET /v2/logs/{testReportId}/vitals
Returns device vitals of a test session after completion

Example:

api.readVitalsLog(testReportId)
GET /v2/logs/{testReportId}/xcuitest
Returns XCUITest log for the specified test report

Example:

api.readXcuiTestLog(testReportId)
GET /v2/reports/{testReportId}
Returns test report and artifacts for a test session after completion

Example:

api.readReport(testReportId)
GET /v2/screenshots/{testReportId}/{screenshotId}.png
Returns a PNG screenshot from a test

Example:

api.getScreenshot(testReportId, screenshotId)
GET /v2/video/{videoId}.mp4
Returns screen recording of a test session after completion

Example:

api.getScreenRecording(videoId, { ...options })

Options

  • Range: No description available.
GET /metrics/
Provides a list of paginated raw performance metrics for the logged user

Example:

api.getPerformanceMetrics({ ...options })

Options

  • page_url: No description available.
GET /metrics/{job_id}/
Provides performance metrics and job basic data for a given job_id

Example:

api.getPerformanceMetricsByJobId(job_id, { ...options })

Options

  • full: When set to false, basic job data will be returned, excluding performance metrics
GET /metrics/{job_id}/assert/
Provides information if there is an outlier for the given job_id and metric

Example:

api.assertPerformance(job_id, metric_names, order_index)
GET /metrics/{job_id}/baseline/
Provides baseline based on metrics history, where the reference point is a given job_id

Example:

api.getBaseline(job_id, metric_names, order_index, { ...options })

Options

  • regime_start: No description available.
  • regime_end: No description available.
GET /metrics/{job_id}/baseline/reset/
Returns true if a baseline was resetted for a give job_id

Example:

api.hasBaselineReset(job_id)
POST /metrics/{job_id}/baseline/reset/
Sets a reset point market at job_id, previous jobs will not be taken into account in calculating baseline

Example:

api.acknowledgeBaseline(job_id)
GET /metrics/{job_id}/discarded/
Provides lists outliers marked as discarded

Example:

api.getDiscardedOutliers(job_id, order_index)
POST /metrics/{job_id}/discarded/
Marks outlier for a given {job_id} as not relevant/flaky

Example:

api.discardOutliers(job_id, order_index)
GET /metrics/{job_id}/history/
Provides a list of raw performance metrics up to point where the reference is a given job_id and order_index

Example:

api.getBaselineHistory(job_id, order_index, { ...options })

Options

  • limit: No description available.
GET /metrics/{job_id}/regimes/
Provides regimes per metric calculated for a set of jobs, where the reference point is a given job_id

Example:

api.getRegimes(job_id, metric_names, order_index, { ...options })

Options

  • include_baseline: No description available.
POST /metrics/{job_id}/regimes/acknowledge/
Acknowledge regime. Confirm values in new regime are acceptable.

Example:

api.acknowledgeRegime(job_id, order_index)
GET /metrics/swagger/
Provides json documentation for the performance API

Example:

api.getApiDefinition()
PUT /jobs/{jobId}/assets
Upload job assets

Example:

api.uploadJobAssets(jobId, { ...options })

Options

  • files: asset to upload and attach to your job
POST /reports
No description available.

Example:

api.createJob(parameters)
POST /
create test result job via data store

Example:

api.createResultJob(parameters)
GET /v1/getprojects
Get all enabled projects for the user account

Example:

api.getProjects()
GET /v1/projects/{projectId}/getproject
Get project information by projectId

Example:

api.getProject(projectId)
GET /v1/projects/{projectName}/getprojectbyname
Get project information by project name.

Example:

api.getProjectByName(projectName)
GET /testSuites/{accountId}/{projectId}/getTestSuites
Get test suites and associated test case info for the testsuite for the requested project.

Example:

api.getTestsuitesByProjects(accountId, projectId)
POST /v1/projects/{projectId}/testcases/{testcaseId}/updateLveAndRecoverSteps
It updates test steps to a test case

Example:

api.updateLveAndRecoverSteps(projectId, testcaseId, steps)
POST /v1/projects/{projectId}/execute
It Executes a single test script.

Example:

api.executeTestsuiteTest(Body, projectId)
POST /v1/test_suite/create
It creates a test suite.

Example:

api.createTestSuite(Body)
POST /v1/test_suite/{testSuiteId}/update
Updates a test suite.

Example:

api.updateTestSuite(testSuiteId, Body)
POST /v1/testSuites/delete
Deletes test suite.

Example:

api.deleteTestSuites(Body)
POST /testCases/associate
Associates test cases with test suites.

Example:

api.associateTestcases(Body)
POST /testCases/create/{accountId}/{projectId}
Associates test cases with test suites.

Example:

api.createTestcase(accountId, projectId, Body)
POST /v1/projects/{projectId}/testcases/{testcaseId}/updateSteps
Update steps assigned to a testcase.

Example:

api.updateTestcaseSteps(projectId, testcaseId, Body)
POST /v1/testsuite/{testSuiteId}/execute
It executes a test suite

Example:

api.executeTestsuite(testSuiteId, Body)
POST /v1/auth
No description available.

Example:

api.getAuth(Body)
GET /v1/jobs/{jobId}/get_status
It returns status of execution of test suite

Example:

api.getExecutionStatus(jobId)
GET /v1/projects/{projectId}/testcases
Get Test Cases For ProjectId

Example:

api.getTestcases(projectId)
GET /testCases/getTestCaseInfo/{testcaseId}/{stepId}
Get test steps for a specific test case

Example:

api.getTestSteps(testcaseId, stepId)
GET /v1/testcases/{testcaseId}/isgenerating
generating test cases

Example:

api.isGenerating(testcaseId)
GET /blocks/getAll/{accountId}/{blockId}
Get test steps for a specific test case block

Example:

api.getTestStepBlocks(accountId, blockId)
GET /v1/downloadFile
It downloades the html report

Example:

api.downloadReport(fileURL)
GET /testScriptExecutions/{executionId}/executions
It returns execution details for the executing script.

Example:

api.getExecutions(executionId)
GET /teams
Get List of Teams

Example:

api.getTeamsV1({ ...options })

Options

  • name: name
GET /users
Get List of Teams

Example:

api.getUsersV1({ ...options })

Options

  • username: username
  • teams: List of team_ids
  • team-name: team-name
  • roles: roles
  • phrase: phrase
  • status: status
  • limit: Number of results to return
  • offset: Starting number
GET /{build_source}/
Get List of Builds (build_source can be vdc or rdc)

Example:

api.getBuildsV2(build_source, { ...options })

Options

  • user_id: user_id
  • org_id: org_id
  • group_id: group_id
  • team_id: team_id
  • status: status
  • name: start
  • end: end
  • limit: Number of results to return
  • offset: Starting number
  • sort: sort
GET /{build_source}/{build_id}/
Get Build detail (build_source can be vdc or rdc)

Example:

api.getBuildV2(build_source, build_id, { ...options })

Options

  • user_id: user_id
  • org_id: org_id
  • group_id: group_id
  • team_id: team_id
GET /{build_source}/jobs/{job_id}/build/
Get Build Jobs (build_source can be vdc or rdc)

Example:

api.getBuildByJobIdV2(build_source, job_id, { ...options })

Options

  • user_id: user_id
  • org_id: org_id
  • group_id: group_id
  • team_id: team_id
GET /{build_source}/{build_id}/jobs/
Get Build detail (build_source can be vdc or rdc)

Example:

api.getBuildsJobsV2(build_source, build_id, { ...options })

Options

  • user_id: user_id
  • org_id: org_id
  • group_id: group_id
  • team_id: team_id
  • modified_since: modified_since
  • completed: completed
  • errored: errored
  • failed: failed
  • finished: finished
  • new: new
  • passed: passed
  • public: public
  • queued: queued
  • running: running
  • faulty: faulty
  • limit: Number of results to return
  • offset: Starting number
POST /v1/
Post Test Runs

Example:

api.createTestRunsV1(parameters)