cauende
cauende

Reputation: 135

How to view class test coverage line by line?

I am trying to see test coverage line by line in a class, however, only the first line is highlighted.

enter image description here

The Show Inline Statistics setting is enabled.

enter image description here

I get the test coverage for the class, methods and lines as below:

enter image description here

I remember this worked in a previous version of Android Studio (ca't exactly remember which). How can enable the feature so that coverage is shown for all lines.

Upvotes: 1

Views: 3096

Answers (2)

Yogesh Nevse
Yogesh Nevse

Reputation: 61

Step 1 - Run testDebugUnitTest with coverage Click here to see unit test coverage

Step 2 - Generate coverage report - click on icon as shown in above image (yellow highlighted) give exported path to generate html file.

Step 3 - Click on index.html file to view report.

You will get test coverage percentage for class, method and line as shown in below image Click here to see test coverage class

click here to see overall coverage summary

Upvotes: 4

Yang Liu
Yang Liu

Reputation: 1380

Run the test with coverage, then you can see it line by line:

enter image description here

Upvotes: -1

Related Questions