From 90134e06c917949765eb077701d3f815f38fdb4d Mon Sep 17 00:00:00 2001 From: "R. Tyler Croy" Date: Tue, 31 Jul 2012 16:54:23 -0700 Subject: [PATCH] Refactor step definitions into much more logical files --- features/step_definitions/general_steps.rb | 8 +++ .../job_configuration_steps.rb | 43 ++++++++++++ .../{freestyle_steps.rb => job_steps.rb} | 65 ++----------------- 3 files changed, 58 insertions(+), 58 deletions(-) create mode 100644 features/step_definitions/job_configuration_steps.rb rename features/step_definitions/{freestyle_steps.rb => job_steps.rb} (54%) diff --git a/features/step_definitions/general_steps.rb b/features/step_definitions/general_steps.rb index e736030..ef3a24c 100644 --- a/features/step_definitions/general_steps.rb +++ b/features/step_definitions/general_steps.rb @@ -1,6 +1,14 @@ #!/usr/bin/env ruby # vim: tabstop=2 expandtab shiftwidth=2 +When /^I visit the home page$/ do + visit "/" +end + +When /^I click the "([^"]*)" checkbox$/ do |name| + find(:xpath, "//input[@name='#{name}']").set(true) +end Then /^the page should say "([^"]*)"$/ do |content| page.should have_content(content) end + diff --git a/features/step_definitions/job_configuration_steps.rb b/features/step_definitions/job_configuration_steps.rb new file mode 100644 index 0000000..aedc659 --- /dev/null +++ b/features/step_definitions/job_configuration_steps.rb @@ -0,0 +1,43 @@ + +When /^I configure the job$/ do + @job.configure +end + +When /^I add a script build step to run "([^"]*)"$/ do |script| + @job.add_script_step(script) +end + +When /^I tie the job to the "([^"]*)" label$/ do |label| + @job.configure do + @job.label_expression = label + end +end + +When /^I tie the job to the slave$/ do + step %{I tie the job to the "#{@slave.name}" label} +end + +When /^I enable concurrent builds$/ do + step %{I click the "_.concurrentBuild" checkbox} +end + +When /^I add a string parameter "(.*?)"$/ do |string_param| + @job.configure do + @job.add_parameter("String Parameter",string_param,string_param) + end +end +When /^I add an Ant build step for:$/ do |ant_xml| + @job.configure do + @job.add_script_step("cat > build.xml < build.xml <