Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 505
KerwinLumpkins Avatar asked Oct 14 '19 20:10

KerwinLumpkins


People also ask

How do I get unit test report in Xcode?

Go to File > New > Target. Select iOS Unit Testing Bundle and then click Next.

What is UI testing in Xcode?

UI testing allows you to automate this procedure, so every time you update your code, Xcode will automatically test whether your app works correctly without you having to manually do it.

What is the difference between XCTest and XCUITest?

Tests are run directly from Xcode and are written with either Swift or Objective C. XCUITest makes use of the application's accessibility functionality, which allows tests to interact with the app as a real user would.


Video Answer


1 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.

like image 143
Nobosi Avatar answered Oct 15 '22 11:10

Nobosi