use of org.jenkinsci.test.acceptance.po.User in project acceptance-test-harness by jenkinsci.
the class FavoriteTest method shouldBeAbleToFavoriteAJob.
@Test
public void shouldBeAbleToFavoriteAJob() throws Exception {
jenkins.jobs.create(FreeStyleJob.class, "my-project");
final GlobalSecurityConfig security = new GlobalSecurityConfig(jenkins);
security.open();
MockSecurityRealm realm = security.useRealm(MockSecurityRealm.class);
realm.configure(USER);
security.save();
jenkins.login().doLogin(USER);
waitFor(by.id("fav_my-project")).click();
// ensure the project is now a favourite
waitFor(by.css(".icon-fav-active"));
final User user = new User(jenkins, USER);
jenkins.visit(user.getConfigUrl().toString());
// will fail if the project has not been favourited
waitFor(by.id("favorites"));
waitFor(by.id("fav_my-project")).click();
// ensure the project is no longer a favourite
waitFor(by.css(".icon-fav-inactive"));
jenkins.visit(user.getConfigUrl().toString());
waitFor(driver).until(Matchers.hasContent("Favorites"));
assertFalse(findIfNotVisible(by.id("favorites")).isDisplayed());
}
use of org.jenkinsci.test.acceptance.po.User in project acceptance-test-harness by jenkinsci.
the class LdapPluginTest method do_not_resolve_email.
@Test
public void do_not_resolve_email() {
// Given
LdapDetails details = createDefaults(ldap.get());
details.setDisableLdapEmailResolver(true);
useLdapAsSecurityRealm(details);
// When
Login login = jenkins.login();
login.doLogin("jenkins", "root");
// Then
assertThat(jenkins, hasLoggedInUser("jenkins"));
User u = new User(jenkins, "jenkins");
assertThat(u.mail(), nullValue());
}
use of org.jenkinsci.test.acceptance.po.User in project acceptance-test-harness by jenkinsci.
the class LdapPluginTest method custom_valid_group_membership_filter.
@Test
public void custom_valid_group_membership_filter() {
// Given
useLdapAsSecurityRealm(createDefaults(ldap.get()).groupMembershipStrategy(SearchForGroupsLdapGroupMembershipStrategy.class).groupMembershipStrategyParam("memberUid={1}"));
// When
Login login = jenkins.login();
login.doLogin("jenkins", "root");
User userJenkins = new User(jenkins, "jenkins");
// Then
assertThat(userJenkins, isMemberOf("ldap1"));
assertThat(userJenkins, isMemberOf("ldap2"));
}
use of org.jenkinsci.test.acceptance.po.User in project acceptance-test-harness by jenkinsci.
the class LdapPluginTest method custom_group_search_base.
@Test
public void custom_group_search_base() {
// Given
useLdapAsSecurityRealm(createDefaults(ldap.get()).groupSearchBase("ou=Applications"));
// When
Login login = jenkins.login();
login.doLogin("jenkins", "root");
User userJenkins = new User(jenkins, "jenkins");
// Then
assertThat(userJenkins, not(isMemberOf("ldap1")));
assertThat(userJenkins, not(isMemberOf("ldap2")));
}
use of org.jenkinsci.test.acceptance.po.User in project acceptance-test-harness by jenkinsci.
the class LdapPluginTest method custom_mail_filter.
@Test
public void custom_mail_filter() {
// Given
useLdapAsSecurityRealm(createDefaults(ldap.get()).mailAdressAttributeName("givenName"));
// When
Login login = jenkins.login();
login.doLogin("jenkins", "root");
User userJenkins = new User(jenkins, "jenkins");
// Then
assertThat(userJenkins, mailAddressIs("givenname@mailaddress.com"));
}
Aggregations