Sha256: 570f7541be4116e09f1131f71bbaad73e69a561d0b3fb97ffab5e3ba0d43ce6e

Contents?: true

Size: 1.46 KB

Versions: 1

Compression:

Stored size: 1.46 KB

Contents

require 'calabash'

platform = Calabash::Environment.variable('PLATFORM')

case platform
  when 'android'
    require 'calabash/android'

    World(Calabash::Android)

    # Setup the default application
    Calabash::Application.default =
        Calabash::Android::Application.default_from_environment

    identifier = Calabash::Android::Device.default_serial
    server = Calabash::Android::Server.default

    # Setup the default device
    Calabash::Device.default =
        Calabash::Android::Device.new(identifier, server)
  when 'ios'
    require 'calabash/ios'

    World(Calabash::IOS)

    # Setup the default application
    Calabash::Application.default =
        Calabash::IOS::Application.default_from_environment

    identifier =
        Calabash::IOS::Device.default_identifier_for_application(Calabash::Application.default)

    server = Calabash::IOS::Server.default

    # Setup the default device
    Calabash::Device.default =
        Calabash::IOS::Device.new(identifier, server)
  else
    message = if platform.nil? || platform.empty?
                'No platform given'
              else
                "Invalid platform '#{platform}'. Expected 'android' or 'ios'"
              end

    failure_messages =
        [
            'ERROR! Unable to start the cucumber test:',
            message,
            "Use the profile 'android' or 'ios', or run cucumber using $ calabash run"
        ]

    Calabash::Logger.error(failure_messages.join("\n"))
    exit(1)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
calabash-1.9.9.pre1 lib/calabash/lib/skeleton/features/support/env.rb