use of org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig in project acceptance-test-harness by jenkinsci.
the class MailhogProvider method get.
@Override
public synchronized MailhogContainer get() {
MailhogContainer mailhog = super.get();
jenkins.configure(() -> {
MailerGlobalConfig mgc = new MailerGlobalConfig(jenkins);
mgc.smtpServer.set(mailhog.getSmtpHost());
mgc.advancedButton.click();
mgc.smtpPort.set(mailhog.getSmtpPort());
});
return mailhog;
}
use of org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig in project acceptance-test-harness by jenkinsci.
the class Mailtrap method setup.
/**
* Set up the configuration to use the shared mailtrap.io account.
*/
@Override
public void setup(Jenkins jenkins) {
jenkins.configure();
MailerGlobalConfig config = new MailerGlobalConfig(jenkins);
config.smtpServer.set(HOST);
config.advancedButton.click();
config.useSMTPAuth.check();
config.smtpAuthUserName.set(MAILBOX);
config.smtpAuthPassword.set(PASSWORD);
config.smtpPort.set(PORT);
// Fingerprint to identify message sent from this test run
config.replyToAddress.set(fingerprint);
jenkins.save();
// Set for email-ext plugin as well if available
if (jenkins.getPluginManager().isInstalled("email-ext")) {
// For whatever reason this needs new config page opened
jenkins.configure();
GlobalConfig ext = new GlobalConfig(jenkins.getConfigPage());
ext.smtpServer(HOST);
ext.auth(MAILBOX, PASSWORD);
ext.smtpPort(PORT);
ext.replyTo(fingerprint);
jenkins.save();
}
}
Aggregations