use of org.jenkinsci.test.acceptance.junit.Since in project acceptance-test-harness by jenkinsci.
the class TSRCreateSlaveTest method newSlave.
@Test
@Since("1.560")
public void newSlave() {
// this test requires a newer version of credentials plugin that has inline "Add" button
// I'm not sure exactly which version it is, but 1.532 LTS doesn't have it, and 1.555 has it,
// so it's somewhere in between
// TODO: this should be converted to "@WithPlugin("ssh-credentials") with specific version tag,
// not the core version
// 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 MailWatcherPluginTest method notify_master_on_jenkins_restart.
@Test
@Issue("JENKINS-20538")
@Since("1.571")
@WithPlugins("mail-watcher-plugin@1.7")
@Ignore("Flaky test, passes sometimes on CI")
public void notify_master_on_jenkins_restart() throws Exception {
assumeTrue("This test requires a restartable Jenkins", jenkins.canRestart());
jenkins.configure();
{
OnlineStatusNotification notification = new OnlineStatusNotification(jenkins);
notification.onOnline("on@online.com");
notification.onOffline("on@offline.com");
}
jenkins.save();
jenkins.restart();
mailhog.assertMail(regex("Computer master marked offline"), "on@offline.com", regex("Jenkins is restarting"));
mailhog.assertMail(regex("Computer master marked online"), "on@online.com");
}
use of org.jenkinsci.test.acceptance.junit.Since in project acceptance-test-harness by jenkinsci.
the class MavenPluginTest method preserve_backslash_in_property.
@Test
@Issue("JENKINS-10539")
@Since("1.527")
public void preserve_backslash_in_property() {
installSomeMaven(jenkins);
FreeStyleJob job = jenkins.jobs.create(FreeStyleJob.class);
job.configure();
job.addParameter(StringParameter.class).setName("CMD");
job.addParameter(StringParameter.class).setName("PROPERTY");
MavenBuildStep step = job.addBuildStep(MavenBuildStep.class);
step.targets.set(GENERATE + " -Dcmdline.property=$CMD");
step.properties("property.property=$PROPERTY", true);
job.save();
Map<String, String> params = new HashMap<>();
params.put("CMD", "\"C:\\\\System\"");
params.put("PROPERTY", "C:\\Windows");
job.startBuild(params).shouldSucceed().shouldContainsConsoleOutput("cmdline.property=C:\\\\System").shouldContainsConsoleOutput("property.property=C:\\\\Windows");
}
use of org.jenkinsci.test.acceptance.junit.Since in project acceptance-test-harness by jenkinsci.
the class InstallWizardTest method wizardInstallCustomPluginsTest.
@Since("2.0")
@Test
public void wizardInstallCustomPluginsTest() throws IOException {
jenkins.open();
// Login step
WizardLogin wizardLogin = new WizardLogin(jenkins);
wizardLogin.doSuccessfulLogin(wizardLogin.getPassword(controller));
// Customize Jenkins step
WizardCustomizeJenkins wizardCustomize = new WizardCustomizeJenkins(jenkins);
wizardCustomize.doSelectPluginsToInstall();
wizardCustomize.deselectAll();
wizardCustomize.searchPlugin("pipeline");
wizardCustomize.selectPlugin("workflow-aggregator");
wizardCustomize.startInstall();
wizardCustomize.shouldFinishInstallSuccessfully();
// Create user test
WizardCreateAdminUser createAdmin = new WizardCreateAdminUser(jenkins);
createAdmin.createAdminUser(USERNAME, PASSWORD, FULL_NAME, EMAIL);
createAdmin.shouldCreateTheUserSuccessfully();
if (jenkins.getVersion().isNewerThan(new VersionNumber("2.118"))) {
createAdmin.confirmURLSettings();
}
createAdmin.wizardShouldFinishSuccessfully();
// Check that the new user is logged in
Login login = new Login(jenkins);
Assert.assertThat(login, loggedInAs("adminuser"));
}
use of org.jenkinsci.test.acceptance.junit.Since in project acceptance-test-harness by jenkinsci.
the class InstallWizardTest method wizardInstallSuggestedTest.
@Since("2.0")
@Test
public void wizardInstallSuggestedTest() throws IOException {
jenkins.open();
// Login step
WizardLogin wizardLogin = new WizardLogin(jenkins);
wizardLogin.doSuccessfulLogin(wizardLogin.getPassword(controller));
// Customize Jenkins step
WizardCustomizeJenkins wizardCustomize = new WizardCustomizeJenkins(jenkins);
wizardCustomize.doInstallSuggested();
wizardCustomize.shouldFinishInstallSuccessfully();
// Create user test
WizardCreateAdminUser createAdmin = new WizardCreateAdminUser(jenkins);
createAdmin.createAdminUser(USERNAME, PASSWORD, FULL_NAME, EMAIL);
createAdmin.shouldCreateTheUserSuccessfully();
if (jenkins.getVersion().isNewerThan(new VersionNumber("2.118"))) {
createAdmin.confirmURLSettings();
}
createAdmin.wizardShouldFinishSuccessfully();
// Check that the new user is logged in
Login login = new Login(jenkins);
Assert.assertThat(login, loggedInAs("adminuser"));
}
Aggregations