Refresh and Show coloring Code Coverage data
There are three additional options at the top of the Code Coverage panel.
- Refresh — it allows you to refresh the code coverage results — they can be not accurate if you changed the code and made a new test run. Clicking this button is not doing a re-run of all your tests, nor it is doing any static analysis to figure out how much of the code would be covered. It is merely providing a visualization of the coverage based on the most recent runs of each Apex test.
- Export to CSV — it helps you to export the code coverage data to a .csv file.
- Show Coloring — it turns on highlighting within the code: green color marks a covered code, and red color marks an uncovered code. Also, you will see the notification that this coloring can be not actual if you changed the code.
In the message bar, that is located in the upper part of the code editor, you can see a drop-down with the list of unit tests that are covering code in the opened file. Also here you can find the information about code coverage percentage that is provided by each of the unit tests. If you need to see the code coverage coloring by unit test, just select the unit test in the dropdown and the editor will show you appropriate highlighting.
In this section:
This also may be useful: