I am using XCode Version 7.1 (7B91b) on my local MAC. And testing my app on the Simulator iPhone 6 (iOS9).
I have created Unit tests for my app, then I found that the code coverage was about 34%. I decided to create UI tests to increase the code coverage. But unfortunately, the code coverage did not increase.
I made a simple trial,
create a project with NavBarContrl, FirstTabelViewController & SecondTableViewController, keep the unit tests as default
Leave unit tests, add one record in UI Tests to navigate from first table view controller to the second. (I am expecting that Both First/Second Table View Controllers must be highlighted in the final Code Coverage report, right?)
Make sure code coverage is enabled
Run Tests then check code coverage, it is 40%
Take a look on the attached code coverage result, Second View Controller coverage is zero !! although when I was watching the simulator, it did navigate from first view controller to the second one. It can't be zero.
is there anything that I m missing here? I tried to search in Apple official Documentation but cant find any explicit contradiction to have code coverage with UI Testing, any suggestions?