use of io.pivotal.cla.webdriver.pages.SignCclaPage.Form in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signTelephoneRequired.
@Test
public void signTelephoneRequired() 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").companyName("Pivotal").gitHubOrganization("pivotal").title("Director").confirm().sign(SignCclaPage.class);
signPage.assertAt();
form = signPage.form();
form.assertName().hasNoErrors();
form.assertEmail().hasNoErrors();
form.assertMailingAddress().hasNoErrors();
form.assertCountry().hasNoErrors();
form.assertTelephone().hasRequiredError();
form.assertConfirm().hasNoErrors();
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage.Form in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signOrganizationRequired.
@Test
public void signOrganizationRequired() 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").companyName("Pivotal").title("Director").confirm().sign(SignCclaPage.class);
signPage.assertAt();
form = signPage.form();
form.assertName().hasNoErrors();
form.assertEmail().hasNoErrors();
form.assertCompanyName().hasNoErrors();
form.assertGitHubOrganization().hasRequiredError();
form.assertConfirm().hasNoErrors();
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage.Form in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signNameRequired.
@Test
public void signNameRequired() 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.email("rob@gmail.com").mailingAddress("123 Seasame St").country("USA").telephone("123.456.7890").companyName("Pivotal").gitHubOrganization("pivotal").title("Director").confirm().sign(SignCclaPage.class);
signPage.assertAt();
form = signPage.form();
form.assertName().hasRequiredError();
form.assertEmail().hasNoErrors();
form.assertCompanyName().hasNoErrors();
form.assertGitHubOrganization().hasNoErrors();
form.assertConfirm().hasNoErrors();
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage.Form in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signCountryRequired.
@Test
public void signCountryRequired() 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").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().hasNoErrors();
form.assertCountry().hasRequiredError();
form.assertTelephone().hasNoErrors();
form.assertConfirm().hasNoErrors();
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage.Form in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signConfirmRequired.
@Test
public void signConfirmRequired() 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").companyName("Pivotal").gitHubOrganization("pivotal").title("Director").sign(SignCclaPage.class);
signPage.assertAt();
form = signPage.form();
form.assertName().hasNoErrors();
form.assertEmail().hasNoErrors();
form.assertMailingAddress().hasNoErrors();
form.assertCountry().hasNoErrors();
form.assertTelephone().hasNoErrors();
form.assertConfirm().hasRequiredError();
}
Aggregations