On this page, we shall explain how to run batch tests on cloud in MagicPod from the command line.
In the case of tests using MagicPod cloud devices or external cloud services, it is possible to run these simply as a batch via the Web API.
Table of contents
1. curl,Invoke-RestMethod
First, open the test run settings panel from Details in the Batch runs tab and configure the settings.
Figure 1. The Details button in the Batch runs tab.
After that, you can acquire the commands that can be run with this setting in the form of curl (for Mac/Linux) or Invoke-RestMethod (for Windows PowerShell).
Figure 2. Run from command line in the test run settings panel.
2. magicpod-api-client
In the case of the curl and Invoke-RestMethod format, you cannot check the test results without waiting until the batch test execution is complete (it is necessary to check the test results on the MagicPod screen or in the test results email). You can resolve this problem by using the magicpod-api-client.
In terms of the procedure, download and unzip magicpod-api-client via MagicPod Web API using the following command, and place it in a suitable location.
curl -L "https://app.magicpod.com/api/v1.0/magicpod-clients/api/{os}/latest/" -H "Authorization: Token {apikey}" --output {filename}.zip
- {os}: Mac: mac, Windows: windows, Linux: linux or linux_arm64
- {apikey}: API token
- {filename}: Arbitrary file name
To use the magicpod-api-client, download either linux64_magicpod-api-client.zip, mac64_magicpod-api-client.zip, or win64_magicpod-api-client.exe.zip, depending on the OS used, from here, unzip the same, and save it to an appropriate location.
Following this, use the “Copy magicpod-api-client format” function, to simply acquire the command for calling magicpod-api-client as in Figure 10.
Figure 3. State during test execution.
Figure 4. The result of the test success is displayed.
The detailed Web API specifications can be confirmed from Integrations > MagicPod Web API in the account menu.
Figure 5. Web API Document.