Question

My Android application have to synchronize data in the first time. It spend about 15 minute for synchronization. And in secondtime, I don't need get data from server. But when a run calabash to test feature: calabash-android run MyApp.apk I feel it remove all data in my app and rebuild application. So, how to keep data when I run feature Scenario for my app?

My scenario :

   Feature: create work order

As a techinical I want to create work orders So I can manage WO easier

Scenario: Technician create work order successfully

 Given I am on the Create Work Order Screen
    And I select customer name which is "Harris Teeter"
    And I select equipment serial number which is "1A100438"
    And I select Job code "1" and then is "100 HOUR SERVICE"
    And I select order type "401"
    And I input valid title "Create new work order"
    And I input valid description "Work order description"
    Then I see the successful messages "The new work order has been created successfully"
Was it helpful?

Solution

Try command

NO_LAUNCH=1 cucumber --format html --out index.html features/Your_feature_file.feature

It won't relaunch your app. But you need to run the app first time before you run this command. As long as your app in the foreground this command works.

Note: I use this for iPhone testing it should work on android too.

OTHER TIPS

This is because calabash-android reinstall app before run every scenario. To avoid that, you can comment this code in app_installation_hooks.rb file in android support folder

uninstall_apps
install_app(ENV["TEST_APP_PATH"])
install_app(ENV["APP_PATH"])
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top