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));
}
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();
}
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);
}
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());
}
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));
}
Aggregations