Search in sources :

Example 1 with UserPwdCredential

use of org.jenkinsci.test.acceptance.plugins.credentials.UserPwdCredential in project acceptance-test-harness by jenkinsci.

the class SshSlaveLauncher method pwdCredentials.

/**
 * Add username/password based credentials to the configuration
 *
 * @param username to use
 * @param password for the username
 * @return the SshSlaveLauncher to be configured
 */
public SshSlaveLauncher pwdCredentials(String username, String password) {
    final SshCredentialDialog dia = this.addCredential();
    final UserPwdCredential cred = dia.select(UserPwdCredential.class);
    cred.username.set(username);
    cred.password.set(password);
    // credentials are identified by their id. Set username as id so it can be found by it
    cred.setId(username);
    cred.add();
    waitForCredentialVisible(username);
    return this;
}
Also used : SshCredentialDialog(org.jenkinsci.test.acceptance.plugins.ssh_credentials.SshCredentialDialog) UserPwdCredential(org.jenkinsci.test.acceptance.plugins.credentials.UserPwdCredential)

Example 2 with UserPwdCredential

use of org.jenkinsci.test.acceptance.plugins.credentials.UserPwdCredential in project acceptance-test-harness by jenkinsci.

the class ConfigFileProviderTest method setup.

@Before
public void setup() {
    CredentialsPage cp = new CredentialsPage(jenkins, ManagedCredentials.DEFAULT_DOMAIN);
    cp.open();
    UserPwdCredential cred = cp.add(UserPwdCredential.class);
    cred.username.set(CRED_USR);
    cred.password.set(CRED_PWD);
    cred.setId(CRED_ID);
    cp.create();
}
Also used : CredentialsPage(org.jenkinsci.test.acceptance.plugins.credentials.CredentialsPage) UserPwdCredential(org.jenkinsci.test.acceptance.plugins.credentials.UserPwdCredential) Before(org.junit.Before)

Example 3 with UserPwdCredential

use of org.jenkinsci.test.acceptance.plugins.credentials.UserPwdCredential in project acceptance-test-harness by jenkinsci.

the class FolderPluginTest method createCredentials.

private void createCredentials(final Folder f) {
    final CredentialsPage mc = new CredentialsPage(f, ManagedCredentials.DEFAULT_DOMAIN);
    mc.open();
    final UserPwdCredential cred = mc.add(UserPwdCredential.class);
    cred.username.set(CRED_USER);
    cred.password.set(CRED_PASS);
    cred.setId(CRED_ID);
    mc.create();
}
Also used : CredentialsPage(org.jenkinsci.test.acceptance.plugins.credentials.CredentialsPage) UserPwdCredential(org.jenkinsci.test.acceptance.plugins.credentials.UserPwdCredential)

Aggregations

UserPwdCredential (org.jenkinsci.test.acceptance.plugins.credentials.UserPwdCredential)3 CredentialsPage (org.jenkinsci.test.acceptance.plugins.credentials.CredentialsPage)2 SshCredentialDialog (org.jenkinsci.test.acceptance.plugins.ssh_credentials.SshCredentialDialog)1 Before (org.junit.Before)1