Test templates are building blocks for test cases. A test template simply contains a list of fields (from one or more objects) you specify to test. When you create a test case, you select a test template as the basis and all the fields specified in the template get included in the test case. You can reuse a test template as the basis for multiple test cases.
For example: create a test template for use with test cases that use the Salesforce CPQ Calculate Quote API to determine if Salesforce updates introduce regressions in your CPQ pricing calculations.
The Test Templates Page
To access the page, in the left sidebar of the Test tab, click Templates.
The page displays pertinent information for each test template:
- Template Name: Specifies the unique, meaningful name of the test template.
- Template Type: Specifies the type of test template (contract or quote). Options available in the current release are:
- Contract: Specify fields from the Contract, Asset, and Subscription objects to use to test contract validity.
- Quote: Specify fields from the Quote, Quote Line, Opportunity, Opportunity Product and Account objects to test price quote calculation, contract amendment, and contract renewal.
- Advanced Approvals: Specify fields from the Approval object to test approval requests for various records, especially those related to sales quotes and contracts. When selecting this option, you’ll see an additional field called Approval Lookup Field API Name. You’ll need to enter this to tell Advanced Approvals which type of object is being submitted for approval.
- Owner: Specifies the Salesforce user who currently owns the test template.
- Created By: Specifies the user who created the test template.
- Last Modified By: Specifies the user who last modified the test template.
Create a Test Template
To create a test template:
- From the Test Templates page, click New Template.
- Select the Schema from which to retrieve objects.
- Type a meaningful Test Template Name and Description.
- Select a Template Type. Options available in the current release are:
- For each object in the Available Objects list:
- Select the object from the list to display the fields for that object.
- Select the fields to include in the test template. For more-refined access to the fields in the table:
- In the filter box, type field label and API name strings to filter the rows that appear in the fields table.
- In the field table, click any column heading to sort the table on that column.
- In the Relationships table, add objects that are related to the baseline objects you selected above.
- In the Fields table, select fields to use in the template based on the objects selected above.
- In the filter box, optionally type field label and API name strings to filter the rows that appear in the fields table.