Running Tests

List available frameworks

curl -u <api-key>: https://cloud.bitbar.com/api/me/available-frameworks

Start a test run

These are put into a configuration file as follows:

{
  "osType":"ANDROID","projectId":PROJECT_ID,
  "files":[
      {"id":APP_FILE_ID},
      {"id":TEST_FILE_ID},
      {"id":DATA_FILE_ID}
  ],
  "frameworkId":FRAMEWORK_ID,"deviceGroupId":DEVICE_GROUP_ID
}
curl -H 'Content-Type: application/json' -u <api-key>: https://cloud.bitbar.com/api/me/runs --data-binary @configuration

Note

Mandatory fields are: osType, frameworkId, files (depending on the framework), deviceGroupId or deviceIds.

Configuration fields

Field

Description

applicationPassword

Applies only to AppCrawler runs if the tested application has a login screen.

applicationUsername

Applies only to AppCrawler runs if the tested application has a login screen.

deviceGroupId

Specifies device group devices for the run.

deviceIds

Specifies device IDs for the run (the priority is higher than for deviceGroupId).

deviceLanguageCode

Specifies the device language. Default value: US.

files

File configuration.

Object fields:

  • id – The file ID.

  • action – Optional. If the parameter is specified and the testing process fails, Bitbar Cloud tries to recognize file types and decide what action to take. Also, you can predefine the action by yourself:

    • COPY_TO_DEVICE – Copies the file to the device SD card.

    • INSTALL – Installs the file on the device.

    • RUN_TEST – Runs the file as a test.

frameworkId

Specifies the framework for the run.

hookURL

The URL to be POSTed when the run is finished (must be public).

instrumentationRunner

For Android Instrumentation framework. Default: android.test.InstrumentationTestRunner.

launchApp

For UI Automator framework. Defines if the app should be launched (can be launched by the test).

limitationType

For Android Instrumentation - relates to limitationValue. Possible values: PACKAGE, CLASS.

limitationValue

For Android Instrumentation - relates to limitationType. Defines the test cases to be launched.

maxAutoRetriesCount

Defines how many times the test can be rerun in case of failures.

osType

Defines osType of the used devices: ANDROID, IOS, DESKTOP, and so on.

projectId

Defines the project in which the run should be created. When its value is empty, a new project is created.

projectName

The name of the project to be created when projectId is not defined. The name is automatically generated when the parameter's value is empty.

scheduler

Defines the scheduler of the run. Possible values:

  • PARALLEL – All device sessions can be executed simultaneously.

  • SERIAL – All device sessions start one by one (one at a time).

  • SINGLE – Starts only on the first available device, the rest of them are excluded.

  • ALL_INSTANCES – Starts on all instances from all selected device models (for Administrators).

screenshotDir

The directory of screenshots on devices. Default value: /sdcard/test-screenshots.

testRunId

When it is set, new device sessions are attached to the existing test run.

testRunName

The name of the test run.

testRunParameters

The list of additional parameters (key, value).

timeout

The timeout between the runs when a user can expect partial results.

uiAutomatorTestClasses

For UI Automator framework.

videoRecordingEnabled

Defines if a video should be recorded. Enabled by default.

withAnnotation

For Android Instrumentation framework. Runs a test with the specified annotations.

withoutAnnotation

For Android Instrumentation framework. Runs a test without the specified annotations.

See Also

Publication date: