Allow single test method execution from an Apex Class - Ideas - Salesforce Trailblazer Community
Trailblazer Community

All Ideas

Idea Details

Post an Idea
This idea has been delivered and can no longer be voted or commented on. If you’d like to add to this conversation, please post a new idea.
960  Points voting closed
Delivered in Summer 15
Idea is generally available.

Allow single test method execution from an Apex Class

Developer Tools

 Usually we have many testXXX methods in a Apex test class. But we might need to run all of them at all times. An example scenario can be to debug into 1 failing test method out of 20. Currently we have to do some hacks to make it work for ex. 
  • Create a temporary Apex Test class and copy paste all the test case setup code and failing test method to it.
  • Remove testMethod keyword/annotation from Non-Failing test method's signatures.
I guess it will reduce loads on sfdc servers too, if developer is interested in single test method execution result, then why run all of them.

Please promote this idea and let me know your views.

· Flag

Latest Comment from Salesforce

  • Josh Kaplan - 6 years ago

    We have a backlog item to add test-suite capabilities to Apex, and in general disconnect the methods from their parent classes from a running perspective.  Running one test at a time would be a single-method test suite, so this would be part of this feature when it gets built.
  • Upvotes
  • Downvotes



from AppExchange

Help us to keep IdeaExchange clean by pointing out overlapping ideas. We'll investigate your suggestion and merge the ideas if it makes sense.



Thanks for your merge suggestion. We will review it shortly and merge the ideas if applicable.

Salesforce takes abuse situations very seriously. Examples of abuse include but are not limited to posting of offensive language or fraudulent statements. To help us process your request as quickly as possible, please fill out the form below describing the situation. For privacy and security reasons, the final outcome of an abuse case may not be revealed to the person who reported it.


Thank you for your feedback. We take abuse seriously and will investigate this issue and take appropriate action.