Skip to content

Commit ed0df71

Browse files
committed
Pass browser instance
1 parent 9ce609f commit ed0df71

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

spec/spec_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,19 +109,19 @@ def save_exception_aftifacts(browser, meta)
109109
line_number = meta[:line_number]
110110
timestamp = "#{time_now.strftime('%Y-%m-%d-%H-%M-%S.')}#{'%03d' % (time_now.usec/1000).to_i}"
111111

112-
save_exception_log(filename, line_number, timestamp)
113-
save_exception_screenshot(filename, line_number, timestamp)
112+
save_exception_log(browser, filename, line_number, timestamp)
113+
save_exception_screenshot(browser, filename, line_number, timestamp)
114114
end
115115

116-
def save_exception_screenshot(filename, line_number, timestamp)
116+
def save_exception_screenshot(browser, filename, line_number, timestamp)
117117
screenshot_name = "screenshot-#{filename}-#{line_number}-#{timestamp}.png"
118118
screenshot_path = "/tmp/cuprite/#{screenshot_name}"
119119
browser.screenshot(path: screenshot_path, full: true)
120120
rescue => e
121121
puts "#{e.class}: #{e.message}"
122122
end
123123

124-
def save_exception_log(filename, line_number, timestamp)
124+
def save_exception_log(browser, filename, line_number, timestamp)
125125
log_name = "logfile-#{filename}-#{line_number}-#{timestamp}.txt"
126126
File.open("/tmp/cuprite/#{log_name}", "wb") { |f| f.write(browser.logger.string) }
127127
rescue => e

0 commit comments

Comments
 (0)