> For the complete CircleCI developer hub index, see [llms.txt](https://circleci.com/developer/llms.txt)

# kobiton/kobiton

A CircleCI Orb for integrating Kobiton services like uploading app or executing test - all automation in one place


## Commands

### test

This step will (synchronously) execute an automated test script on Kobiton service


| Parameter | Type | Default | Description |
|---|---|---|---|
| `KOBITON_API_KEY` | env_var_name | KOBITON_API_KEY | Specific key to access Kobiton API (required as env variable in project settings) |
| `KOBITON_APP_ID` | string |  | The App ID or App URL to use in your test script (optional) |
| `KOBITON_COMMAND` | string | mvn test | Command lines to install dependencies and execute your automation test script. These commands will run from the root directory of your Git repository |
| `KOBITON_DEVICE_NAME` | string |  | This value will be consumed by the `KOBITON_DEVICE_NAME` environment variable in your test script. |
| `KOBITON_DEVICE_PLATFORM` | enum | android | This value will be consumed by the `KOBITON_DEVICE_PLATFORM_NAME` environment variable in your test script. |
| `KOBITON_DEVICE_PLATFORM_VERSION` | string |  | This value will be consumed by the `KOBITON_SESSION_PLATFORM_VERSION` environment variable in your test script. |
| `KOBITON_EXECUTOR_PASSWORD` | env_var_name | KOBITON_EXECUTOR_PASSWORD | The Password Kobiton Automation Test Executor (required as env variable in project settings) |
| `KOBITON_EXECUTOR_URL` | string |  | Kobiton Automation Test Executor URL to perform (required as parameter in config file) |
| `KOBITON_EXECUTOR_USERNAME` | env_var_name | KOBITON_EXECUTOR_USERNAME | The Username for Kobiton Automation Test Executor (required as env variable in project settings) |
| `KOBITON_GIT_REPO_BRANCH` | string |  | The branch of your Git repository you want to execute automation test with (required as parameter in config file) |
| `KOBITON_GIT_REPO_SSH_KEY` | env_var_name | KOBITON_GIT_REPO_SSH_KEY | It is used if your Git Repository is private (if repo is private, required as env variable in project settings) |
| `KOBITON_GIT_REPO_URL` | string |  | Link to your Git repository (required as parameter in config file) |
| `KOBITON_LOG_TYPE` | enum | combined | Your desired log type to be showed. Choose Combined to show logs in chronological order, or Separated for single type of log (Output or Error). |
| `KOBITON_ROOT_DIRECTORY` | string | / | Input the root directory of your Git repository |
| `KOBITON_USE_CUSTOM_DEVICE` | enum | false | Check if you want to execute one or some test cases with a specific Kobiton Cloud Device. If you already set your device information in your test script, leave this field unchecked. |
| `KOBITON_USERNAME` | env_var_name | KOBITON_USERNAME | The user in Kobiton (required as env variable in project settings) |
| `KOBITON_WAIT_FOR_EXECUTION` | enum | true | Check if your want the release pipeline to wait until your automation testing is completed or failed, then print out the console log and test result. |

### upload

This step will take an .apk or .ipa file and upload it to the Kobiton App Repository. You can find your API key at https://portal.kobiton.com/settings/keys


| Parameter | Type | Default | Description |
|---|---|---|---|
| `KOBITON_API_KEY` | env_var_name | KOBITON_API_KEY | Specific key to access Kobiton API (required as env variable in project settings) |
| `KOBITON_APP_ACCESS` | enum | public | You can either to make this app private or available for everyone in the organization (private vs. public) |
| `KOBITON_APP_ID` | string |  | App ID in Kobiton - use this in case you want to upload new version of an existing app in Kobiton (optional) |
| `KOBITON_APP_NAME` | string | demo-app | Title of the app to be built (optional) |
| `KOBITON_APP_PATH` | string |  | Path to the app .apk or .ipa file (should be in the same repo
and start with ../ for example: ../test.apk) (required as parameter in config file)
 |
| `KOBITON_APP_TYPE` | enum | apk | Type of the app to be uploaded - Android (apk) or iOS (ipa) |
| `KOBITON_USERNAME` | env_var_name | KOBITON_USERNAME | The user to upload to Kobiton (required as env variable in project settings) |

## Jobs

### execute-test

Execute Automation Test in Kobiton


| Parameter | Type | Default | Description |
|---|---|---|---|
| `KOBITON_API_KEY` | env_var_name | KOBITON_API_KEY | Specific key to access Kobiton API (required as env variable in project settings) |
| `KOBITON_APP_ID` | string |  | The App ID or App URL to use in your test script (optional) |
| `KOBITON_COMMAND` | string | mvn test | Command lines to install dependencies and execute your automation test script. These commands will run from the root directory of your Git repository |
| `KOBITON_DEVICE_NAME` | string |  | This value will be consumed by the `KOBITON_DEVICE_NAME` environment variable in your test script. |
| `KOBITON_DEVICE_PLATFORM` | enum | android | This value will be consumed by the `KOBITON_DEVICE_PLATFORM_NAME` environment variable in your test script. |
| `KOBITON_DEVICE_PLATFORM_VERSION` | string |  | This value will be consumed by the `KOBITON_SESSION_PLATFORM_VERSION` environment variable in your test script. |
| `KOBITON_EXECUTOR_PASSWORD` | env_var_name | KOBITON_EXECUTOR_PASSWORD | The Password Kobiton Automation Test Executor (required as env variable in project settings) |
| `KOBITON_EXECUTOR_URL` | string |  | Kobiton Automation Test Executor URL to perform (required as parameter in config file) |
| `KOBITON_EXECUTOR_USERNAME` | env_var_name | KOBITON_EXECUTOR_USERNAME | The Username for Kobiton Automation Test Executor (required as env variable in project settings) |
| `KOBITON_GIT_REPO_BRANCH` | string |  | The branch of your Git repository you want to execute automation test with (required as parameter in config file) |
| `KOBITON_GIT_REPO_SSH_KEY` | env_var_name | KOBITON_GIT_REPO_SSH_KEY | It is used if your Git Repository is private (if repo is private, required as env variable in project settings) |
| `KOBITON_GIT_REPO_URL` | string |  | Link to your Git repository (required as parameter in config file) |
| `KOBITON_LOG_TYPE` | enum | combined | Your desired log type to be showed. Choose Combined to show logs in chronological order, or Separated for single type of log (Output or Error). |
| `KOBITON_ROOT_DIRECTORY` | string | / | Input the root directory of your Git repository |
| `KOBITON_USE_CUSTOM_DEVICE` | enum | false | Check if you want to execute one or some test cases with a specific Kobiton Cloud Device. If you already set your device information in your test script, leave this field unchecked. |
| `KOBITON_USERNAME` | env_var_name | KOBITON_USERNAME | The user in Kobiton (required as env variable in project settings) |
| `KOBITON_WAIT_FOR_EXECUTION` | enum | true | Check if your want the release pipeline to wait until your automation testing is completed or failed, then print out the console log and test result. |

### upload-app

Upload application to Kobiton App Repository.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `KOBITON_API_KEY` | env_var_name | KOBITON_API_KEY | Specific key to access Kobiton API (required as env variable in project settings) |
| `KOBITON_APP_ACCESS` | enum | public | You can either to make this app private or available for everyone in the organization (private vs. public) |
| `KOBITON_APP_ID` | string |  | App ID in Kobiton - use this in case you want to upload new version of an existing app in Kobiton (optional) |
| `KOBITON_APP_NAME` | string | demo-app | Title of the app to be built (optional) |
| `KOBITON_APP_PATH` | string |  | Path to the app .apk or .ipa file (should be in the same repo
and start with ../ for example: ../test.apk) (required as parameter in config file)
 |
| `KOBITON_APP_TYPE` | enum | apk | Type of the app to be uploaded - Android (apk) or iOS (ipa) |
| `KOBITON_USERNAME` | env_var_name | KOBITON_USERNAME | The user to upload to Kobiton (required as env variable in project settings) |

## Examples

### multiple-upload

Upload multiple apps including apk and ipa, with private and public mode as well as upload to an existing app with app id


```yaml
version: '2.1'
orbs:
  kobiton: kobiton/kobiton@<version>
workflows:
  main:
    jobs:
      - kobiton/upload-app:
          KOBITON_APP_PATH: ../test.apk
      - kobiton/upload-app:
          KOBITON_APP_ACCESS: public
          KOBITON_APP_ID: '275643'
          KOBITON_APP_NAME: android-app
          KOBITON_APP_PATH: ../demo/android-test.apk
      - kobiton/upload-app:
          KOBITON_APP_ACCESS: private
          KOBITON_APP_NAME: ios-app
          KOBITON_APP_PATH: ../demo/ios-test.ipa
          KOBITON_APP_TYPE: ipa
```

### test-custom-device

Run test execution with custom device


```yaml
version: '2.1'
orbs:
  kobiton: kobiton/kobiton@<version>
workflows:
  main:
    jobs:
      - kobiton/execute-test:
          KOBITON_DEVICE_NAME: Galaxy A20s
          KOBITON_DEVICE_PLATFORM: android
          KOBITON_DEVICE_PLATFORM_VERSION: '10'
          KOBITON_EXECUTOR_URL: https://executor-demo.kobiton.com
          KOBITON_GIT_REPO_BRANCH: master
          KOBITON_GIT_REPO_URL: https://github.com/sonhmle/azure-devops-sample-java-prod.git
          KOBITON_USE_CUSTOM_DEVICE: 'true'
```

### test-default

Run test execution (default) in Kobiton


```yaml
version: '2.1'
orbs:
  kobiton: kobiton/kobiton@<version>
workflows:
  main:
    jobs:
      - kobiton/execute-test:
          KOBITON_EXECUTOR_URL: https://executor-demo.kobiton.com
          KOBITON_GIT_REPO_BRANCH: master
          KOBITON_GIT_REPO_URL: https://github.com/sonhmle/azure-devops-sample-java-prod.git
```