This is a list of useful commands in Calabash for Android. The Ruby API is assumed. :exclamation: many of the cheats here are Ruby and not Calabash. This is probably because my Ruby sucks :)
- Where do I use these? In the
step_definitions.rb
file
- print things:
p some_command
- query the element hierarchy and print it out:
p query("*")
- get current activity:
current_activity
This is a Ruby feature. Use the rspec-expectations
RubyGem as documented here: 1 and 2.
- First install this gem:
gem install rspec-expectations
- then in features/support/env.rb:
require 'rspec/expectations'
- finally, you can assert like so:
expect(actual_value).to eq("expected value")