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.
Go to File > New > Target. Select iOS Unit Testing Bundle and then click Next.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With