Allow preloading custom application data for UI Tests

Originator:matej
Number:rdar://28776130 Date Originated:14-Oct-2016 07:17 PM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 8.0
Classification:Enhancement Reproducible:Always
 
Summary:

Xcode allows preloading of custom application data in form of a .xcappdata file in the scheme editor. This is true for both the Run and Test actions. Adding a custom .xcappdata data file however doesn’t work in the context of a UI Testing bundle. The set test data simply does not show up in the main application. 

Steps to Reproduce:

Set an appropriate .xcappdata file to a Xcode UI Testing scheme as shown in the attached screenshot. Run the UI test.

Expected Results:

The provided data from the .xcappdata file would used in the tested app. 

Actual Results:

The app is not modified in any way. 

Regression:

Xcode 8.0. Did also not work with Xcode 7. The results are the same, regardless of the selected simulator / device. 

Notes:

Similar reports:
 - https://twitter.com/fafner/status/671688376362409984
 - https://forums.developer.apple.com/message/84760#84760

The feature would be important to allow consistent test data for UI Tests and automated screenshot gathering. A possible workaround would be to modify the main application to provide appropriate test data when the application detects its being launched in a testing environment, however this makes it difficult to keep test data separate from the main application bundle. Testa data inside the main application data increases the app bundle size and is thus something we would like to avoid.

Comments

Me too

This is still broken on Xcode 9

Screenshot

https://cloudup.com/cX6yeYWNeSZ


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!