Swagger/Open API 3 Import
In vREST NG, Importing Swagger Spec file in order to generate test cases is pretty easy. All you need is the .json file for your Swagger Spec.
Importing Swagger / Open API 3 Spec into vREST
- Open vREST NG application.
- Go to the Test Cases Tab.
- Click on on the top left side of the application. (A window will pop up)
- Select Swagger or Open API 3 for Import Source depending upon which type of specification file you have.
- Click on
- Find and select the Swagger Spec .json file.
- Now click on
Voila! Your Swagger Spec file is imported into vREST and test cases are created for all the requests from your Spec file, respectively.
Now let's see, what the import process has done:
- It has generated a test case for each API spec available in the swagger file.
- It has generated the test suites for each tag available in the swagger file.
- It will add the test case in the first tag (test suite in vREST NG) availble in the API spec.
- It will import all the definitions in the Configuration >> Schemas section.
- Additionally, it will generate the sample test data CSV files with all the necessary information to fill if Generate Data Driven Tests option is ticked.
Now let's look at two additional options provided by the swagger import process:
Update Schema Only: If this option is ticked, then test cases will not be generated when you import the swagger files. Instead this option will only update the swagger schema definitions available in the Configuration >> Schemas section of the vREST NG application.
Generate Data Driven Tests: If this option is ticked, then the import process will do the following:
- It will generate a sample test data CSV file for each API spec available in the swagger file.
- It will do all the necessary bindings between test data file and the generated test case.
You will only need to fill the test data for the tests and you are ready to go. You may also need to execute a command to setup the initial state of the application.