For those of you who haven’t heard of FitNesse yet Paul Stringer has made it very easy to get started.
I started writing acceptance tests using FitNesse a few months ago and loved it from the start. Finally I was able to move those flakey, sluggish UI tests down to the integration test layer and focus on testing the raw logic of my app – the important stuff!
But there was a problem with FitNesse. I found that it was impossible to debug when there was an error in my code. It could crash and FitNesse wouldn’t give me any information; it could fail and I couldn’t set a break point to figure out why. Disaster! Or so I thought.
FitNesse tests don’t run like unit tests. You run them from the command line or from the FitNesse wiki so you don’t have control over the running process. But there’s a simple solution to this – attach your acceptance tests process to Xcode. I knew you could attach Xcode to an already running process but I had no idea that you could tell Xcode to wait for a process to launch and then attach. Perfect!
It’s as easy as that! For extra ease you can add a custom keyboard shortcut in System Preferences to make attaching a process much quicker. I went for
⌥A. Another useful tip is to make sure you have an ‘All Exceptions’ break point too.
I hope this will help you to speed up the building of your acceptance tests!
Thanks to Mark Carter for showing me how to do this 👍