I try to implement UI testing with the calabash-ios testing framework. I followed all the howtos, tutorials spread on the different sites (xamarin testcloud guide, on github for the calabash-ios framework, ...)
In my project folder I created the feature directory with calabash-ios gen
My project structure is like the following: (just some of the folder/file(s)
- Certificates
- Resources
- Solutions
- Source
|- B2.Device.Core.iOS
|- B2.Device.Service.iOS
|- B2.Device.iOS
|- AppDelegate.cs
|- B2.Device.iOS.csproj
|- Info.plist
|- MyFooViewController.cs
|- MyBarViewController.cs
|- bin
|- iPhone
|- iPhoneSimulator
|- Debug
|- *.dll
|- B2DeviceiOS.app
|- B2DeviceiOS.exe
|- features
|- my_first.freature
|- step_definitions
|- *.rb
|- support
Calling cucumber
inside Source/B2.Device.iOS/
throws an exception:
Dannys-MacBook-Air:B2.Device.iOS dannyyy$ cucumber
Feature: Running a test
As an iOS developer
I want to have a sample feature file
So I can begin testing quickly
Scenario: Example steps # features/my_first.feature:6
Unable to find *.xcodeproj in /Users/dannyyy/Projects/BauPlusMobile/Trunk/Source/B2.Device/B2.Device.iOS (RuntimeError)
/var/folders/6p/s4dwcb0x1yx9wjjk_51ds21r0000gn/T/Calabash-CA09BEA0-1735-4818-AB85-4874C6849183/Gems/gems/calabash-cucumber-0.9.162/lib/calabash-cucumber/launch/simulator_helper.rb:61:in `derived_data_dir_for_project'
/var/folders/6p/s4dwcb0x1yx9wjjk_51ds21r0000gn/T/Calabash-CA09BEA0-1735-4818-AB85-4874C6849183/Gems/gems/calabash-cucumber-0.9.162/lib/calabash-cucumber/launch/simulator_helper.rb:153:in `app_bundle_or_raise'
/var/folders/6p/s4dwcb0x1yx9wjjk_51ds21r0000gn/T/Calabash-CA09BEA0-1735-4818-AB85-4874C6849183/Gems/gems/calabash-cucumber-0.9.162/lib/calabash-cucumber/launcher.rb:148:in `relaunch'
/Users/dannyyy/Projects/BauPlusMobile/Trunk/Source/B2.Device/B2.Device.iOS/features/support/01_launch.rb:29:in `Before'
Given I am on the Welcome Screen # features/step_definitions/my_first_steps.rb:1
Then I swipe left # calabash-cucumber-0.9.162/features/step_definitions/calabash_steps.rb:237
And I wait until I don't see "Please swipe left" # calabash-cucumber-0.9.162/features/step_definitions/calabash_steps.rb:168
And take picture # calabash-cucumber-0.9.162/features/step_definitions/calabash_steps.rb:232
Failing Scenarios:
cucumber features/my_first.feature:6 # Scenario: Example steps
1 scenario (1 failed)
4 steps (4 skipped)
0m1.043s
How it's possible to have a XCode project file if I'm developing with the Xamarin.iOS environment? I tried also to set the DEVICE_BUNDLE_PATH=~/Projects/BauPlusMobile/Trunk/Source/B2.Device/B2.Device.iOS/bin/iPhoneSimulator/Debug
But of course the same exception will be thrown!
All the video demos and screencasts I have seen were working with Xamarin.iOS environment but without this error.
The only way to get working the tests is calling cucumber NO_LAUNCH=1
and starting the app within Xamarin Studio with debugger attached.
I hope some one can help me.
After a lot of try and error I got the solution for my problem. I guess I'll solve the problem in general for users which are working with the Xamarin.iOS environment.
*.csproj
> cd ~/Projects/MyProject/Trunk/Source/B2.Device/B2.Device.iOS
features
directory> calabash-ios gen
> sudo gem install calabash-cucumber
config
directory and change to it> mkdir config
> cd config
cucumber.yml
Put the following content into it (the profile name as well as the other environment variables could be changed to meet your need)
# YAML Template
---
ipad-sim: APP="~/Projects/MyProject/Trunk/Source/B2.Device/B2.Device.iOS/bin/iPhoneSimulator/Debug/B2DeviceiOS.app" BUNDLE_ID="tld.domain.project" SDK_VERSION=6.1
> calabash-ios -p ipad-sim
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With