Port over the job disabling scenario

This commit is contained in:
R. Tyler Croy 2012-07-31 05:28:37 -07:00
parent 217d69452e
commit 76a13cab7d
3 changed files with 30 additions and 4 deletions

View File

@ -54,5 +54,10 @@ Feature: Configure/build freestyle jobs
When I run the job
Then the build should succeed
Scenario: Disable a job
Given a job
When I disable the job
Then it should be disabled
And it should have an "Enable" button on the job page
# vim: tabstop=2 expandtab shiftwidth=2

View File

@ -90,13 +90,30 @@ Then /^I should be prompted to enter the "(.*?)" parameter$/ do |param_name|
end
When /^I add an Ant build step for:$/ do |ant_xml|
@job.add_script_step("cat > build.xml << EOF
#{ant_xml}
@job.configure do
@job.add_script_step("cat > build.xml <<EOF
#{ant_xml}
EOF")
@job.add_ant_step('hello', 'build.xml')
@job.save
@job.add_ant_step('hello', 'build.xml')
end
end
Then /^the build should succeed$/ do
@job.last_build.succeeded?.should be true
end
When /^I disable the job$/ do
@job.configure do
@job.disable
end
end
Then /^it should be disabled$/ do
page.should_not have_content 'Build Now'
end
Then /^it should have an "(.*?)" button on the job page$/ do |button|
@job.open
page.should have_xpath("//button[text()='Enable']")
end

View File

@ -91,6 +91,10 @@ module Jenkins
find(:xpath, "//input[@name='_.assignedLabelString']").set(expression)
end
def disable
check 'disable'
end
def self.create_freestyle(base_url, name)
visit("#{@base_url}/newJob")