use of io.pivotal.cla.webdriver.pages.SignCclaPage in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signMailingAddressRequired.
@Test
public void signMailingAddressRequired() throws Exception {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
when(mockGitHub.getOrganizations(anyString())).thenReturn(Arrays.asList("spring", "pivotal"));
SignCclaPage signPage = SignCclaPage.go(getDriver(), cla.getName());
Form form = signPage.form();
signPage = form.name("Rob Winch").email("rob@gmail.com").country("USA").telephone("123.456.7890").companyName("Pivotal").gitHubOrganization("pivotal").title("Director").confirm().sign(SignCclaPage.class);
signPage.assertAt();
form = signPage.form();
form.assertName().hasNoErrors();
form.assertEmail().hasNoErrors();
form.assertMailingAddress().hasRequiredError();
form.assertCountry().hasNoErrors();
form.assertTelephone().hasNoErrors();
form.assertConfirm().hasNoErrors();
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signFormSigned.
@Test
public void signFormSigned() throws Exception {
List<String> organizations = Arrays.asList(corporateSignature.getGitHubOrganization());
User user = WithSigningUserFactory.create();
when(mockGitHub.getOrganizations(user.getGitHubLogin())).thenReturn(organizations);
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockCorporateSignatureRepository.findSignature(cla.getName(), organizations, user.getEmails())).thenReturn(corporateSignature);
SignCclaPage signPage = SignCclaPage.go(getDriver(), cla.getName());
assertThat(signPage.isSigned()).isTrue();
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signCompanyNameRequired.
@Test
public void signCompanyNameRequired() throws Exception {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
when(mockGitHub.getOrganizations(anyString())).thenReturn(Arrays.asList("spring", "pivotal"));
SignCclaPage signPage = SignCclaPage.go(getDriver(), cla.getName());
Form form = signPage.form();
signPage = form.name("Rob Winch").email("rob@gmail.com").mailingAddress("123 Seasame St").country("USA").telephone("123.456.7890").gitHubOrganization("pivotal").title("Director").confirm().sign(SignCclaPage.class);
signPage.assertAt();
form = signPage.form();
form.assertName().hasNoErrors();
form.assertEmail().hasNoErrors();
form.assertCompanyName().hasRequiredError();
form.assertGitHubOrganization().hasNoErrors();
form.assertConfirm().hasNoErrors();
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage in project pivotal-cla by pivotalsoftware.
the class ClaControllerTests method signCcla.
@Test
@WithSigningUser
public void signCcla() {
SignClaPage home = SignClaPage.go(driver, cla.getName());
SignCclaPage sign = home.signCcla(SignCclaPage.class);
sign.assertAt();
}
Aggregations