use of io.pivotal.cla.webdriver.pages.SignCclaPage in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signFormSupersedingCla.
@Test
public void signFormSupersedingCla() {
ContributorLicenseAgreement springCla = DataUtils.createSpringCla();
springCla.setSupersedingCla(cla);
when(mockClaRepository.findByNameAndPrimaryTrue(springCla.getName())).thenReturn(springCla);
SignCclaPage signPage = SignCclaPage.go(getDriver(), springCla.getName());
signPage.assertClaLink(springCla.getName());
assertThat(signPage.getCorporate()).isEqualTo(cla.getCorporateContent().getHtml());
assertThat(signPage.isSigned()).isFalse();
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signSupersedingCla.
@Test
public void signSupersedingCla() {
ContributorLicenseAgreement springCla = DataUtils.createSpringCla();
springCla.setSupersedingCla(cla);
when(mockClaRepository.findByNameAndPrimaryTrue(springCla.getName())).thenReturn(springCla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignCclaPage signPage = SignCclaPage.go(getDriver(), springCla.getName());
signPage = signPage.form().sign(SignCclaPage.class);
signPage.assertClaLink(springCla.getName());
assertThat(signPage.getCorporate()).isEqualTo(cla.getCorporateContent().getHtml());
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method fieldsRepopulatedOnError.
@Test
public void fieldsRepopulatedOnError() 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());
signPage = 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 form = signPage.form();
form.assertEmail().hasValue("rob@gmail.com");
form.assertMailingAddress().hasValue("123 Seasame St");
form.assertCountry().hasValue("USA");
form.assertTelephone().hasValue("123.456.7890");
form.assertCompanyName().hasValue("Pivotal");
form.assertGitHubOrganization().hasValue("pivotal");
form.assertTitle().hasValue("Director");
form.assertConfirm().assertSelected();
signPage = SignCclaPage.go(getDriver(), cla.getName());
signPage = signPage.form().name("Rob Winch").sign(SignCclaPage.class);
signPage.form().assertName().hasValue("Rob Winch");
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signEmailRequired.
@Test
public void signEmailRequired() 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").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().hasNoErrors();
form.assertEmail().hasRequiredError();
form.assertCompanyName().hasNoErrors();
form.assertGitHubOrganization().hasNoErrors();
form.assertConfirm().hasNoErrors();
}
use of io.pivotal.cla.webdriver.pages.SignCclaPage in project pivotal-cla by pivotalsoftware.
the class CclaControllerTests method signForm.
@Test
public void signForm() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
SignCclaPage signPage = SignCclaPage.go(getDriver(), cla.getName());
signPage.assertClaLink(cla.getName());
assertThat(signPage.getCorporate()).isEqualTo(cla.getCorporateContent().getHtml());
}
Aggregations