What is Test Suite?
Running specific set of test classes is a complex one and it’s hard to run them one by one. Salesforce has come up with new feature called Test Suite. Test Suite acts as container, and using this feature you can add a set of test classes and run them together. You can add up to a maximum of 200 test classes per TestSuite.
From the beginning of Spring 16 release orgs.
This feature is accessible via “Developer Console” in both Salesforce Classic and Lightning Experience.
How to Create New Suite?
Go to Developer Console > Select Test > New Suite.
Enter a name for your test suite and click OK.
Select and add the list of classes you are going to frequently run and click Save.
What is New Suite Run?
New Suite Run allows you to run TestSuites (Which contain list of classes).
To run one or more TestSuite, go to Developer Console > Select Test > New Suite Run.
Select the Test Suites from the Available Test Suites, and then select and Run Suites.
Specify Run Parameters:
You can specify run parameter on Settings before running the test Suites. This functionality allows you to stop your test run from executing new tests after a given number of tests fail. You can set the failure threshold to an integer value from 0 to 1,000,000. This integer value sets the maximum number allowable test failures. A value of 0 causes the test run to stop if any failure occurs. A value of 1 causes the test run to stop after the second failure, and so on.
How to use Suite Manager?
Suite Manager allows you to do the following,
- Create a New Suite.
- Edit a Suite. (Adding and removing Classes).
- Delete a Suite.
To navigate to Suite Manager, go the Developer Console [Symbol] Select Test > Suite Manager.
Here is the suite manager view.
How to query list of Test Suites and Test Suite Members?
ApexTestSuite: To know the list of available Test Suites.
Select Id, Name FROM ApexTestSuite
TestSuiteMembership: Represents a class in an ApexTestSuite.
SELECT Id FROM TestSuiteMembership WHERE ApexTestSuiteId = ’05FD00000004CDBMA2′