Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b801f5e

Browse files
committedAug 12, 2014
spec/runner: capture entire page screenshot too
1 parent e85b91d commit b801f5e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed
 

‎spec/runner.rb

+13-5
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,22 @@
116116
ensure
117117
# take a screenshot and upload it to imgur
118118
begin
119-
browser.save_screenshot('screenshot.png')
120-
response = RestClient.post('https://api.imgur.com/3/upload',
121-
{ image: File.open('screenshot.png') },
122-
{ 'Authorization' => 'Client-ID 1979876fe2a097e' })
119+
upload = lambda do |filepath|
120+
response = RestClient.post('https://api.imgur.com/3/upload',
121+
{ image: File.open(filepath) },
122+
{ 'Authorization' => 'Client-ID 1979876fe2a097e' })
123+
124+
print JSON.parse(response.to_str)['data']['link']
125+
end
123126

124127
print " ("
125-
print JSON.parse(response.to_str)['data']['link']
128+
browser.save_screenshot('screenshot.png')
129+
upload['screenshot.png']
130+
print ", entire page: "
131+
browser.capture_entire_page_screenshot('full-screenshot.png')
132+
upload['full-screenshot.png']
126133
puts ")"
134+
127135
rescue Exception
128136
puts
129137
end

0 commit comments

Comments
 (0)
Please sign in to comment.