function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Samuel WolfeSamuel Wolfe 

Create one shared record for all tests in a class

I have a test class with 70+ tests in it. Every single tests needs to create an Account, a Contact, and several custom objects. All of these Accounts, Contacts, etc... are the exact same.

Since all of these records need to be inserted again in every test case, this test class takes a very long time to run. Is it possible to create the account/contacts/etc... only 1 time, and have it be accessible in every test class so I don't have to re-insert them 77 times each?
MantoManto
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_testing_testsetup_using.htm