OAS:OpenAPI Editor/OpenAPI Test/Requests/Manage Tests

From Remain Software

Managing Tests

Test Structure

OpenAPI Test structures functional tests into three levels; TestSuites, TestCases, and Assertions.

  • TestSuite is a collection of TestCases that can be used for grouping functional tests into logical units.
  • TestCase is a request method that can contain a collection of Assertions. You can add any number of TestCases to a containing TestSuite.
  • Assertions are pre-defined variables with values that can be asserted on the request-response to ensure that a request is working as expected.


Create TestSuite

Select Test Suites node from the definitions view > right mouse-click and click on New Test Suite > enter the test suite name on the displayed dialog and click on OK. The created test suite will be displayed as a child of the test suites node.


Create testsuite.png


Rename TestSuite

Select a test suite > right mouse-click and click on Rename > enter the name of the test suite and click on Ok.


Delete TestSuite

Select a test suite > right mouse-click and click on Delete > Klick on Ok.


Create TestCase

Select a method from a request node > right-mouse-click and click on New Test Case > new test case dialog will be displayed.


Create testcase context.png


The following test case dialog will create and add the test case to the selected test suite. Enter the name of the test case and select an existing test suite > click on Finish. The created test case will be displayed as a child of the test suite.


Create testcase select testsuite.png


The following test case dialog will create a test case and a test suite. To create a test suite enter the name of the test suite, then click on Create button. Enter the name of the test case and click on Finish, the test case will be created and added to the test suite.


Create testcase create testsuite.png


Rename TestCase

Select a test case > right mouse-click and click on Rename > enter the name of the test case and click on Ok.


Delete TestCase

Select a test case> right mouse-click and click on Delete > Klick on Ok.


Edit TestCase

Select a test case > right mouse-click > click on Edit > the editor will be opened on the right site. In our example, we want to change the pet name, to do that you have to select the body view and change the name of the pet e.g to parrots and save the changes.


Edit testcase.png


Run TestCase

Select a test case > right mouse-click > click on Run > The output will be displayed in the Request Test view.


Run testcase.png

Add Assertion to TestCase

Select a test case > right mouse-click > click on Add Assertion > The assertion wizard will be displayed > select the response assertion > enter the assertion condition and value > click on Finish. The added assertion will be displayed as a child of the test case.

As you can see in the wizard the following assertion types can be added:

  • Response body
  • Response headers
  • Response status code
  • Response status text
  • Response time


Add testcase assertion.png


Run TestCase with Assertion

This test checks the response body of the request. If the response body contains the string parrots, the test will pass, otherwise, it will fail. Run the test case again > the following output will be displayed:


Run testcase with assertion.png


Delete Assertion

Select an assertion > right mouse-click and click on Delete > Klick on Ok.


Run Collected TestCases on TestSuite

Select a test suite that contains test cases > right mouse-click and click on Run.


Run testsuit.png


Run all Test Cases from Test Suites Node

Select Test Suites node > right mouse-click and click on Run.


Run testsuites.png