Search in sources :

Example 1 with GlobalConfig

use of org.jenkinsci.test.acceptance.plugins.email_ext.GlobalConfig 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();
    }
}
Also used : MailerGlobalConfig(org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig) MailerGlobalConfig(org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig) GlobalConfig(org.jenkinsci.test.acceptance.plugins.email_ext.GlobalConfig)

Aggregations

GlobalConfig (org.jenkinsci.test.acceptance.plugins.email_ext.GlobalConfig)1 MailerGlobalConfig (org.jenkinsci.test.acceptance.plugins.mailer.MailerGlobalConfig)1