-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.rb
28 lines (21 loc) · 776 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
25
26
27
#!/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
#target = "ios"
if target == 'android'
exec("export APP=prebuilt/TrustedInsight.apk && bundle exec calabash-android run $APP -p android #{ARGV.join(' ')}")
elsif target == 'ios'
exec("export APP=prebuilt/TrustedInsight.app && export APP_BUNDLE_PATH=$APP && bundle exec cucumber -p ios #{ARGV.join(' ')}")
else
puts "Invalid target #{target}"
end
#if you wanna take a report after test, add this command after exec command --format html --out reports.html