use of io.pivotal.cla.webdriver.pages.admin.AdminLinkClaPage in project pivotal-cla by pivotalsoftware.
the class AdminLinkClaTests method linkClaValidationLicenseNameRequired.
@Test
public void linkClaValidationLicenseNameRequired() throws Exception {
AdminLinkClaPage link = AdminLinkClaPage.to(getDriver());
link = link.link("test/this", "", AdminLinkClaPage.class);
link.assertRepositories().hasNoErrors().hasValue("test/this");
link.assertClaName().hasRequiredError();
}
use of io.pivotal.cla.webdriver.pages.admin.AdminLinkClaPage in project pivotal-cla by pivotalsoftware.
the class AuthenticationTests method userUrlWithAdminUserThenAdminUrl.
@SuppressWarnings("unchecked")
@Test
public void userUrlWithAdminUserThenAdminUrl() throws Exception {
User currentUser = WithAdminUserFactory.create();
currentUser.setAdmin(false);
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockGitHub.getCurrentUser(any(CurrentUserRequest.class))).thenAnswer(new Answer<User>() {
@Override
public User answer(InvocationOnMock invocation) throws Throwable {
CurrentUserRequest request = invocation.getArgumentAt(0, CurrentUserRequest.class);
User currentUser = WithAdminUserFactory.create();
currentUser.setAdmin(request.isRequestAdminAccess());
return currentUser;
}
});
when(mockIndividualSignatureRepository.findByEmailIn(anySet())).thenReturn(Collections.emptyList());
SignClaPage signClaPage = SignClaPage.go(driver, cla.getName());
signClaPage.assertAt();
when(mockClaRepository.findAll()).thenReturn(Arrays.asList(cla));
when(mockGitHub.findRepositoryNamesWithAdminPermission(anyString())).thenReturn(Arrays.asList("test/this"));
AdminLinkClaPage admin = AdminLinkClaPage.to(driver);
admin.assertAt();
ArgumentCaptor<CurrentUserRequest> userCaptor = ArgumentCaptor.forClass(CurrentUserRequest.class);
verify(mockGitHub, times(2)).getCurrentUser(userCaptor.capture());
assertThat(userCaptor.getAllValues()).extracting(CurrentUserRequest::isRequestAdminAccess).containsOnly(false, true);
}
use of io.pivotal.cla.webdriver.pages.admin.AdminLinkClaPage in project pivotal-cla by pivotalsoftware.
the class AdminHomeTests method adminUserLinkClaLinkVisible.
@Test
public void adminUserLinkClaLinkVisible() {
AdminLinkClaPage page = AdminLinkClaPage.to(getDriver());
page.assertAt();
page = page.link();
page.assertAt();
}
use of io.pivotal.cla.webdriver.pages.admin.AdminLinkClaPage in project pivotal-cla by pivotalsoftware.
the class AdminLinkClaTests method linkClaValidationRepositoriesRequired.
@Test
public void linkClaValidationRepositoriesRequired() throws Exception {
AdminLinkClaPage link = AdminLinkClaPage.to(getDriver());
link = link.link("", cla.getName(), AdminLinkClaPage.class);
link.assertRepositories().hasRequiredError();
link.assertClaName().hasNoErrors().hasValue(cla.getName());
}
use of io.pivotal.cla.webdriver.pages.admin.AdminLinkClaPage in project pivotal-cla by pivotalsoftware.
the class AdminLinkClaTests method navigateToLinkCla.
@Test
public void navigateToLinkCla() {
HomePage homePage = HomePage.go(driver);
AdminLinkClaPage link = homePage.link();
link.assertAt();
link.assertClaName().hasOptionTexts(cla.getName());
}
Aggregations