Does anyone know what happened to test results for Xcode 11 UI testing?

Viewed 3115

I used to be able to access results in Derived Data inside the .xcresults package. .xcresults package still exists, but where there used to be a file named "TestSummaries.plist", and subdirectories containing attachments (like screenshot files, etc), there is now a subdir named "Data" which contains binary format files. So now I can no longer programmatically extract screenshot files, or upload test results to a database like qTest or ALM.

I have confirmed that Xcode 10 still outputs results in the old format. I have searched on my machine for the "TestSummaries.plist" file or similar artifacts thinking that perhaps they would be in a different location. No luck so far.

2 Answers

Apple changed the format of xcresult starting in Xcode 11. In order to get items out of it now, you have to go through Xcode's xcresulttool (xcrun xcresulttool), but it can be entirely cumbersome as you have to go through multiple layers of data structures in the new tree structure just to get to your attachments (which can be hundreds of commands in xcresulttool if you have a large amount of tests).

My workplace open sourced a tool called xcparse that allows you to export out the screenshots from the new format (https://github.com/ChargePoint/xcparse). You can install it Homebrew: brew install chargepoint/xcparse/xcparse It simplifies the process by automating the xcresulttool calls & parsing you'd have to do.

Go to the “Report Navigator”, right click on the test in question, and choose “Show in Finder”:

enter image description here

In Finder, you’ll see an entry like Test-MyApp-2019.10.14_13-12-40--0700.xcresult, one for each test run.

In Finder, you can also right-click and choose “Show Package Contents” to see the individual files. By the way, this “Report Navigator” also gives a nice GUI for perusing the test results without going through the files, too.

Related