Determines which test runner to use based on available metadata types in the org.
This function checks for the presence of:
AiEvaluationDefinition
AiTestingDefinition
If a test definition with the same name exists in both metadata types, an error is thrown to prevent ambiguity.
The Salesforce connection
Optional
Optional test definition name to check for conflicts
'agentforce-studio' if only Agentforce Studio metadata exists, 'testing-center' if only Testing Center metadata exists
if both metadata types exist with the same test definition name
if neither metadata type exists
const runnerType = await determineTestRunner(connection, 'MyTestSuite');if (runnerType === 'agentforce-studio') { const tester = new AgentforceStudioTester(connection);} else { const tester = new AgentTester(connection);} Copy
const runnerType = await determineTestRunner(connection, 'MyTestSuite');if (runnerType === 'agentforce-studio') { const tester = new AgentforceStudioTester(connection);} else { const tester = new AgentTester(connection);}
Determines which test runner to use based on available metadata types in the org.
This function checks for the presence of:
AiEvaluationDefinition(Testing Center)AiTestingDefinition(Agentforce Studio)If a test definition with the same name exists in both metadata types, an error is thrown to prevent ambiguity.