Sha256: 73de2cc3731b869e5de758a8d8e407ea7063c50e79754e499142e3a4d04618f3

Contents?: true

Size: 918 Bytes

Versions: 5

Compression:

Stored size: 918 Bytes

Contents

require 'rubygems'
require 'rake'

task :default => :ios

# Run sh and ignore exception
def run_sh cmd
  begin
    sh cmd
  rescue
  end
end

# Run cmd. On failure run install and try again.
def bash cmd
  sh cmd do |successful, result|
    # exitstatus 7 means bundle install failed
    # exitstatus 1 means the test failed
    if !successful && result.exitstatus === 7
      Rake::Task['install'].execute
      run_sh cmd
    end
  end
end

# Run a single test with:
# rake ios['ios/element/generic']
#
# rake ios['driver']
#
# Run all tests with:
# rake ios
desc 'Run the iOS tests'
task :ios, :args, :test_file do |args, test_file|
  # rake android['ok']
  # args = android
  # test_file = {:args=>"ok"}
  test_file         = test_file[:args]
  cmd = 'bundle exec ruby ./lib/run.rb ios'
  cmd += %Q( "#{test_file}") if test_file
  bash cmd
end

desc 'Run bundle install'
task :install do
  sh 'bundle install'
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
appium_lib-6.0.0 ios_tests/Rakefile
appium_lib-5.0.1 ios_tests/Rakefile
appium_lib-5.0.0 ios_tests/Rakefile
appium_lib-4.1.0 ios_tests/Rakefile
appium_lib-4.0.0 ios_tests/Rakefile