Search in sources :

Example 16 with Job

use of org.jenkinsci.test.acceptance.po.Job in project acceptance-test-harness by jenkinsci.

the class GitPluginNoDockerTest method generateJobWithBranch.

private Job generateJobWithBranch(GIT_IMPL type) {
    Job job = generateJob(type);
    GitScm scm = generateSCM(job).branch("recovery");
    useJGitIfNeccesary(type, scm);
    return job;
}
Also used : Job(org.jenkinsci.test.acceptance.po.Job) GitScm(org.jenkinsci.test.acceptance.plugins.git.GitScm)

Example 17 with Job

use of org.jenkinsci.test.acceptance.po.Job in project acceptance-test-harness by jenkinsci.

the class GitPluginNoDockerTest method generateSimpleJob.

private Job generateSimpleJob(GIT_IMPL type) {
    Job job = generateJob(type);
    GitScm scm = generateSCM(job);
    useJGitIfNeccesary(type, scm);
    return job;
}
Also used : Job(org.jenkinsci.test.acceptance.po.Job) GitScm(org.jenkinsci.test.acceptance.plugins.git.GitScm)

Example 18 with Job

use of org.jenkinsci.test.acceptance.po.Job in project acceptance-test-harness by jenkinsci.

the class GitPluginNoDockerTest method generateJobWithLocalDir.

private Job generateJobWithLocalDir(GIT_IMPL type) {
    Job job = generateJob(type);
    GitScm scm = generateSCM(job).localDir("local_dir");
    useJGitIfNeccesary(type, scm);
    return job;
}
Also used : Job(org.jenkinsci.test.acceptance.po.Job) GitScm(org.jenkinsci.test.acceptance.plugins.git.GitScm)

Example 19 with Job

use of org.jenkinsci.test.acceptance.po.Job in project acceptance-test-harness by jenkinsci.

the class GitPluginNoDockerTest method generateJob.

private Job generateJob(GIT_IMPL type) {
    if (type.equals(GIT_IMPL.JGIT)) {
        JGitInstallation.addJGit(jenkins);
        find(by.button("Save")).click();
    }
    Job job = jenkins.jobs.create();
    return job;
}
Also used : Job(org.jenkinsci.test.acceptance.po.Job)

Example 20 with Job

use of org.jenkinsci.test.acceptance.po.Job in project acceptance-test-harness by jenkinsci.

the class JobDslPluginTest method should_create_new_job_by_using_template.

/**
 * Tests whether a new job with template created by JobDsl exists and includes
 * same description like the template job when the seed job is build.
 */
@Test
public void should_create_new_job_by_using_template() {
    // Arrange
    String testedJobName = "MyJob";
    String jobDescription = "My sample despription";
    Job templateJob = jenkins.jobs.create(FreeStyleJob.class, "Template");
    templateJob.configure();
    Control descriptionControl = templateJob.control(by.name("description"));
    descriptionControl.set(jobDescription);
    templateJob.save();
    String jobDslScript = String.format("job('%s') { using('%s') }", testedJobName, templateJob.name);
    Job seed = createSeedJobWithJobDsl(jobDslScript);
    // Act
    seed.scheduleBuild().shouldSucceed();
    // Assert
    Job job = jenkins.jobs.get(Job.class, testedJobName);
    job.open();
    assertThat(job.getDescription(), containsString(jobDescription));
}
Also used : Control(org.jenkinsci.test.acceptance.po.Control) ProjectDefaultBuildAccessControl(org.jenkinsci.test.acceptance.plugins.authorize_project.ProjectDefaultBuildAccessControl) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Job(org.jenkinsci.test.acceptance.po.Job) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Aggregations

Job (org.jenkinsci.test.acceptance.po.Job)55 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)48 Test (org.junit.Test)45 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)42 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)37 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)22 ListView (org.jenkinsci.test.acceptance.po.ListView)21 View (org.jenkinsci.test.acceptance.po.View)18 Build (org.jenkinsci.test.acceptance.po.Build)13 WebElement (org.openqa.selenium.WebElement)7 IOException (java.io.IOException)5 GerritTriggerJob (org.jenkinsci.test.acceptance.plugins.gerrit_trigger.GerritTriggerJob)5 GerritTriggerNewServer (org.jenkinsci.test.acceptance.plugins.gerrit_trigger.GerritTriggerNewServer)5 GerritTriggerServer (org.jenkinsci.test.acceptance.plugins.gerrit_trigger.GerritTriggerServer)5 GitScm (org.jenkinsci.test.acceptance.plugins.git.GitScm)5 Since (org.jenkinsci.test.acceptance.junit.Since)4 AnalysisAction (org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction)4 WorkflowJob (org.jenkinsci.test.acceptance.po.WorkflowJob)4 Issue (org.jvnet.hudson.test.Issue)4 Arrays (java.util.Arrays)3