File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,22 @@ def save_exception_aftifacts(browser, meta)
66
66
line_number = meta [ :line_number ]
67
67
timestamp = "#{ time_now . strftime ( "%Y-%m-%d-%H-%M-%S." ) } #{ "%03d" % ( time_now . usec /1000 ) . to_i } "
68
68
69
+ save_exception_log ( filename , line_number , timestamp )
70
+ save_exception_screenshot ( filename , line_number , timestamp )
71
+ end
72
+
73
+ def save_exception_screenshot ( filename , line_number , timestamp )
69
74
screenshot_name = "screenshot-#{ filename } -#{ line_number } -#{ timestamp } .png"
70
75
screenshot_path = "/tmp/ferrum/#{ screenshot_name } "
71
76
browser . screenshot ( path : screenshot_path , full : true )
77
+ rescue => e
78
+ puts "#{ e . class } : #{ e . message } "
79
+ end
72
80
81
+ def save_exception_log ( filename , line_number , timestamp )
73
82
log_name = "logfile-#{ filename } -#{ line_number } -#{ timestamp } .txt"
74
83
File . open ( "/tmp/ferrum/#{ log_name } " , "wb" ) { |file | file . write ( FERRUM_LOGGER . string ) }
84
+ rescue => e
85
+ puts "#{ e . class } : #{ e . message } "
75
86
end
76
87
end
You can’t perform that action at this time.
0 commit comments