diff --git a/lib/cuke-pack/support/confirm_js.rb b/lib/cuke-pack/support/confirm_js.rb new file mode 100644 index 0000000..27957d0 --- /dev/null +++ b/lib/cuke-pack/support/confirm_js.rb @@ -0,0 +1,4 @@ +def confirm_js + page.evaluate_script('window.confirm = function() { return true; }') + page.evaluate_script('window.alert = function() { return true; }') +end diff --git a/skel/features/support/cuke-pack.rb b/skel/features/support/cuke-pack.rb index 00d66f5..4c985b3 100644 --- a/skel/features/support/cuke-pack.rb +++ b/skel/features/support/cuke-pack.rb @@ -1,5 +1,6 @@ require 'cuke-pack/support/pause' require 'cuke-pack/support/pending' +require 'cuke-pack/support/confirm_js' Before do # if you want pending steps to pause before marking the step as pending, @@ -23,3 +24,7 @@ require 'cuke-pack/support/flay' # Timecop support # require 'cuke-pack/support/timecop' + +# Browser drivers +# use with ENV['DRIVER'] +# require 'cuke-pack/driver/firefox'