Merge branch '4400-python-install-herring' refs #4400
[arvados.git] / apps / workbench / test / integration_helper.rb
index ed6f7c21ea509d382632258683051fe93f3dceac..febcfcfec0eb2c87122ba00594dfffc9a3958d37 100644 (file)
@@ -49,11 +49,17 @@ class ActionDispatch::IntegrationTest
     end
   end
 
-  @@screenshot_count = 0
+  @@screenshot_count = 1
   def screenshot
-    image_file = "./tmp/workbench-fail-#{@@screenshot_count += 1}.png"
-    page.save_screenshot image_file
-    puts "Saved #{image_file}"
+    image_file = "./tmp/workbench-fail-#{@@screenshot_count}.png"
+    begin
+      page.save_screenshot image_file
+    rescue Capybara::NotSupportedByDriverError
+      # C'est la vie.
+    else
+      puts "Saved #{image_file}"
+      @@screenshot_count += 1
+    end
   end
 
   teardown do
@@ -63,5 +69,6 @@ class ActionDispatch::IntegrationTest
     if Capybara.current_driver == :selenium
       page.execute_script("window.localStorage.clear()")
     end
+    Capybara.reset_sessions!
   end
 end