Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running Calabash Android from Rubymine

Tags:

calabash

Can someone post some help. I have tried different config but can't run Calabash Android tests from within Rubymine. Works on Terminal though.

like image 719
Manpreet Singh Avatar asked Jan 12 '23 03:01

Manpreet Singh


2 Answers

Finally found the solution after some trial and error. Here is what you need to do on Rubymine: Runner Options

EDIT Runner Options and add: APP_PATH= "" and TEST_APP_PATH="" and run the feature file. This should do it.

Thanks,

like image 114
Manpreet Singh Avatar answered May 17 '23 10:05

Manpreet Singh


  1. 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

enter image description here

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

  1. 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

enter image description here

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.

like image 44
alex.ikhelis Avatar answered May 17 '23 08:05

alex.ikhelis