> For the complete documentation index, see [llms.txt](https://motivlabs.gitbook.io/impulse-dev-manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://motivlabs.gitbook.io/impulse-dev-manual/connectors/testing-controller.md).

# Testing Controller

## Why?

This infrastructure is trying to add the ability to `astro` to test the combination of any `source connector` to any `destination connector`. Until now, we were only able to test a specific combination, for example `Github` to `Strapi3` using Postman. As part of the simplified connector work, we wanted the ability to easily test each new connector.&#x20;

## What?

Testing Controller has 2 types of tests:&#x20;

1. `ks-min`: Minimum amount of fields, for example: a basic content with just a title
2. `ks-max`: All possible fields in a content, all filled with data.

Testing Controller will test 3 main things:

1. `CompareNumberOfSystemContents`: Based on a Definition/Content Type, it will test the amount of contents the `destination` should have after a successful sync.
2. `CompareNumberOfBinaries`: It will test the amount of Binaries/File Assets that `destination` should have after a successful sync.&#x20;
3. `CompareContentSystemDataToMotation`: Compares the Motation fields value with the System Data fields value &#x20;

## How?

You can run a test between any `source` to any `destination`

* `dotCMS` to `Strapi`

```
./astro.sh test --source dotcms --destination strapi --type ks-min
```

* `Strapi4` to `SCP`

```
./astro.sh test --source strapi4 --destination scp --type ks-min
```

After each test is ran, you will get a Result table + important information related to `SUCCESS` or `ERRORS`

```
+---+---------------------------------------------------------------------------+--------------------------------------+
|   |                                                            TRANSACTION ID | B794B184-71C4-11ED-8FF4-0242C0A8800F |
+---+---------------------------------------------------------------------------+--------------------------------------+
| # |                                                                      Name | Result                               |
+---+---------------------------------------------------------------------------+--------------------------------------+
| 0 |               compareNumberOfSystemContents - Definition: Ksmax, Count: 1 | Test Success                         |
| 1 |      compareNumberOfSystemContents - Definition: webPageContent, Count: 2 | Test Success                         |
| 2 |                                 compareNumberOfBinaries - Binary Count: 3 | Test Success                         |
| 3 | compareContentSystemDataToMotation - 35891a5a-d1fc-4ccd-9f49-8cb3b4219ebf | Test Success                         |
| 4 |  compareContentSystemDataToMotation: 37996e78-c97e-4b94-aeaa-806d821f6293 | Test Ignored                         |
| 5 | compareContentSystemDataToMotation - 6ec2b41a-8fa9-4341-8efb-d597af9205d7 | Test Success                         |
| 6 | compareContentSystemDataToMotation - 90ec36f6-2aa2-4288-bfb1-bab0e152eadb | Test Success                         |
| 7 |  compareContentSystemDataToMotation: b3eee8aa-f664-46a8-992a-f29915396fe4 | Test Ignored                         |
+---+---------------------------------------------------------------------------+--------------------------------------+
|   |                                                                    RESULT | TEST SUCCESS                         |
+---+---------------------------------------------------------------------------+--------------------------------------+
Tests passed
```
