iOS UI automated tests: reusing app-data between devices
I am writing an iOS app and I started adding UI automated tests. I am using xcode7.1.1.
As the app relies heavily on data and a logged-in user - I want to create an app-data package and reuse it when running the tests, so when a test starts - there is already a logged-in user with some data in the app.
I followed this guide: http://corporationunknown.com/blog/2014/07/10/preloading-development-data-into-your-ios-app/ And it works perfectly fine when I:
- Install the app on a real device (iPhone), play with it and download the app-data to a file
- Add the file to my project and execute my tests using that app-data - on the same real device
Ideally I would be able to:
- Create the app-data form a simulator instead of a real device
- Be able to use the app-data on any device, ideally a simulator
See, the thing is that for other team members to add UI tests - it would be best if we can simulate some scenario, save the app-data, include it in the project and allow anyone to use it on any device (real or simulator).
I tried running the app with the app-data (again - generated on a real device) on a simulator with no success. It is simply ignored and the app starts empty.
- Is it possible to run an app with a pre-loaded app-data created from a different device? If yes - how? Does it require editing the contents of the package?
- Is it possible to create an app-data package from a simulator?
This might provide you some more information on it's current state, https://github.com/lionheart/openradar-mirror/issues/6578