The focus of our tool is test optimization, which means you move the DesignWise artifacts to either test management or test automation solutions at the end of your workflow. Furthermore, given the iterative nature of our model-based approach, the same artifact may need to be re-exported quite a few times over the course of its lifecycle.
This article describes our next step in unlocking more API capabilities and taking the export versatility to a higher level. The goal is to make the connection to external tools more streamlined, particularly in the automation-focused and CI/CD environments.
How It Works
For each export type available on our Export screen, you get an extra option called “API Endpoint”. It allows you to publish the optimized output in the specified format to a unique URL, which can then be used in HTTP REST “GET”-type API calls from other solutions.
Let’s talk more about each stage.
Create Endpoints
When you navigate to the renamed “Export & API” screen in a given model and open the dialog, e.g., TestRail, you can see a new API Endpoint button next to the “Download” and “Email” options.
When you click it, a unique URL will be created. To stop the creation process, you can click the X icon in the browser ribbon and refresh the page or leverage the Cancel button.
From the creation dialog, you can use “Copy” to save it in the buffer, you can open the “Manage API endpoints” screen (which we will talk about later), or close the dialog via “OK” or “x”. You can also specify an optional endpoint name (to make it easier to distinguish) and set the expiration period by clicking “Never”, if desired.
If you choose the same exporter again (e.g., TestRail) and click “API Endpoint”, even if you change any aspect from the list below, you will get a choice to overwrite an existing URL or create a new one:
- Strength (i.e, n-way setting as well as standard vs optimized)
- Format (more relevant for e.g, Scenarios or Automated Test Framework that support multiple options)
- Script name
- Configuration (for test management exporters; the combination of metadata fields)
- Model revision
Use Endpoints
Once an API endpoint is created, you can pull the optimized output by
- opening the URL in the browser
- passing the URL in a cURL/wget or any other programmatic HTTP request, potentially as part of the automation script or the CI/CD pipeline step.
Sample syntax is:curl <endpoint url> -o <filename>(saves the file in the active directory with the specified name and extension)curl -X GET “<endpoint url>”(puts the file content into the terminal)
Manage Endpoints
You can navigate to the endpoint management screen from the button at the top of the “Export & API” landing page (the button is hidden when no endpoints exist) or from the URL creation dialog. After the navigation, “New Export” button at the top switches you back to the exporter tiles view.
Here, you can review all the endpoints in a given model and see the characteristics we mentioned earlier, such as the associated model revision, exporter, and strength. You can also see when the URL was created and when it was last accessed (hovering gives a more precise timestamp).
When you hover over an endpoint, you can see the icons to copy or delete it (for expired URLs, you can only delete). In the rightmost column, you can also press the pencil icon to edit the expiration settings for active endpoints at any time.
Additional notes
- There is no limit on the number of endpoints per model.
- In cURL, there is no “figure out best match” mechanism, so you would need to manually match the file extension to the corresponding exporter. I.e., if you are targeting an endpoint for Automate Gherkin Scripts, your <filename> value needs to have the .feature extension.
- If you encounter a certificate error in the API call, you can add
--ssl-revoke-best-effortas an argument, i.e.,curl --ssl-revoke-best-effort <endpoint url> -o <filename>