Search in sources :

Example 6 with Since

use of org.jenkinsci.test.acceptance.junit.Since in project acceptance-test-harness by jenkinsci.

the class OwnershipPluginTest method implicitly_set_job_ownership.

@Test
@Since("1.509")
public void implicitly_set_job_ownership() {
    GlobalSecurityConfig security = new GlobalSecurityConfig(jenkins);
    security.configure();
    JenkinsDatabaseSecurityRealm realm = security.useRealm(JenkinsDatabaseSecurityRealm.class);
    security.save();
    final JenkinsConfig globalConfig = jenkins.getConfigPage();
    globalConfig.configure();
    new OwnershipGlobalConfig(globalConfig).setImplicitJobOwnership();
    globalConfig.save();
    User user = realm.signup("jenkins-acceptance-tests-user");
    jenkins.login().doLogin(user);
    FreeStyleJob job = jenkins.jobs.create();
    job.save();
    elasticSleep(1000);
    assertThat(job, ownedBy(user));
}
Also used : OwnershipGlobalConfig(org.jenkinsci.test.acceptance.plugins.ownership.OwnershipGlobalConfig) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) Since(org.jenkinsci.test.acceptance.junit.Since)

Example 7 with Since

use of org.jenkinsci.test.acceptance.junit.Since in project acceptance-test-harness by jenkinsci.

the class SshSlavesPluginTest method newSlave.

@Test
@Since("1.560")
public void newSlave() {
    // Just to make sure the dumb slave is set up properly, we should seed it
    // with a FS root and executors
    final DumbSlave s = jenkins.slaves.create(DumbSlave.class);
    {
        SshSlaveLauncher l = s.setLauncher(SshSlaveLauncher.class);
        String username = "user1";
        String privateKey = "1212122112";
        String description = "Ssh key";
        l.host.set("127.0.0.1");
        // make sure this exists
        l.credentialsId.resolve();
        try {
            l.credentialsId.select(String.format("%s (%s)", username, description));
            fail();
        } catch (NoSuchElementException e) {
        // ignore
        }
        SshCredentialDialog f = l.addCredential();
        {
            SshPrivateKeyCredential sc = f.select(SshPrivateKeyCredential.class);
            sc.description.set(description);
            sc.username.set(username);
            sc.selectEnterDirectly().privateKey.set(privateKey);
        }
        f.add();
        l.credentialsId.select(String.format("%s (%s)", username, description));
    }
    s.save();
}
Also used : SshSlaveLauncher(org.jenkinsci.test.acceptance.plugins.ssh_slaves.SshSlaveLauncher) SshPrivateKeyCredential(org.jenkinsci.test.acceptance.plugins.ssh_credentials.SshPrivateKeyCredential) SshCredentialDialog(org.jenkinsci.test.acceptance.plugins.ssh_credentials.SshCredentialDialog) Matchers.containsString(org.hamcrest.Matchers.containsString) DumbSlave(org.jenkinsci.test.acceptance.po.DumbSlave) NoSuchElementException(org.openqa.selenium.NoSuchElementException) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) DockerTest(org.jenkinsci.test.acceptance.junit.DockerTest) Since(org.jenkinsci.test.acceptance.junit.Since)

Example 8 with Since

use of org.jenkinsci.test.acceptance.junit.Since in project acceptance-test-harness by jenkinsci.

the class AbstractAnalysisTest method should_store_trend_selection_in_cookie.

/**
 * Runs the test case {@link #should_have_trend_graph_with_relative_links_in_freestyle_job()} with a job that
 * contains a space in the name. Then the trend is deactivated in the trend configuration view: now the trend should
 * be replaced with a link to re-enable the trend. Finally, this link is clicked in order open the trend
 * configuration again.
 */
@Test
@Issue({ "JENKINS-25917", "JENKINS-32377" })
@Since("2.0")
public void should_store_trend_selection_in_cookie() {
    Job job = buildFreestyleJobTwoTimesInARow();
    assertThat(job.name, containsString("_"));
    job = job.renameTo(job.name.replace("_", " "));
    AnalysisAction action = createProjectAction(job);
    verifyTrendGraphOverview(job, action, getNumberOfWarnings());
    deactivateTrendGraph(job, action);
}
Also used : AnalysisAction(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction) Job(org.jenkinsci.test.acceptance.po.Job) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) Since(org.jenkinsci.test.acceptance.junit.Since)

Example 9 with Since

use of org.jenkinsci.test.acceptance.junit.Since in project acceptance-test-harness by jenkinsci.

the class AnalysisCollectorPluginTest method should_have_clickable_trend_details.

/**
 * Builds a freestyle job. Verifies that afterwards a trend graph exists for each of the participating plug-ins.
 * Finally, the collector trend graph is verified that contains 6 relative links to the
 * plug-in results (one for each priority and build).
 */
@Test
@Issue("JENKINS-30304")
@Since("1.640")
public void should_have_clickable_trend_details() {
    FreeStyleJob job = createFreeStyleJob();
    buildJobAndWait(job);
    buildSuccessfulJob(job);
    job.open();
    AnalysisAction action = createProjectAction(job);
    List<WebElement> graphLinks = job.all(By.linkText("Enlarge"));
    assertThat(graphLinks.size(), is(8));
    // Last link is the summary
    graphLinks.get(graphLinks.size() - 1).click();
    assertThatProjectPageTrendIsCorrect(job, action, "../../", getNumberOfWarnings());
}
Also used : AnalysisAction(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) WebElement(org.openqa.selenium.WebElement) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test) Since(org.jenkinsci.test.acceptance.junit.Since)

Example 10 with Since

use of org.jenkinsci.test.acceptance.junit.Since in project acceptance-test-harness by jenkinsci.

the class CreateItemTest method duplicate_item_name_displays_error.

@Test
@Since("2.6")
public void duplicate_item_name_displays_error() {
    // create a job with a known name
    jenkins.jobs.create(FreeStyleJob.class, JOB_NAME);
    // go try to create one with the same name
    jenkins.jobs.visit("newJob");
    fillIn(NAME_FIELD, JOB_NAME);
    blur(find(by.name(NAME_FIELD)));
    assertFalse(findIfNotVisible(NAME_NOT_EMPTY_MSG).isDisplayed());
    assertTrue(find(EXISTING_NAME_MSG).isDisplayed());
    assertFalse(find(OK_BUTTON).isEnabled());
    // select type of job
    jenkins.jobs.findTypeCaption(FreeStyleJob.class).click();
    assertFalse(findIfNotVisible(NAME_NOT_EMPTY_MSG).isDisplayed());
    assertTrue(find(EXISTING_NAME_MSG).isDisplayed());
    final WebElement okButtonElement = find(OK_BUTTON);
    assertTrue(okButtonElement.isEnabled());
    okButtonElement.click();
    assertThat(driver, hasContent(JOB_CREATION_ERROR_MSG));
}
Also used : FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) WebElement(org.openqa.selenium.WebElement) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) Since(org.jenkinsci.test.acceptance.junit.Since)

Aggregations

Since (org.jenkinsci.test.acceptance.junit.Since)10 Test (org.junit.Test)10 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)9 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)4 Issue (org.jvnet.hudson.test.Issue)4 Matchers.containsString (org.hamcrest.Matchers.containsString)2 AnalysisAction (org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction)2 SshCredentialDialog (org.jenkinsci.test.acceptance.plugins.ssh_credentials.SshCredentialDialog)2 SshPrivateKeyCredential (org.jenkinsci.test.acceptance.plugins.ssh_credentials.SshPrivateKeyCredential)2 SshSlaveLauncher (org.jenkinsci.test.acceptance.plugins.ssh_slaves.SshSlaveLauncher)2 DumbSlave (org.jenkinsci.test.acceptance.po.DumbSlave)2 Login (org.jenkinsci.test.acceptance.po.Login)2 WizardCreateAdminUser (org.jenkinsci.test.acceptance.po.WizardCreateAdminUser)2 WizardCustomizeJenkins (org.jenkinsci.test.acceptance.po.WizardCustomizeJenkins)2 WizardLogin (org.jenkinsci.test.acceptance.po.WizardLogin)2 NoSuchElementException (org.openqa.selenium.NoSuchElementException)2 WebElement (org.openqa.selenium.WebElement)2 HashMap (java.util.HashMap)1 DockerTest (org.jenkinsci.test.acceptance.junit.DockerTest)1 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)1