I am trying to write a KIF Test to check logging in two different accounts in my app.
Now the problem is that I need to fetch data from the DetailView that the user sees after first login, and compare that to the data seen after the second login and confirm that the data are different.
From what I understand KIF first adds all steps to an array and then executes those steps one by one. How do I grab data from one step and pass that data to the second step?
I've setup a singleton object that's only in my KIF target, and the first scenario that KIF runs initializes it and loads a bunch of test data (creates new user etc).
It's basically a fancy version of NSDictionary
, where you can arbitrarily add and remove objects for keys. But the data stays around between steps AND scenarios, instead of just steps. So in that respect you need to remember to remove data if you want to reuse keys.