forked from flowplayer/flowplayer
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
65 lines (53 loc) · 1.84 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
require 'rubygems'
require 'cucumber'
require 'cucumber/rake/task'
require 'parallel'
require 'json'
@browsers = JSON.load(open('features/support/browsers.json'))
@browser = ENV["browser"]
@parallel_limit = ENV["nodes"] || 1
@parallel_limit = @parallel_limit.to_i
task :local do
ENV['LOCAL_BROWSER'] = "true"
Rake::Task[:run_features].execute()
ENV['splash'] = "true"
Rake::Task[:run_features].execute()
end
task :cucumber do
current_browser = ""
Parallel.map(@browsers, :in_threads => @parallel_limit) do |browser|
current_browser = browser
if @browser and browser['browser'] != @browser and browser['browserName'] != @browser
next
end
#puts "Running with: #{browser.inspect}"
ENV['BROWSER'] = browser['browser']
ENV['BROWSER_VERSION'] = browser['browser_version']
ENV['BROWSER_NAME'] = browser['browserName']
ENV['DEVICE'] = browser['device']
ENV['OS'] = browser['os']
ENV['OS_VERSION'] = browser['os_version']
ENV['PLATFORM'] = browser['platform']
Rake::Task[:run_features].execute()
end
Parallel.map(@browsers, :in_threads => @parallel_limit) do |browser|
current_browser = browser
if @browser and browser['browser'] != @browser and browser['browserName'] != @browser
next
end
#puts "Running with splash: #{browser.inspect}"
ENV['BROWSER'] = browser['browser']
ENV['BROWSER_VERSION'] = browser['browser_version']
ENV['BROWSER_NAME'] = browser['browserName']
ENV['DEVICE'] = browser['device']
ENV['OS'] = browser['os']
ENV['OS_VERSION'] = browser['os_version']
ENV['splash'] = "true"
ENV['PLATFORM'] = browser['platform']
Rake::Task[:run_features].execute()
end
end
Cucumber::Rake::Task.new(:run_features) do |t|
t.cucumber_opts = %w(--format progress)
end
task :default => [:cucumber]