If you haven't already, set up VS Code for Salesforce
- Click the Debug icon
- In the drop down list at the top under Debug, Add Configuration. Select Apex Replay Debugger
- Make sure that you have pulled all your code and tests down from source control or from your org.
- Using Ctrl-Shift-P on Windows or Command-Shift-P on a Mac, select SFDX: Turn On Apex Debug Log for Replay Debugger
- Set a break point in your test
- Run your test by clicking Run Test above the test method name in VS Code
- Using Ctrl-Shift-P on Windows or Command-Shift-P on a Mac, select SFDX: Turn Off Apex Debug Log for Replay Debugger
- Using Ctrl-Shift-P on Windows or Command-Shift-P on a Mac, select SFDX: Get Apex Debug Logs
- Click the Debug icon
- Click the Launch Apex Replay Debugger
- You can see local variables on the left and you can step into code
No comments:
Post a Comment