Search in sources :

Example 1 with JobConfigHistory

use of org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory in project acceptance-test-harness by jenkinsci.

the class JobConfigHistoryPluginTest method show_difference_in_config_history.

@Test
public void show_difference_in_config_history() {
    FreeStyleJob job = jenkins.jobs.create();
    job.configure();
    ShellBuildStep step = job.addShellStep(LS_COMMAND);
    job.save();
    job.configure();
    step.command(LS_LH_COMMAND);
    job.save();
    JobConfigHistory action = job.action(JobConfigHistory.class);
    action.open();
    assertThat(driver, Matchers.hasContent(CREATED));
    assertThat(driver, Matchers.hasContent("Changed"));
    action.showLastChange();
    assertThat(driver, Matchers.hasElement(by.xpath("//td[@class='diff_original' and contains(string(.), '" + String.format(COMMAND_NODE, LS_COMMAND) + "')]")));
    assertThat(driver, Matchers.hasElement(by.xpath("//td[@class='diff_revised' and contains(string(.), '" + String.format(COMMAND_NODE, LS_LH_COMMAND) + "')]")));
}
Also used : JobConfigHistory(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory) ShellBuildStep(org.jenkinsci.test.acceptance.po.ShellBuildStep) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 2 with JobConfigHistory

use of org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory in project acceptance-test-harness by jenkinsci.

the class JobConfigHistoryPluginTest method track_change_in_matrix_project.

@Test
@Issue("JENKINS-24410")
@WithPlugins("matrix-project")
public void track_change_in_matrix_project() {
    MatrixProject job = jenkins.jobs.create(MatrixProject.class);
    JobConfigHistory history = job.action(JobConfigHistory.class);
    List<Change> original = history.getChanges();
    job.configure();
    job.runSequentially.check();
    job.save();
    List<Change> newOnes = history.getChanges();
    assertThat("New changes saved", newOnes.size(), greaterThan(original.size()));
}
Also used : JobConfigHistory(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory) Change(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory.Change) MatrixProject(org.jenkinsci.test.acceptance.po.MatrixProject) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Example 3 with JobConfigHistory

use of org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory in project acceptance-test-harness by jenkinsci.

the class PrioritySorterPluginTest method saving_global_config_should_not_create_job_change.

// Reproduce regression fixed in https://github.com/jenkinsci/priority-sorter-plugin/commit/e46b2b1fbc4396f441c69692eb328fb982325572
@Test
@WithPlugins("jobConfigHistory")
public void saving_global_config_should_not_create_job_change() {
    FreeStyleJob job = jenkins.jobs.create();
    job.save();
    JobConfigHistory action = job.action(JobConfigHistory.class);
    final int expected = action.getChanges().size();
    final JenkinsConfig global = jenkins.getConfigPage();
    global.configure();
    global.numExecutors.set(42);
    global.save();
    assertThat(action.getChanges().size(), equalTo(expected));
}
Also used : JobConfigHistory(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory) JenkinsConfig(org.jenkinsci.test.acceptance.po.JenkinsConfig) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Example 4 with JobConfigHistory

use of org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory in project acceptance-test-harness by jenkinsci.

the class JobConfigHistoryPluginTest method track_change_in_maven_project.

@Test
@Issue("JENKINS-24410")
@WithPlugins("maven-plugin")
public void track_change_in_maven_project() {
    MavenModuleSet job = jenkins.jobs.create(MavenModuleSet.class);
    JobConfigHistory history = job.action(JobConfigHistory.class);
    List<Change> original = history.getChanges();
    job.configure();
    job.goals.set("clean");
    job.save();
    List<Change> newOnes = history.getChanges();
    assertThat("New changes saved", newOnes.size(), greaterThan(original.size()));
}
Also used : JobConfigHistory(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory) Change(org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory.Change) MavenModuleSet(org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Aggregations

AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)4 JobConfigHistory (org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory)4 Test (org.junit.Test)4 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)3 Change (org.jenkinsci.test.acceptance.plugins.job_config_history.JobConfigHistory.Change)2 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)2 Issue (org.jvnet.hudson.test.Issue)2 MavenModuleSet (org.jenkinsci.test.acceptance.plugins.maven.MavenModuleSet)1 JenkinsConfig (org.jenkinsci.test.acceptance.po.JenkinsConfig)1 MatrixProject (org.jenkinsci.test.acceptance.po.MatrixProject)1 ShellBuildStep (org.jenkinsci.test.acceptance.po.ShellBuildStep)1