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
66
67
68
69
|
# File 'lib/hollandaise/cli.rb', line 23
def sauce(*browsers)
if browsers.first && browsers.first[%r{^http}]
url = browsers.shift
else
url = Hollandaise.url
end
if Hollandaise.browsers && browsers.empty?
browsers = Hollandaise.browsers
end
browser_objects = Hollandaise::Browsers.for(browsers, options)
browser_objects.run do |browser|
browser.run_and_take_screenshot(url)
end
html = Arbre::Context.new do
html do
head do
title "Sauce Labs screenshots for #{url}"
end
body do
table do
thead do
tr do
browser_objects.each do |browser|
th browser.browser
end
end
end
tbody do
browser_objects.each do |browser|
td(:valign => :top) do
img(:src => browser.target)
end
end
end
end
end
end
end
File.open('index.html', 'wb') { |fh| fh.print html.to_s }
end
|