Using tags in Scenarios of Cucumber/Calabash

Examples:

I run cucumber with various combinations of the following tags:
  –tags @this_one  (used as a short-term tag so that I can run only specific scenario(s))
  –tags ~@known_to_pass   (skip all scenarios that I know always pass, so that I can concentrate on tests that always or sometimes fail
  –tags ~@known_to_fail  (as above, also I can do a File Search/grep for “known_to_pass”/”known_to_fail” and update my boss on the state of the project/test cases
  –tags @BUG_XYZ (run/locate/count all scenarios related to a specific bug/issue)
  –tags @skip  (skip all scenarios that are known to fail and cause subsequent test cases to fail)
  –tags @ios –tags ~@android  (run only scenarios that apply to iPhone/iPad, but not to Android)
  –tags @wip (run scenarios in progress)
  –tags @debug (run scenarios that I want debug)
and you can create yours 🙂

List of useful commands

1. You can see what is available for instrumentation

adb shell pm list instrumentation

 

2. List packages:

adb shell pm list packages

 

3. To get reports with the run:

calabash-android run mytest.apk –format html –out reports.html

 

4.To see logcat:

adb logcat

 

Fonts:

http://blog.lesspainful.com/2012/03/07/Calabash-Android/

https://github.com/calabash/calabash-android

7 Possible issues and fixes – Calabash android

  • 1. To get rid of warning about ansicolor (windows):

  • open cmd and navigate to the unzipped folder
  • Navigate to x64 (if you have a 64 bit machine) otherwise navigate to x86
  • Execute ‘ansicon.exe -i’ to install and add ansicon to your Windows
  • Run your cucumber test and you should
  • get the colored output result on Windows

 

  • 2. Warning about gem json ~>1.7.7 (Windows):

  • If the above, doesn’t fix it,
    • uninstall Ruby.
    • Install Ruby 1.9.x again
    • Make sure you also install the corresponding Devkit
    • gem install json -v 1.7.7
    • bundle update json

 

  • 3. Jarsigner: unable to sign jar

  • Rename the .apk file to .zip
  • Unpack the .zip file and remove the META-INF folder
  • Zip the folder again and rename it to .apk (zip -r <xxx.apk> *)
  • Sign the apk:
  • Copy your “Calabash” folder having “feature” file.

 

  • 4. No MD5 fingerprint found: (RuntimeError)

  • Paste it into your android workspace having gen, res, src folder. eg., ~/.android
  • Now, Test server will create inside your calabash folder.
  • Navigate to new path and again run apk file.

 

  • 5. If the AndroidManifest.xml is missing:

  • To create AndroidManifest.xml file:  where should this be?
  • calabash-android extract-manifest Downloads\mytest.apk

 

  • 6. If adb device not showing up in “adb devices”:

  • adb kill-server adb start-server adb devices

 

  • 7.Cannot load such file rspec/expectations:

  • Make sure you add the foll. line in your Gemfile
  • gem ‘rspec’