use of io.pivotal.cla.webdriver.pages.SignIclaPage.Form in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method signConfirmRequired.
@Test
public void signConfirmRequired() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
SignClaForm claForm = defaultClaForm();
signPage = signPage.form(claForm).sign(SignIclaPage.class);
signPage.assertAt();
Form form = signPage.form();
form.assertName().hasNoErrors();
form.assertEmail().hasNoErrors();
form.assertMailingAddress().hasNoErrors();
form.assertCountry().hasNoErrors();
form.assertTelephone().hasNoErrors();
form.assertConfirm().hasRequiredError();
}
use of io.pivotal.cla.webdriver.pages.SignIclaPage.Form in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method signEmailRequired.
@Test
public void signEmailRequired() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
SignClaForm claForm = defaultClaForm();
signPage = signPage.form(claForm).email("").confirm().sign(SignIclaPage.class);
signPage.assertAt();
Form form = signPage.form();
form.assertName().hasNoErrors();
form.assertEmail().hasRequiredError();
form.assertMailingAddress().hasNoErrors();
form.assertCountry().hasNoErrors();
form.assertTelephone().hasNoErrors();
form.assertConfirm().hasNoErrors();
}
use of io.pivotal.cla.webdriver.pages.SignIclaPage.Form in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method fieldsRepopulatedOnError.
@Test
public void fieldsRepopulatedOnError() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
SignClaForm signForm = defaultClaForm();
signPage = signPage.form(signForm).sign(SignIclaPage.class);
signPage.assertAt();
Form form = signPage.form();
form.assertName().hasValue(signForm.getName());
form.assertEmail().hasValue(signForm.getEmail());
form.assertMailingAddress().hasValue(signForm.getMailingAddress());
form.assertCountry().hasValue(signForm.getCountry());
form.assertTelephone().hasValue(signForm.getTelephone());
signPage = SignIclaPage.go(getDriver(), cla.getName());
signPage = signPage.form().confirm().sign(SignIclaPage.class);
signPage.form().assertConfirm().assertSelected();
}
use of io.pivotal.cla.webdriver.pages.SignIclaPage.Form in project pivotal-cla by pivotalsoftware.
the class IclaControllerTests method signNameRequired.
@Test
public void signNameRequired() {
when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
SignClaForm claForm = defaultClaForm();
claForm.setName("");
signPage = signPage.form(claForm).confirm().sign(SignIclaPage.class);
signPage.assertAt();
Form form = signPage.form();
form.assertName().hasRequiredError();
form.assertEmail().hasNoErrors();
form.assertMailingAddress().hasNoErrors();
form.assertCountry().hasNoErrors();
form.assertTelephone().hasNoErrors();
form.assertConfirm().hasNoErrors();
}
Aggregations