Skip to content

Commit fda404f

Browse files
committed
Pass browser instance
1 parent 254a5b7 commit fda404f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/spec_helper.rb

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

69-
save_exception_log(filename, line_number, timestamp)
70-
save_exception_screenshot(filename, line_number, timestamp)
69+
save_exception_log(browser, filename, line_number, timestamp)
70+
save_exception_screenshot(browser, filename, line_number, timestamp)
7171
end
7272

73-
def save_exception_screenshot(filename, line_number, timestamp)
73+
def save_exception_screenshot(browser, filename, line_number, timestamp)
7474
screenshot_name = "screenshot-#{filename}-#{line_number}-#{timestamp}.png"
7575
screenshot_path = "/tmp/ferrum/#{screenshot_name}"
7676
browser.screenshot(path: screenshot_path, full: true)
7777
rescue => e
7878
puts "#{e.class}: #{e.message}"
7979
end
8080

81-
def save_exception_log(filename, line_number, timestamp)
81+
def save_exception_log(browser, filename, line_number, timestamp)
8282
log_name = "logfile-#{filename}-#{line_number}-#{timestamp}.txt"
8383
File.open("/tmp/ferrum/#{log_name}", "wb") { |file| file.write(FERRUM_LOGGER.string) }
8484
rescue => e

0 commit comments

Comments
 (0)