How exactly do Espresso UI tests increase code coverage?

Viewed 19

I’m trying to increase my code coverage, and I’m using a standard jacoco gradle task that unifies both unit & instrumented test coverage.

I have Espresso UI tests for my fragments, but I’m getting no coverage for the lifecycle methods, and other methods(setting up toolbar, recycler, etc.) that the UI tests clearly must’ve called. My UI tests are checking for visibilities & contents of the views mainly.

testCoverageEnabled is enabled in gradle, and my adapter class is showing coverage data from the UI tests, but oddly not the fragment that instantiated the adapter?

Am I missing something here? The tests have to be calling these to create the fragment, but it’s showing 0% coverage.

0 Answers
Related