Just like every separate element on the app level, you can also test every step in your template.
Template testing allows you to verify the functionality of all the steps in your template workflow. This way, you can test every part of your template while building it and save it when you know everything is good to go. You won’t need to set up integrations from the user’s perspective to check if any step in your template is working.
Testing a step
There are various types of steps that you can work with inside the template builder. Every step, like an action, trigger, or a loop, can be tested from within the template. To test any step, all you need to do is click on the Test button that appears on the right side of each step. An example is shown below.
Once you click on the test button, you’ll see a test interface within the step; depending on the type of step you are testing. Since this is a simple trigger that notifies us of a person being created in Pipedrive, the interface opened will be that of the trigger test.
The ‘Preview Data’ button that you see on the top right will be discussed in the next section.
Once your test interface is open within the step, you can follow the normal trigger testing method to test this trigger step. You’ll need to add your Pipedrive account, fill in any required fields, and click on the Start Test button.
Once you create a contact in Pipedrive, it will be displayed in your test as output. Shown below is how that output will look like, everything is similar to the general trigger testing procedure.
Clicking on the 200 Success bar in the above image will provide you the details of the new contact that you’ve created in Pipedrive. This is how you can test any step in a template.
Previewing input data
Before testing any step, you can preview the data going into the step as input. This is the data that a step is getting from a parent step (or a linked step) to work with. This data is presented to you in a standard JSON response format as shown below.
Let’s see the process of previewing the data by extending our current example. Say that you add an action step as a child of the trigger mentioned above.
To see the input data for a step, you need to test the parent step first, so that the input data can be generated. As we’ve already tested the parent trigger in our current example, we’re good to go.
You can now click on the Test button for the child step, you’ll be displayed an action testing interface within that step as shown below.
If you click on the toggle for preview data on the top right, you’ll see another button to view the input data, as shown below.
Clicking on this button will display a data tree for you on the right of the step. This will contain the output data of all the steps you have tested in the template so far. The Data Tree and its related information will be detailed in the next section. For our current example, we’ll only see the data of one step that we’ve tested above. This will be the input data from the parent step (step 0) going into this step.
You can see the input data in JSON format and you can expand each object to see the data inside it. Expanding the ‘object 0’ will show you all the attribute data for a contact (or a person) that is created in Pipedrive.
So seeing this input data will provide you the information that this action will use in creating this same contact in Hubspot. All this attribute data that you see in this input will be copied to the HubSpot’s contact that this action is creating.
For every step that you test within a template, its output data is saved in a shadow Data Tree. As in the above example, you can see the data in the tree by clicking the See Input Data button. This shows available generated data for all the steps in the template, and follows the hierarchy of your template. Let’s say your template has 6 main parent steps (starting from step 0). If you check input data for any step in the template, it will show you the data tree like this:
Each parent step has its own object (with the same index) in the tree, which you can expand and see the data for its test result. If a step had children steps, that hierarchy will be followed in the data tree as well, and you can expand that step and see the tested data to the deepest level.
Expanding any of the above steps will display the result data if the step has been tested.
Adding and testing a new step in a template will prompt you to save the template and its data tree first. This will look like this, where all you have to do is click the Save button.
You can have multiple data trees in a template. This provides the option of testing your template with different sets of data and checking out multiple scenarios in your integration. By default, every template has a Default data tree. You can see which tree you have selected by clicking on the top-level dropdown called Selected Test.
To create a new data tree, you can just click on the field where you see your selected test tree name. Write a name for the new test and you’ll see a drop-down prompt for creating that new tree as shown below.
Creating a new test tree will put that tree as the selected one for your template. Now the input data for all the steps will be cleared and you can test any step again and it will start adding to this new data tree. An example of a template with two steps and an empty data tree is shown below.
You can switch between your data trees to use their respective test data, as all the saved test data for every tree is preserved. So you can freely switch between trees and keep your sets of data intact.
Testing various steps in templates
Any trigger step that you have added in your template can be tested. After clicking the Test button, you get the trigger testing interface inside that step. The rest of the procedure is the same as in the cited article. Some part of it is also demonstrated above.
Testing an action step is also quite simple. Click on the Test button and work your way through the action testing interface that is opened inside the step. Let’s continue this test for the running example
The action test interface will look something like this:
Select or add your account and provide the value of the required fields, and click Send Test Call button. You’ll then see the test result and the status of your call. If the input data and all the fields are in proper format, the action will be successful and will show you the success response. Your contact will be created in HubSpot.
You can see the details of the created contact by clicking on the View details button in the response bar. Follow the instructions provided in this detailed action testing guide for more information.
3. Rest of the steps
The template builder supports several types of core as well as utility steps. Testing methods of each remaining step can be found in its respective help documentation. Visit these articles and learn how each of these steps can be tested: