# Test Runs

This endpoint is used to create, and read the results of, test runs.\
\
API URL - <https://api.moropo.com/testsruns>&#x20;

### Available actions

1. Create Test Run
2. Check Test Run Status

### Example - Triggering a Test Run

Note this request uses `POST` to inform the API that a test run is being created. This example is for a basic usage of the endpoint. The docs linked above provide a comprehensive specification of all possible overrides.

<pre class="language-bash"><code class="lang-bash">curl -X 'POST' \
  'https://api.moropo.com/testRuns' \
  -H 'accept: */*' \
  -H 'x-app-api-key: MOROPO_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
	"ciCdId": "SCHEDULED_TEST_RUN_ID"
<strong>}'
</strong></code></pre>

Where;

* `MOROPO_API_KEY` is the API key for the target app, found in your [Moropo settings](https://app.moropo.com/settings?index=integrations).
* `SCHEDULED_TEST_RUN_ID` is the UUID of the scheduled test run you wish to create.&#x20;

#### Expected Response

```json
{
  "statusCode": 200,
  "body": "{
  \"message\":\"Success\",
  \"testRunInfo\":{
    \"id\":TEST_RUN_ID,
    \"buildId\":\"BUILD_ID\",
    \"devices\":[\"DEVICES\"],
    \"tests\":[\"TESTS\"],
    \"expoReleaseChannel\":\"EXPO_RELEASE_CHANNEL\",
    \"url\":\"TEST_RUN_URL"
    }
  }"
}
```

### Example - Reading Test Run Status

This request uses `GET` to inform the API test run status is being requested

```bash
curl -X 'GET' \
  'https://api.test.moropo.com/testRuns/TEST_RUN_ID' \
  -H 'accept: */*' \
  -H 'x-app-api-key: MOROPO_API_KEY'
```

Where;

* `MOROPO_API_KEY` is the API key for the target app, found in your [Moropo settings](https://app.moropo.com/settings?index=integrations).
* `TEST_RUN_ID` is the ID of the test you want to request the results for.

#### Expected Response

```json
{
  "statusCode": 200,
  "body": "{
    \"complete\":true,
    \"passed\":true,
    \"message\":\"Tests passed\"
  }"
}
```
