Continuing my obsessive testing strategy, I had to set up KIF for UI Automation Tests. Honestly it’s surprising I didn’t do it earlier, but since the UI is very simple I was getting better ROI doing unit tests – I see KIF as a sanity check, not as a way to debug anything.
Step 1: I went through the app with the Accessibility Inspector on and made sure everything had an accessibility label.
Step 2: I made a new test target for KIF tests, and made sure it ran OK. I made a mistake at first and created a Mac testing bundle rather than Cocoa touch (I don’t know why it was even on that screen, I have never made a Mac anything).
Step 3: Added KIF as a submodule.
Step 4: Followed these instructions (which are very good).
Step 5: Trying to debug baffling error messages about pulling in SenTestCase which shouldn’t be required because I’m using XCTest (the default). Adding it as a dependency out of desperation, getting duplicate symbol errors. Some time figuring out what an #ifndef does (basically – if defined). Feeling very discouraged.
Step 6: Pair programming (or, pair-debugging). In desperation, as we have no other ideas, I delete the (theoretically unused) OCUnit targets. Everything works. I am enraged. We are both confused.
Step 7: Check in time! Oh wait, it’s not, because I have edited a submodule.
Step 8: Fork KIF. Delete the two OCUnit targets again (here’s the repo if anyone else needs such a thing).
Step 9: Replace the official submodule with my submodule. Realize I now need to keep these in sync. Forever. Why do we programming.
Step 10: Sync. Everything works again.
Step 11: Write some KIF tests. This takes approximately 5% of the time I spent on getting everything set up.
Step 12: Go to the gym for several hours. Forget what happened.
Step 13: Next thing on the TODO list.