Search code examples
androidiosdirectory-structurecalabash

Calabash directory structure for testing both Android and iOS


This is the current structure for the automation test.

  • automationRepo
    • Docs
    • features
      • support
        • framework
      • step_definitions
        • config
        • lib
      • featurefile.feature
    • logs

With the support directory I have support files which run for Android. What I've done to make this run on iOS is replace with the iOS support files.

Question is how can I choose to run iOS or Android without having switching the support files over.

I tried this:

  • automationRepo
    • Docs
    • features
      • support (iOS / android)
        • framework
      • step_definitions
        • config
        • lib
      • featurefiles
        • featurefile.feature
    • logs
    • android
      • support (android)
        • framework
      • step_definitions (symlink)
      • featurefiles (symlink)
    • iOS
      • support (iOS)
        • framework
      • step_definitions (symlink)
      • featurefiles (symlink)

This didn't work because the featurefile needed to be at a higher level than step_definitions, or at least that what appeared to be the problem.

Has anyone else managed to solve this problem?


Solution

  • The feature file should be in your feature folder's root alongside android and ios folders.

    - automationRepo
     - feature
       - android (folder)
       - ios (folder)
       - step_definitions (folder)
       - support (folder)
       - your_feature_file.feature
    

    PS: I'm using a BDD framework named sunomono (https://rubygems.org/gems/sunomono), previously named cs-bdd to generate a directory structure and write calabash tests using Screen Objects design patterns. It's a easier way!