You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Invoke tests for Apex, Flows and Agentforce agents in an org.
3
+
Invoke tests for Apex, Flows, and Agentforce agents in an org.
4
4
5
5
# description
6
6
7
-
This command provides a single and unified way to run tests for multiple Salesforce features, such as Apex classes, Flows and Agentforce agents. Running the tests together with a single command ensures seamless interoperability between the features.
7
+
This command provides a single and unified way to run tests for multiple Salesforce features, such as Apex classes, Flows, and Agentforce agents. Running the tests together with a single command ensures seamless interoperability between the features.
8
8
9
-
By default, the command executes asynchronously and returns a test run ID. Then use the "sf logic get test" command to retrieve the results. If you want to wait for the test run to complete and see the results in the command output, use the --synchronous flag.
9
+
By default, the command executes asynchronously and returns a test run ID. Then use the displayed "sf logic get test" command to retrieve the results. If you want to wait for the test run to complete and see the results in the command output, use the --synchronous flag.
10
10
11
-
To run specific tests, use the --tests flag and pass it the names of Apex and Flow tests. For Apex, simply specify the name of the Apex test class. For Flows, use the format "FlowTesting.<name-of-flow-test>". To find the name of all the flow tests in your org, run this command and specify the Flow category, such as "sf logic run test --synchronous --test-category Flow --test-level RunAllTestsInOrg". The command displays a table of all the flow tests it ran; see the "TEST NAME" column for the full name of all available flow tests in your org.
11
+
To run specific tests, use the --tests flag and pass it the names of Apex, Flow, and Agentforce agent tests. Here's how to find the name of each type of test:
12
12
13
-
You can also run specific test methods, although if you run the tests synchronously, the methods must belong to a single Apex class or Flow test. To run all tests of a certain category, use --test-category and --test-level together. If neither of these flags is specified, all local tests for all categories are run by default. You can also use the --class-names and --suite-names flags to run Apex test classes or suites.
13
+
- For Apex, simply specify the name of the Apex test class.
14
+
- For Flows, use the format "FlowTesting.<name-of-flow-test>". To find the name of all the Flow tests in your org, run this command and specify the Flow category, such as "sf logic run test --synchronous --test-category Flow --test-level RunAllTestsInOrg". The command displays a table of all the Flow tests it ran; see the "TEST NAME" column for the full name of all available Flow tests in your org.
15
+
- For Agentforce agents, use the format "AgentTesting.<name-of-agent-test>". To find the names of all the Agentforce agent tests in your org, run the "sf agent test list" command. The command displays the available agent tests in the "API Name" column.
14
16
15
-
To see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level summary of the test run and the code coverage values for the tested classes, flows or Agentforce agents. If you specify human-readable result format, use the --detailed-coverage flag to see detailed coverage results for each test method run.
17
+
You can also run specific test methods, although if you run the tests synchronously, the methods must belong to a single Apex class, Flow test, or Agentforce agent test. To run all tests of a certain category, use --test-category and --test-level together. If neither of these flags is specified, all local tests for all categories are run by default. You can also use the --class-names and --suite-names flags to run Apex test classes or suites.
18
+
19
+
To see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level summary of the test run and the code coverage values for the tested Apex classes, Flows, or Agentforce agents. If you specify human-readable result format, use the --detailed-coverage flag to see detailed coverage results for each test method run.
16
20
17
21
You must have the "View All Data" org system permission to use this command. The permission is disabled by default and can be enabled only by a system administrator.
18
22
19
23
# examples
20
24
21
-
- Run a mix of specific Apex and Flow tests asynchronously in your default org:
25
+
- Run a specific Agentforce agent test asynchronously in your default org:
0 commit comments