We are about to release a new version of one of our mobile apps at work, and until now we have had no budget for QA. I am however just about to enter in a conversation with a team that is actively running calabash. I decided that it was important to try it out. I decided to invest my evening into getting the project setup with calabash, and following are the results of that experimentation.
Start by installing calabash gem
I fire up my bash script (by dragging the folder I am working on to terminal) and run the following…
D’oh - I get a permission error - I need to use the correct version of ruby installed on my computer rather than the locked down old version that apple provides. Luckily I already have RVM, so….
This takes about 15mins on a dodgy internet connection. Now I have everything I need.
This outputs the following…
Oh - I’ve done something wrong :(. I decide that these ‘several’ projects all look like some sort of helpful backup that xcode is doing on my behalf, but I read online these aren’t necessary and should not be checked in with the solution, so I decide to delete them.
I Right Mouse on my xcodeproj and “Show package contents”, and then just remove these strange pbxproj BASE, BACKUP, LOCAL, REMOTE files using finder.
Run the command again…
I get the following warnings
(nad then repeated again for 6.1, 7.0.3, 7.1, and 7.1-64). I assume this is old emulators that aren’t working in Xcode 6+ so I decide to ignore them for now.
However below these warnings I also get the following…
Hmm - I guess it’s time to open xcode.
Open up the project - hmm pods aren’t there as this has been a fresh checkout, so I close xcode and run pod install
Now re-open xcode and have a look - I have a new scheme. Originally there was my app “Scrapbook”, but now I have a second “Scrapbook-cal”. I open this scheme and hit RUN!
Indeed when it’s running the debugger logs the following…
Looks good. Time to generate the default test….
I get a nice approval that everything is working, re-run the app in simulator and then do..
This didn’t work :(
Instead of finding the project there, I attempt to find it manually. To hack the APP_BUNDLE_PATH I read you can run a line. Originally I think I’ve found it here…
I’m sure someone smarter than me can figure out the right way of doing this, but I decide to hack it as follows…
This stopped or crashed the simulator, and I got errors.
I do some more digging and find that I was in the wrong directory entirely. Now I try the following…
The iOS simulator starts up. I watch as the commands start to run without any input.
The tests complete, and I even get a screenshot in the project’s root directory. I have run my first calabash test! Tomorrow I intend to write my first custom test.