-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
executable file
·28 lines (24 loc) · 933 Bytes
/
Rakefile
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
28
# frozen_string_literal: true
require 'cucumber/rake/task'
require 'json'
namespace :vivino do
desc 'Vivino task scheduler #allure'
task :run, :platform do |_task, args|
platform = args.platform || 'android'
ENV['PLATFORM'] = platform.downcase
Cucumber::Rake::Task.new(:local) do |t|
if ENV['BROWSERSTACK'] && ENV['BROWSERSTACK'] == 'ON'
response = `curl -u '#{ENV['BROWSERSTACK_USERNAME']}:#{ENV['BROWSERSTACK_ACCESS_KEY']}' -X POST 'https://api.browserstack.com/app-automate/upload' -F 'file=@app/app-world-beta.apk' -F 'custom_id=VivinoApp'`
ENV['VIVINO_BS_APP'] = JSON.parse(response)['app_url']
end
t.cucumber_opts = 'features/scenarios/**.feature'
end
Rake::Task[:local].invoke
end
desc 'Vivino task scheduler #generic'
task :html do
Cucumber::Rake::Task.new(:html) do |t|
t.cucumber_opts = 'features/scenarios/**.feature -p html'
end
end
end