Search code examples
calabashcalabash-android

Calabash how to speed up execution time


I have a Android device connected to my PC. Running a calabash test I use the following command:

calabash-android run <NAME>.apk features/<NAME>.feature

Now before running a feature Calabash always uploads the application again witch takes time.

How can I disable this?

Any help would be appreciated!

Thank you!


Solution

  • You can control the reinstallation of the app using the hooks file. This contains the cucumber hooks for before and after scenario. If you didn't make the hooks file that you are running then it's probably one from a sample project.

    The bit you're looking for is the 'reinstall_apps' command. If you remove it completely then your app won't ever be reinstalled, which can be a bad thing as it's sometimes necessary to reset the app completely. The way I handle it is to tag the features where I do want the app reinstalled with @reinstall_app and then

    Before do |scenario|
      puts "Starting scenario - #{scenario.name}"
      reinstall_app if scenario.source_tag_names.include?('@reinstall_app'))
      ...
    end