summaryrefslogtreecommitdiff
path: root/features/support
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-08-21 21:26:51 -0700
committerStan Hu <stanhu@gmail.com>2017-08-21 21:26:51 -0700
commit7b79ec07278887e31a34a7a2fae7f1af44b8c8e5 (patch)
tree389f6d0f13e45bb06dc35959ab43ba4f82c19c53 /features/support
parentdda33bd76ad1e26aca133f2dc176900d8a64dafa (diff)
downloadgitlab-ce-7b79ec07278887e31a34a7a2fae7f1af44b8c8e5.tar.gz
Fix milestone Spinach tests by confirming modal only if it is present
Diffstat (limited to 'features/support')
-rw-r--r--features/support/capybara_helpers.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/features/support/capybara_helpers.rb b/features/support/capybara_helpers.rb
new file mode 100644
index 00000000000..647f8d087c3
--- /dev/null
+++ b/features/support/capybara_helpers.rb
@@ -0,0 +1,10 @@
+module CapybaraHelpers
+ def confirm_modal_if_present
+ if Capybara.current_driver == Capybara.javascript_driver
+ accept_confirm { yield }
+ return
+ end
+
+ yield
+ end
+end