templates/test_suite.rb in prologue-0.3.6 vs templates/test_suite.rb in prologue-0.3.7
- old
+ new
@@ -18,14 +18,31 @@
gsub_file 'features/support/env.rb',/require 'cucumber\/rails\/capybara_javascript_emulation'/,'#require \'cucumber/rails/capybara_javascript_emulation\''
run 'mkdir spec/factories'
-create_file 'features/step_definitions/helper_steps.rb' do
+create_file 'features/step_definitions/web_steps_extended.rb' do
<<-'FILE'
When /^I confirm a js popup on the next step$/ do
page.evaluate_script("window.alert = function(msg) { return true; }")
page.evaluate_script("window.confirm = function(msg) { return true; }")
+end
+
+When /^I perform the following actions:$/ do |table|
+ table.hashes.each do |row|
+ case row['Action']
+ when 'Fill in'
+ Given "I fill in \"#{row['Field']}\" with \"#{row['Value']}\""
+ when 'Check'
+ if row['Value'] =~ /true/
+ Given "I check \"#{row['Field']}\""
+ else
+ Given "I uncheck \"#{row['Field']}\""
+ end
+ when 'Choose'
+ Given "I choose \"#{row['Field']}\""
+ end
+ end
end
FILE
end
create_file 'features/step_definitions/factory_steps.rb' do
\ No newline at end of file