X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/30d4c3f8f1d4d303c66fc568b11c34be7c51f2a8..62a0bbe9c1f6e3376b25d0f415302eb7dcdf55f3:/apps/workbench/test/integration_helper.rb diff --git a/apps/workbench/test/integration_helper.rb b/apps/workbench/test/integration_helper.rb index 3d92585135..067a1bdae8 100644 --- a/apps/workbench/test/integration_helper.rb +++ b/apps/workbench/test/integration_helper.rb @@ -221,4 +221,19 @@ class ActionDispatch::IntegrationTest end Capybara.reset_sessions! end + + def accept_alert + if Capybara.current_driver == :selenium + (0..9).each do + begin + page.driver.browser.switch_to.alert.accept + break + rescue Selenium::WebDriver::Error::NoSuchAlertError + sleep 0.1 + end + end + else + # poltergeist returns true for confirm, so no need to accept + end + end end