X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7fb83a3380e62721801a4980c48ba78208c7b2e2..40df5992d4d8071a6e10a20ecdeb0470a80764cc:/apps/workbench/test/integration_helper.rb?ds=sidebyside diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb index a8788ceb53..ebfbc584e8 100644 --- a/apps/workbench/test/integration_helper.rb +++ b/apps/workbench/test/integration_helper.rb @@ -25,6 +25,11 @@ class ActionDispatch::IntegrationTest @@API_AUTHS = self.api_fixture('api_client_authorizations') + def setup + reset_session! + super + end + def page_with_token(token, path='/') # Generate a page path with an embedded API token. # Typical usage: visit page_with_token('token_name', page) @@ -48,4 +53,20 @@ class ActionDispatch::IntegrationTest false end end + + @@screenshot_count = 0 + def screenshot + image_file = "./tmp/workbench-fail-#{@@screenshot_count += 1}.png" + page.save_screenshot image_file + puts "Saved #{image_file}" + end + + teardown do + if not passed? + screenshot + end + if Capybara.current_driver == :selenium + page.execute_script("window.localStorage.clear()") + end + end end