FlowTest
Parent Type
File Suffix and Directory Location
FlowTest components have the suffix .flowtest and are stored in the flowtests folder.
Version
FlowTest components are available in API version 55.0 and later.
Special Access Rules
There are no additional access requirements that are specific to this type.
Fields
Field Name | Description |
---|---|
description |
|
flowApiName |
|
label |
|
testPoints |
|
FlowTestPoint
Defines a flow test point that is evaluated when a flow test runs. Each test point is evaluated in the order that it’s listed.
Field Name | Description |
---|---|
assertions |
|
elementApiName |
|
parameters |
|
FlowTestAssertion
Defines an assertion for a test point that is evaluated when a flow test runs. If one assertion evaluates to false, the test run fails.
Field Name | Description |
---|---|
conditions |
|
errorMessage |
|
FlowTestCondition
Defines a condition for an assertion that is evaluated when a flow test runs. If one condition evaluates to false, the assertion fails.
Field Name | Description |
---|---|
leftValueReference |
|
operator |
|
rightValue |
|
FlowTestReferenceOrValue
Defines a specific value that the operator applies to the resource reference in flow test assertions and conditions.
Field Name | Description |
---|---|
booleanValue |
|
dateTimeValue |
|
dateValue |
|
numberValue |
|
sobjectValue |
|
stringValue |
|
FlowTestParameter
Defines parameters for the triggering record in the Start test point.
Field Name | Description |
---|---|
leftValueReference |
|
type |
|
value |
|
Declarative Metadata Sample Definition
The following is an example of a FlowTest component.
<?xml version="1.0" encoding="UTF-8"?>
<FlowTest xmlns="http://soap.sforce.com/2006/04/metadata">
<flowApiName>Example_Test</flowApiName>
<label>Test Two</label>
<testPoints>
<elementApiName>Start</elementApiName>
<parameters>
<leftValueReference>$Record</leftValueReference>
<type>InputTriggeringRecordInitial</type>
<value>
<sobjectValue>{"AnnualRevenue":100000,"BillingCity":"New York"}}</sobjectValue>
</value>
</parameters>
<parameters>
<leftValueReference>ScheduledPathApiName</leftValueReference>
<type>ScheduledPath</type>
<value>Every_Monday</value>
</parameters>
<parameters>
<leftValueReference>$Record</leftValueReference>
<type>InputTriggeringRecordUpdated</type>
<value>
<sobjectValue>{"AnnualRevenue":100000,"BillingCity":"New York"}</sobjectValue>
</value>
</parameters>
</testPoints>
<testPoints>
<assertions>
<conditions>
<leftValueReference>$Record.Industry</leftValueReference>
<operator>EqualTo</operator>
<rightValue>
<stringValue>Other</stringValue>
</rightValue>
</conditions>
<errorMessage>Industry was not set.</errorMessage>
</assertions>
<elementApiName>Finish</elementApiName>
</testPoints>
</FlowTest>
The following is an example package.xml that references the previous definition.
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
<types>
<members>Test_Two</members>
<name>FlowTest</name>
</types>
<version>55.0</version>
</Package>
Wildcard Support in the Manifest File
This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.