-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.rb
executable file
·24 lines (21 loc) · 862 Bytes
/
run.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env ruby
target = ARGV.shift
unless system("bundle version")
puts "Can't find bundler. Check your ruby environment."
puts "If your using ~/.calabash then run:"
puts <<EOF
export GEM_HOME=~/.calabash
export GEM_PATH=~/.calabash
export PATH="$PATH:$HOME/.calabash/bin"
EOF
exit(false)
end
if target == 'android'
exec("export APP=prebuilt/atlas.apk && bundle exec calabash-android run $APP -p android #{ARGV.join(' ')} --format html --out reports.html")
elsif target == 'android-xamarin'
exec("export APP=prebuilt/Sky.Ott.Atlas.Mobile.Poc.Android.Nightly-Signed.apk && bundle exec calabash-android run $APP -p android-xamarin #{ARGV.join(' ')}")
elsif target == 'ios'
exec("export APP=prebuilt/WordPress-cal.app && export APP_BUNDLE_PATH=$APP && bundle exec cucumber -p ios #{ARGV.join(' ')}")
else
puts "Invalid target #{target}"
end