forked from flowplayer/flowplayer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
52 lines (43 loc) · 1.55 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
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 :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']
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"
Rake::Task[:run_features].execute()
end
end
Cucumber::Rake::Task.new(:run_features)
task :default => [:cucumber]