Here's my situation:
For the majority of my tests I want the application to start up clean, at which point I will create and login as a particular user and perform one or more tests. However, for some tests, for example testing behavior after persistence of credentials in the keychain, I'd like to be able to perform some actions and then restart the application without losing the keychain information.
I've read the documentation about the 'keepKeyChains' capability and this seems close to what I need but feels like it is in the wrong place in the lifecycle since you set it on startup but it applies to what happens when you reset/quit. Here's what I mean...
If I create and start my driver with keepKeyChains = false (the default) everything is fine for the majority of the tests within my testsuite (where i want things to be cleaned up before and after).
However, there is no option to the 'reset' or 'restart' commands that allows me to override this behavior at the time I issue the reset/restart. I've experimented with creating a new driver with 'keepyKeyChains = true' and starting it but that doesn't really help since it seems that the first thing that happens is the current driver quits and since it was started with keepKeyChains = false the keychain is wiped out. So i can't do that from within the test. If I do this before the specific test(s) I have a simllar problem at the end, I want to clean up after the test so that I'm back in the original state with keepKeyChains = false and no keychain data. But to do that I actually have to restart everything at least two more times (once to switch the driver back to keepKeyChains = false, and again to let it actually wipeout the keychain). This would be less of an issue if restarting the simulator/app was fast but given that it isn't there is a pretty significant penalty for all those restarts.
Perhaps I'm missing or misunderstanding something or there is another/better way to accomplish it?
Thanks in advance for any help/suggestions
-James