Can someone post some help. I have tried different config but can't run Calabash Android tests from within Rubymine. Works on Terminal though.
3 Answers
Finally found the solution after some trial and error. Here is what you need to do on Rubymine:
EDIT Runner Options and add: APP_PATH= "" and TEST_APP_PATH="" and run the feature file. This should do it.
Thanks,

- 3,643
- 2
- 18
- 14
Method, suggested by Manpreet Singh, uses cucumber as the test runner. Here you need to define APP_PATH and TEST_APP_PATH environmental variables:
- APP_PATH will need to be reset if apk file or file name changes (e.g. uploaded a new version of the apk)
- TEST_APP_PATH points to the test server file, which is generated by calabash when you try to connect calabash to your new apk for the first time (e.g. with "calabash-android run" or "calabash-android console"), or if previous test server file was deleted
This way it's easier to create a new test using "Right-click on a scenario or feature file > Create configuration" in RubyMine thanks to its robust cucumber support
Another method is, as pointed by Dave, to set up a calabash-android run as a gem executable - see this thread for details.
- Need to set apk path only
This way, your execution is the same as in the command line and passing arguments (such as cucumber profile, output options etc) will work for sure. Also, such configuration is less fragile to the test_server change. However, it's a bit more cobersome to setup than as a cucumber run.
After all with the current architecture of calabash, I still prefer to code in IDE but run in the command line :) IDE becomes very useful, when you need to debug tests.

- 91
- 6
-
Was trying Point 2 above and figured that : 1) Environment variable should have the ANDROID_HOME path for Rubymine to find android sdk 2) --profile default argument isnt mandatory. Worked perfectly. Thanks again. – trial999 Jul 06 '15 at 21:58
-
Thanks for your comment, trial999. I believe that you need ANDROID_HOME set regardless whether you use RubyMine or not: https://github.com/calabash/calabash-android/blob/master/documentation/installation.md . Yeap, "default" profile was used only as an example, that you can pass any cucumber command line arguments this way. – alex.ikhelis Jul 07 '15 at 22:42
the setting above does not work for me
here is the setting worked. basically, in Run/Debug configureation, need to create a Gem command to execute calabash-android, and correct arguments, not a configure for Cucumber .
http://daedalus359.wordpress.com/2013/11/02/getting-calabash-to-play-nicely-with-rubymine/
-dave

- 11
- 2
-
3Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. Links can go dead etc. – user13500 Mar 18 '14 at 23:55
-