use of org.jenkinsci.test.acceptance.junit.WithPlugins 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()));
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class XvncPluginTest method workflow.
@WithPlugins({ "xvnc@1.22", "workflow-aggregator@1.8" })
@Issue("JENKINS-26477")
@Test
public void workflow() {
WorkflowJob job = jenkins.jobs.create(WorkflowJob.class);
job.script.set("node('xvnc') {wrap([$class: 'Xvnc', takeScreenshot: true, useXauthority: true]) {sh 'xmessage hello &'}}");
job.sandbox.check();
job.save();
Build build = job.startBuild().shouldSucceed();
assertThat(build.getConsole(), containsString("+ xmessage hello"));
assertThat(build, runXvnc());
assertThat(build, tookScreenshot());
// TODO should this be moved into tookScreenshot?
build.getArtifact("screenshot.jpg").assertThatExists(true);
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class AuthorizeProjectTest method testProjectRunByUser.
@Test
@WithPlugins("mock-security-realm")
public void testProjectRunByUser() {
jenkins.login().doSuccessfulLogin(USER2);
final FreeStyleJob job = jenkins.jobs.create(FreeStyleJob.class);
job.save();
Build b = job.startBuild().shouldSucceed();
String consoleOutput = b.getConsole();
Assert.assertThat(consoleOutput, containsString(STARTED_BY_USER2));
Assert.assertThat(consoleOutput, not(containsString(RUNNING_ANONYMOUS)));
this.authorizeUserToLaunchProject(USER1);
b = job.startBuild().shouldSucceed();
consoleOutput = b.getConsole();
Assert.assertThat(consoleOutput, containsString(STARTED_BY_USER2));
// Running as anonymous is displayed due to permissions but the plugin performs its job
Assert.assertThat(consoleOutput, containsString(RUNNING_ANONYMOUS));
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class ExtraColumnsPluginTest method should_show_console_link_in_folder.
/**
* Sets up a job within a folder. Starts a succeeding build. Adds the last console column to a new view
* and verifies that clicking the link to the last console opens the console log.
*/
@Test
@WithPlugins("cloudbees-folder")
public void should_show_console_link_in_folder() {
Folder folder = jenkins.jobs.create(Folder.class, createRandomName());
folder.save();
folder.open();
FreeStyleJob job = folder.getJobs().create();
job.startBuild().waitUntilFinished().shouldSucceed();
ListView.createWithColumn(folder, LastConsoleColumn.class);
List<WebElement> links = all(by.link("Last/current build console output"));
assertThat(links, iterableWithSize(1));
links.get(0).click();
assertThat(driver, hasContent("Console Output"));
}
use of org.jenkinsci.test.acceptance.junit.WithPlugins in project acceptance-test-harness by jenkinsci.
the class CredentialsTest method createSshKeys.
@Test
@WithPlugins("ssh-credentials")
public void createSshKeys() throws Exception {
CredentialsPage cp = new CredentialsPage(jenkins, ManagedCredentials.DEFAULT_DOMAIN);
cp.open();
SshPrivateKeyCredential sc = cp.add(SshPrivateKeyCredential.class);
sc.username.set(CRED_USER);
sc.selectEnterDirectly().privateKey.set(CRED_PWD);
sc.description.set("ssh_creds");
cp.create();
// now verify
final ManagedCredentials c = new ManagedCredentials(jenkins);
String href = c.credentialById("ssh_creds");
cp.setConfigUrl(href);
verifyValueForCredential(cp, sc.username, CRED_USER);
verifyValueForCredentialKey(sc, CRED_PWD, false);
}
Aggregations