From 0e66f6a81b2f2cd6424b3efba92ef48bd7a32ea5 Mon Sep 17 00:00:00 2001 From: John Bintz Date: Wed, 22 Aug 2012 13:33:06 -0400 Subject: [PATCH] also add confirm js --- lib/cuke-pack/support/confirm_js.rb | 4 ++++ skel/features/support/cuke-pack.rb | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 lib/cuke-pack/support/confirm_js.rb 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'