Skip to content

Instantly share code, notes, and snippets.

@Alona-T
Created May 26, 2020 14:33
Show Gist options
  • Save Alona-T/10f38e34c95cd6b78963cf770d86f382 to your computer and use it in GitHub Desktop.
Save Alona-T/10f38e34c95cd6b78963cf770d86f382 to your computer and use it in GitHub Desktop.
require 'rake'
require 'json'
require 'cucumber/rake/task'
task :ios_browserstack, [:device] do |_task, args|
device = args.device
ENV['DEVICE_NAME'] = device
ENV['SERVER'] = 'BROWSERSTACK'
puts "<< Device #{device} >>"
mkdir_p(["./tmp", "./reports"], verbose: false)
system "cucumber features/scenarios/*.feature" +
" --exclude features/pages/android" +
" --exclude features/step_definitions/android" +
" --format html" +
" --out reports/output.html" +
" --format pretty" +
" --guess" +
" PLATFORM=IOS" +
" SERVER=BROWSERSTACK" +
" DEVICE_NAME=#{device}"
end
#to run on particular Android device
task :android_browserstack, [:device] do |_task, args|
device = args.device
ENV['DEVICE_NAME'] = device
ENV['SERVER'] = 'BROWSERSTACK'
puts "<< Device #{device} >>"
mkdir_p(["./tmp", "./reports"], verbose: false)
system "cucumber features/scenarios/*.feature" +
" --exclude features/pages/ios" +
" --exclude features/step_definitions/ios" +
" --format html" +
" --out reports/output.html" +
" --format pretty" +
" --guess" +
" PLATFORM=ANDROID" +
" SERVER=BROWSERSTACK" +
" DEVICE_NAME=#{device}"
end
task :clean do
rm_rf "tmp"
rm_rf "screenshot.png"
rm_rf "reports"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment