Discover how to run authored tests in IBM API Studio using the UI.
Before you begin
- Verify your test configuration.
- Author the test file by using the correct
kind:test. For more information about
authoring tests, see Authoring tests in code view.
- Confirm that the test cases and assertions are properly defined in the YAML file, including
response code validation.
- Deploy the API to API Gateway. Make sure
that the API is successfully deployed to API Gateway, as testing in IBM API Studio is possible
only for deployed APIs.
About this task
Running tests in IBM API Studio makes sure that your deployed APIs function as expected in API Gateway. By running these tests, you validate
that the API behaves according to the defined specifications. Test results help you identify and fix
any issues early, improving the overall reliability of your API before it goes into production.
Procedure
- On the home page, select the project that contains the API you want to test.
- In the Explorer, select the test file in the project.
The Editor displays the selected test file.
Selecting the test file activates the Run test button. If the API is not
published to a gateway, the button is disabled.
-
Click the Run test button to start the test.
IBM API Studio processes the test file and runs the test cases against the deployed API based on
the configured assertions.
-
The Test results page displays the outcome of each test, clearly
indicating which tests passed or failed.
Use the Download report button in the Test results
page to download the test results in JSON, CSV, or
PDF format.
You can also view the test results by clicking Problems at the bottom of
the page in code view and selecting the Test results tab.
Clicking an error opens the Test results page, which includes
the Test summary, Request, and
Response tabs.
-
The Test summary tab provides an overview of the test result, including
assertion details.
-
The Request tab displays request headers and the request body.
-
The Response tab shows response headers and the response body.
You can use this information to efficiently debug test failures, compare expected and actual
responses, and refine their API implementation for correctness and reliability.
