Running Automated Tests
Adding test automation to your build pipelines supports continuous integration, and allows you to implement and test new features as early as possible.
In Eggplant DAI, you can trigger a set of tests, or test configuration, from the command line. To do this, you need to download, install, and run the DAI CLI tool or any of the provided pipeline plugins for Azure, Github, or Jenkins as described below.
-
Download the DAI CLI tool for your platform. The following platforms are supported:
- Windows 10/11/ and Server 2019/2022
- macOS: 11 and above
- Linux: RHEL 8, Ubuntu 16 and Ubuntu 22
Plugins for Azure, Github, and Jenkins are available in their respective market stores. You can find instructions for installing and configuring them at the links below.
-
Run your test configuration with the CLI tool or plugin executable file from the command line. See Run test config by Id or Run test config by Name for more information.
The shell in which you run the DAI CLI tool needs to support UTF-8 encoded characters. This is true if you run the tool at the command line or from a batch file.
The executable
runs until the test config is complete.
- If the test config runs successfully, it will complete with an exit code of
0
. - Other exit codes indicate that the test config has failed.
Run Test Configuration by Test Config Id
When creating a test configuration, each test configuration will be assigned a unique identifier (TEST_CONFIG_ID
).
To retrieve this ID, go to Controller > Test Config and edit the test configuration that you want to run. The TEST_CONFIG_ID
value is appended to the URL.
.
Other mandatory options:
Parameter | Value Description |
---|---|
SERVER_URL | URL for the Eggplant DAI server. For example: https://myeggplantserver.com |
TEST_CONFIG_ID | Test config ID. For example: adcb4d6e-3b3e-4cc3-a62b-3bba84fe5ab0 . It is the string appended to the DAI URL when you open a test config. See image above. |
--client-id <CLIENT_ID> --client-secret <CLIENT_SECRET> | Retrieve the client secret pair set up during installation. For security, you might want to set the DAI_CLIENT_SECRET environment variable instead of passing your credentials on the command line. |
For the cli --help
to see all parameters and options, run this command:
eggplant-runner-Windows-7.4.0-4.exe --help
At your command line, run the following command:
eggplant-runner-Windows-7.4.0-4.exe <SERVER_URL> <TEST_CONFIG_ID> --client-id=<CLIENT_ID> --client-secret=<CLIENT_SECRET>
eggplant-runner-Windows-7.4.0-4.exe https://myeggplantserver.com adcb4d6e-3b3e-4cc3-a62b-3bba84fe5ab0 --client-id=<CLIENT_ID> --client-secret=<CLIENT_SECRET>