We were planning to use UI Tests for a work project. For my home business, since 2004, I wrote my own UI testing infrastructure that will serve as a plan B.
Anyhow, we found that our first UI test refused to work with a saved file that holds application state. To simpifly this for this discussion, lets say you have a simple file that contains a boolean. false is the default, true means the user configured the app.
In our main view controller, we look at our file and then segue to one of two destinations based upon its contents.
In the UI Test suite's setup, we added code to write out our file with desired starting state. But when the UI test is run, our app always is in the default state. Unit tests run a-ok. We have tests such as this:
assert false that the file exists
call some function to create the settings file
assert true it exists and have valid contents.
Finally, what's truly strange is that I put print statements in our main controller's viewDidAppear. That's where we load up our settings file and segue appropriately. If I put a breakpoint on that code and run our UI test, the breakpoint is hit. The line is printed to the console. But, our settings file at that point has defaults (not how it was during the suite's setup).
But... if I remove that breakpoint and just run the test, I never see the print output in the console. So it has the appearance that viewDidAppear is not being called at all.
If anyone can shed light on what may be happening, that would be great. Otherwise, we'll scrap our plans and just use a known working home-grown infrastructure.