forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
selenium.rb
26 lines (20 loc) · 836 Bytes
/
selenium.rb
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
class Selenium < BaseGenerator
def selenium_test(args)
create_deps_(args[:name], args)
test_root = "http://localhost:4444/selenium-server/tests/"
file "#{args[:name]}_never_there" do
classpath = JavaGen.new().build_classpath_(args[:name]).collect do |c|
c.to_s =~ /\.jar/ ? c : nil
end
classpath.uniq!
debug = ENV['debug'] == "true" ? "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 " : ""
cmd = "java #{debug} -cp #{classpath.join(classpath_separator?)} org.openqa.selenium.server.htmlrunner.HTMLLauncher "
cmd += "build #{test_root}TestSuite.html #{test_root} true #{args[:browser]}"
sh cmd
end
task args[:name] => "#{args[:name]}_never_there"
end
end
def selenium_test(args)
Selenium.new().selenium_test(args)
end