
We’ve selected pet / Finds Pets by status. Your Test will appear in the center panel.In this example, we’ve named our test “Returns 200” since we expect the Test to pass with a 200 code. Enter a name for your Test in the modal, then click New Test.In the center panel, click New Test next to your Test Suite name.If you click on the Test Suite name, you’ll get a dropdown menu with options to Run Tests and Delete Suite. Your Test Suite name will appear in the left-side panel.Name your Test Suite in the modal, then click Create Suite.Click New Test Suite, since all tests must belong to a Suite.Let’s write a 200 passing test for the Pet Store API. Create tests for the requests populated from your specification in this tab. The Test tab is the third of the three top-level tabs in Documents. The center panel will populate with the request URL, request type, base URL variable (defined through the OpenAPI specification), and a body (if application).Ĭlick Send and see the response in the right-side panel.įor more information about sending requests, see Requests. In the left-side panel, you’ll see a list of requests generated from your properly formatted specification.Ĭlick on any request. If you’ve imported a properly formatted specification in your Design tab, you’ll see a list in the left-side panel of your Debug tab. Any requests detected from your specification (imported on the Design tab) will appear in this tab, given that the specification doesn’t contain fatal errors. The Debug tab is the second of the three top-level tabs in Documents. Let’s move on to the Debug tab, where we’ll get to send individual requests. Schemas detailing the input/output of the API. Listing of parameters that the API recognizes. Listing of structured, expected responses for each request. For example, in the Pet Store API, an object is Pet and content types for that object are application/json and application/xml. Servers that access requests for the API.Īll paths available for the API, with request types listed.ĪPI objects with content types. Overview data about the API, including title, description, version, and license. If you want to make modifications to the generated left-side panel content, modify your specification. For example, the Pet Store API specification that we’re working with doesn’t have SECURITY defined, so SECURITY won’t appear in the left-side panel.Īll of this content is generated from your specification. If a section has no content, the section title will not populate. By default, all defined sections are visible, and INFO is always visible. Modify what appears in your left-side panel by clicking on the three-dot button next to INFO. In the left-side panel, a menu populates with the sections in the table below. You should see the same errors arise.Īdd line 15 back to move forward with this guide. To replicate the error in the screenshot above with the Pet Store API example, delete “tags:” from line 15. If there are breaking errors, the right- and left-side panels will not render.Įrror details include the error type, line number, and error message.įor error specifics, see the bottom of the center panel. Linting and Error MessagingĪll specifications imported into Insomnia are linted, and error messages will appear at the bottom of the center panel. Otherwise, if you’re starting from scratch, you can start typing right into the center panel. For a URL, provide the URL where the specification file lives. For a file, select the file to import from your computer. This dropdown allows you to select between a File or URL. In the center panel of the Design tab, you’ll see an Import button. In this panel, you can directly edit the specification.Īlternative Option: Rather than use the sample Pet Store API file, you can import from a file or URL.


The Pet Store specification will populate in the center panel of the Design tab. Click on start from an example (above the Import button), which will populate the sample Pet Store API. We’re going to import a sample file that’s built into Insomnia. The Design tab is the first of three top-level tabs in Documents. Test: Create test suites and individual tests for requests.Debug: Create, edit, and send individual requests.


We’ll walk through each tab in order from left to right, starting with the Design tab.ĭocuments have functionality separated into three tabs: Design, Debug, and Test. We’ve named our Document “petstore” as our example uses the Pet Store API. If you’re looking for information about Collections instead (which use Version Control Sync), see Request Collections.įor this guide, create an empty Document from your Dashboard. They also offer the capability to sync with Git. Design Documents (also called Documents) hold specifications, API requests, and tests.
