summaryrefslogtreecommitdiffstats
path: root/features/support/hooks.rb
diff options
context:
space:
mode:
Diffstat (limited to 'features/support/hooks.rb')
-rw-r--r--features/support/hooks.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/features/support/hooks.rb b/features/support/hooks.rb
index 6693120..35e9f2d 100644
--- a/features/support/hooks.rb
+++ b/features/support/hooks.rb
@@ -244,6 +244,11 @@ After('@product') do |scenario|
info_log("Scenario failed at time #{elapsed}")
screen_capture = @screen.capture
save_failure_artifact("Screenshot", screen_capture.getFilename)
+ if scenario.exception.kind_of?(FirewallAssertionFailedError)
+ Dir.glob("#{$config["TMPDIR"]}/*.pcap").each do |pcap_file|
+ save_failure_artifact("Network capture", pcap_file)
+ end
+ end
$failure_artifacts.sort!
$failure_artifacts.each do |type, file|
artifact_name = sanitize_filename("#{elapsed}_#{scenario.name}#{File.extname(file)}")
@@ -253,7 +258,12 @@ After('@product') do |scenario|
info_log
info_log_artifact_location(type, artifact_path)
end
- pause("Scenario failed") if $config["INTERACTIVE_DEBUGGING"]
+ if $config["INTERACTIVE_DEBUGGING"]
+ pause(
+ "Scenario failed: #{scenario.name}. " +
+ "The error was: #{scenario.exception.class.name}: #{scenario.exception}"
+ )
+ end
else
if @video_path && File.exist?(@video_path) && not($config['CAPTURE_ALL'])
FileUtils.rm(@video_path)