Example: Use an API environment on an ExecutionList

In the following example, you will run an ExecutionList in an API environment. This means that you use an API environment to change the different service endpoints of all API TestCases in this ExecutionList to the same endpoint. This allows you to easily run an ExecutionList in several API environments in order to test it with different service endpoints.

This example includes:

API environment

The API environment in this example has the name Local Environment and the service endpoint http://localhost:50000/host.

API environment Local Environment in the API Connection Manager

Tosca Commander stores API environments in the Configurations folder and creates the test configuration parameter Endpoint for the service endpoint.

API environment Local Environment in the Configurations folder

API TestCases with API connections

You use three API TestCases in this example: TestCase1 - Calculator, TestCase2 - Coffee and TestCase3 - Petstore.

API TestCases in Tosca Commander

Each TestCase uses a different API connection with a unique endpoint:

  • TestCase1 - Calculator uses the connection Calculator with the endpoint https://tosca-webservice.azurewebsites.net

  • TestCase2 - Coffee uses the connection Coffee with the endpoint http://webservice.toscacloud.com

  • TestCase3 - Petstore uses the connection Petstore with the endpoint http://petstore.swagger.io

API connections Calculator, Coffee, and Petstore in the Configurations folder

ExecutionList with API TestCases

The ExecutionList in this example has the name API ExecutionList and contains the three API TestCases described above.

API ExecutionList with the three API TestCases

In an ExecutionList, you can select any TestCase and click on the Test configuration tab to view its API connection and service endpoint.

API connection of TestCase1 - Calculator in the Test configuration tab

Run the ExecutionList in the API environment

You now want to run the ExecutionList in the API environment. This will change the different service endpoints of all TestCases in the ExecutionList to one common endpoint, i.e. the endpoint of the API environment.

First you select the API environment in the Configurations folder and drag and drop it onto the ExecutionList.

Drag and drop the API environment onto the ExecutionList

The Test configuration tab displays that the ExecutionList now uses the API environment's Endpoint with the value http://localhost:50000/host.

New Endpoint of the API ExecutionList in the Test configuration tab

The Test configuration tab also displays that each TestCase now uses the API environment's Endpoint with the value http://localhost:50000/host.

TestCase1 - Calculator with new Endpoint

The API environment and its endpoint override all API connections and their endpoints.

You can now run your ExecutionList in the API environment.

Run an ExecutionList in several API environments

To run an ExecutionList in several API environments you have the following options:

  • Delete the API environment from the ExecutionList and run it in another API environment.

    To do so, right-click on the Local Environment in the Test configuration tab of the ExecutionList and select Delete from the mini toolbar. You can then select another API environment in the Configurations folder and drag and drop it onto the ExecutionList.

  • Create a copy of the ExecutionList, delete the API environment, and use a different API environment as described above.