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

# mabl/trigger-tests

Automatically trigger specific environment or application plans in mabl.


## Commands

### parse-results

This command parses the execution results and generates a JUnit report.


### run-tests

This command triggers test runs and waits for completion if requested.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `api-key` | env_var_name | MABL_API_KEY | The environment variable holding the API key of your workspace. You can find the API key
on the Settings/API page. Either an Integration or a CI/CD Deployment Integration key is
required.
 |
| `application-id` | string |  | (Optional) The application ID to run tests on. Note that either an environment ID or
an application ID must be provided.
 |
| `await-completion` | boolean | true | Wait for the deployment tests to finish before proceeding.
 |
| `browsers` | string |  | Comma separated list of browsers to test against (internet_explorer, safari, chrome,
firefox). If not provided, mabl will test the browsers configured on the triggered test.
 |
| `debug` | boolean | false | Set to true to see more output in the logs.
 |
| `environment-id` | string |  | (Optional) The environment ID to run the tests in. Note that either an environment ID or
an application ID must be provided.
 |
| `labels` | string |  | (Optional) A comma-separated list of plan labels. Plans with any of the labels will be
executed.
 |
| `mabl-branch` | string |  | (Optional) The mabl branch to run tests against.
 |
| `rebaseline-images` | boolean | false | Set true to reset the visual baseline to the current deployment.
 |
| `revision` | string |  | The code revision hash for the application under test.
 |
| `set-static-baseline` | boolean | false | Set to true to use current deployment as an exact static baseline. If set, mabl will not
model dynamic areas and will use the current deployment as the pixel-exact visual baseline.
 |
| `url` | string |  | The base uri to test against. If provided, this will override the default URL associated
with the environment in mabl.
 |

## Jobs

### test

Triggers tests to execute in mabl.


| Parameter | Type | Default | Description |
|---|---|---|---|
| `api-key` | env_var_name | MABL_API_KEY | The API key of your workspace. You can find the API key on the Settings/API page.
Either an Integration or a CI/CD Deployment Integration key is required.
 |
| `application-id` | string |  | (Optional) The application ID to run tests on. Note that either an environment ID or
an application ID must be provided.
 |
| `await-completion` | boolean | true | Wait for the deployment tests to finish before proceeding.
 |
| `browsers` | string |  | Comma separated list of browsers to test against (internet_explorer, safari, chrome,
firefox). If not provided, mabl will test the browsers configured on the triggered test.
 |
| `debug` | boolean | false | Set to true to see more output in the logs.
 |
| `environment-id` | string |  | (Optional) The environment ID to run the tests in. Note that either an environment ID or
an application ID must be provided.
 |
| `labels` | string |  | (Optional) A comma-separated list of plan labels. Plans with any of the labels will be
executed.
 |
| `mabl-branch` | string |  | (Optional) The mabl branch to run tests against.
 |
| `rebaseline-images` | boolean | false | Set true to reset the visual baseline to the current deployment.
 |
| `revision` | string |  | The code revision hash for the application under test.
 |
| `set-static-baseline` | boolean | false | Set to true to use current deployment as an exact static baseline. If set, mabl will not
model dynamic areas and will use the current deployment as the pixel-exact visual baseline.
 |
| `url` | string |  | The base uri to test against. If provided, this will override the default URL associated
with the environment in mabl.
 |

## Examples

### trigger_tests_app_and_env_only

Triggering tests using an application ID and an environment ID.


```yaml
version: '2.1'
orbs:
  mabl-trigger-tests: mabl/trigger-tests@1.0.6
jobs:
  run-mabl-tests:
    machine: true
    steps:
      - mabl-trigger-tests/run-tests:
          api-key: MABL_API_KEY
          application-id: myApplicationID-a
          environment-id: myEnvironmentID-e
workflows:
  test-my-app:
    jobs:
      - run-mabl-tests
```

### trigger_tests_chrome_with_labels_and_branch

Triggering tests that have a particular plan label executing on Chrome only using a mabl test branch.


```yaml
version: '2.1'
orbs:
  mabl-trigger-tests: mabl/trigger-tests@1.0.6
jobs:
  run-mabl-tests:
    machine: true
    steps:
      - mabl-trigger-tests/run-tests:
          api-key: MABL_API_KEY
          application-id: myApplicationID-a
          browsers: chrome
          environment-id: myEnvironmentID-e
          labels: myPlanLabel
          mabl-branch: developmentBranch
workflows:
  test-my-app:
    jobs:
      - run-mabl-tests
```