In the last post I discussed about setting up the Mac environment for running Calabash-ios tests from Xamarin studio. In Mac, we can run the calabash-tests on simulator easily by using the Fast Track steps if using Xcode or by using these steps if using Xamarin studio. To run on a device in mac we need to identify the device ip address and use it in the terminal like this
DEVICE_ENDPOINT=http://192.168.1.146:37265 NO_LAUNCH=1 calabash-ios console
NO_LAUNCH=1 disables the simulator launch. Now if you launch the app in the device and run queries in the terminal it would work.
Running tests on Windows machine
On Windows machine we can run tests only on device and not on simulator(couldnt find a simulator for ios on windows yet). You can setup Calabash framework on windows using gem install as specified in the calabash ios github wiki page.
Since we cannot build the Xamarin ios project completely on windows without a mac host, we assume that we have a .ipa file built from Mac setup which has the Calabash-framework force loaded. Copy the .ipa file built from Mac to Windows machine where you want to run tests. Connect the device to your windows machine and then open the .ipa file using itunes. It will list the app(say MyApp) under Apps category in itunes and then you can drag and copy it to the device(your device would be listed in the side pane and when you drag the app it will show the connected device and you can drop on the device name and it would install in device). Then you should be able to launch the app in the device and it would also have started the calabash-server.
And , if you are following the cucumber.yml file(as mentioned in field-service-example), you can modify the ios profile like this,ios: DEVICE_ENDPOINT=http://[ipofdevice]:37265 NO_LAUNCH=1 DEVICE=[udid] CALABASH_FULL_CONSOLE_OUTPUT=TRUE NO_STOP=1 OS=ios6 PLATFORM=ios -r features/support -r features/ios/support -r features/ios/helpers -r features/step_definitions -r features/ios/pages
and then in command prompt you can run something like(for login feature) cucumber -p ios features/login.feature .
NOTE: I haven't yet figured out how to use the bundle id and have the tests automatically start the app in device yet and if i do so, I will either update this post or enter a new blog to keep track of it.
Happy Testing :)