Test cases specify parameters for evaluating the accuracy of a particular configuration during future test runs. When you create a test case, you select a test template as the basis for the test case, which flags all the fields specified in the template as fields to test in the test case. During save, Test executes the test case and stores the results of running the test case as baseline values for future comparison.
For example, create a test case for use with the Salesforce CPQ Calculate Quote API to determine if Salesforce updates introduce regressions in your CPQ pricing calculations.
A test case consists of:
Calculate: Test price quote calculation using the Salesforce CPQ Calculate Quote API, which is the equivalent of selecting products in the quote line editor and clicking Calculate. To produce valid test case baseline values, you need a quote containing at least one quote line. Refer to the Calculate Prices Trailhead Module for more information.
Requires:
Calculate & Save: Test price quote calculation and the subsequent saving of the quote record. This is the equivalent of a user clicking Calculate and then Quick Save or Save in the quote line editor. This function first uses the Salesforce CPQ Calculate Quote API to run all pricing, product, and validation rules, and then commits the resulting values to the database, updating the quote and its related records. To produce a valid test case, you need a quote with at least one quote line that can be priced. Refer to the CPQ Quote Calculation Sequence for more information.
<aside> <img src="/icons/warning_red.svg" alt="/icons/warning_red.svg" width="40px" />
The test Quote will be saved and field values may be overwritten.
</aside>
Requires:
Contract: Test contract creation using the Salesforce CPQ Contract Generator API, which is the equivalent of selecting Contracted on an opportunity record to create a contract. To produce valid test case baseline values, you need an account with an uncontracted opportunity that has a primary quote (with a valid Start Date and either Subscription Term or End Date) containing quote lines with at least one subscription product. Refer to Creating a Contract from an Opportunity for more information.
Requires:
Renew: Test contract renewal using the Salesforce CPQ Contract Renewer API. To produce valid test case baseline values, you need a contract containing at least one subscription. Refer to the Manage Contracts and Renewals Trailhead Module for more information.
Requires:
Amend: Test contract amendment using the Salesforce CPQ Contract Amender API. To produce valid test case baseline values, you need a contract containing at least one subscription. Refer to the Manage Contracts and Renewals Trailhead Module for more information.
Requires:
Submit for Approval: Test the initiation of an approval process on a quote. This is the equivalent of a user clicking the Submit for Approval button, which sends the record to the Salesforce Advanced Approvals engine. The test validates that the quote meets the entry criteria for a specific approval process and is correctly routed to the designated approver(s). To produce a valid test case baseline, you need a quote that meets the entry conditions of an active approval rule and an active approval process. Refer to the Salesforce Approvals documentation for more information.
Requires:
To create a test case:
From the Test Cases page, click New Test Case.
Type a meaningful Test Case Name and Description.
Select the Environment that you will provide the record ID to test against from
In the Function list, select the function the test case executes. Options available in the current release are:
In the Test Template list, select a test template to be the basis of the test case.
In the ID box, enter the ID of the quote record, contract record, or advanced approval record depending on what function you’d like to test.
<aside> <img src="/icons/info-alternate_blue.svg" alt="/icons/info-alternate_blue.svg" width="40px" />
You can find the 18-character ID in the address bar of your browser when looking at the quote record in Salesforce. For example, a1T4T000000QNBfUAO.
</aside>
For amend and renew, creating a test case includes creating a quote record and an opportunity record as part of capturing the baseline values. To retain (not automatically discard) these created records, select Keep Created Records.