grid_tools 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/grid_tools +32 -14
- data/lib/grid_tools/version.rb +1 -1
- data/lib/grid_tools.rb +2 -2
- metadata +1 -1
data/bin/grid_tools
CHANGED
@@ -35,27 +35,45 @@ command :start do |c|
|
|
35
35
|
end
|
36
36
|
|
37
37
|
if args[0] == "hub"
|
38
|
-
|
38
|
+
if GridTools.windows?
|
39
39
|
binaries = File.expand_path(File.dirname(File.expand_path(__FILE__)) + '/../binaries')
|
40
|
-
|
40
|
+
binaries.gsub!("/", "\\")
|
41
|
+
cmd = "start java -jar #{binaries}\\selenium-server-standalone-2.29.0.jar -role hub -browserTimeout 300"
|
41
42
|
system cmd
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
43
|
+
puts "Started a hub."
|
44
|
+
else
|
45
|
+
#if `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/).count < 3
|
46
|
+
binaries = File.expand_path(File.dirname(File.expand_path(__FILE__)) + '/../binaries')
|
47
|
+
cmd = "java -jar #{binaries}/selenium-server-standalone* -browserTimeout 300 -role hub >> ~/hub.log 2>&1 &"
|
48
|
+
system cmd
|
49
|
+
pid = `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/)[0]
|
50
|
+
puts "Started a hub. [pid: #{pid}]"
|
51
|
+
#else
|
52
|
+
# raise "Hub or node already started,"
|
53
|
+
#end
|
54
|
+
end
|
47
55
|
end
|
48
56
|
|
49
57
|
if args[0] == "node"
|
50
|
-
|
58
|
+
if GridTools.windows?
|
51
59
|
binaries = File.expand_path(File.dirname(File.expand_path(__FILE__)) + '/../binaries')
|
52
|
-
|
60
|
+
binaries.gsub!("/", "\\")
|
61
|
+
cmd = "start java -jar #{binaries}\\selenium-server-standalone-2.29.0.jar -role wd -hub http://#{options[:h]}:4444/grid/register -trustAllSSLCertificates"
|
53
62
|
system cmd
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
63
|
+
puts "Started a node."
|
64
|
+
else
|
65
|
+
#if `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/).count < 3
|
66
|
+
binaries = File.expand_path(File.dirname(File.expand_path(__FILE__)) + '/../binaries')
|
67
|
+
platform = "MAC" if GridTools.mac?
|
68
|
+
platform = "LINUX" if GridTools.linux?
|
69
|
+
cmd = "java -jar #{binaries}/selenium-server-standalone* -role wd -hub http://#{options[:h]}:4444/grid/register -browser \"browserName=firefox,maxInstances=5,platform=#{platform}\" -browser \"browserName=chrome,maxInstances=5,platform=#{platform}\" -trustAllSSLCertificates >> ~/node.log 2>&1 &"
|
70
|
+
system cmd
|
71
|
+
pid = `ps -e -o pid,args | awk '/selenium-server/ { print $1 }'`.split(/\n/)[0]
|
72
|
+
puts "Started a node. [pid: #{pid}]"
|
73
|
+
#else
|
74
|
+
# raise "Hub or node already started."
|
75
|
+
#end
|
76
|
+
end
|
59
77
|
end
|
60
78
|
|
61
79
|
|
data/lib/grid_tools/version.rb
CHANGED
data/lib/grid_tools.rb
CHANGED