Search in sources :

Example 6 with SignClaForm

use of io.pivotal.cla.mvc.SignClaForm in project pivotal-cla by pivotalsoftware.

the class IclaControllerTests method signCountryNotRequired.

@Test
public void signCountryNotRequired() {
    when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
    when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
    SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
    SignClaForm form = defaultClaForm();
    form.setCountry("");
    signPage = signPage.form(form).confirm().sign(SignIclaPage.class);
    signPage.assertAt();
    assertThatClaIsSigned(form);
}
Also used : SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) SignClaForm(io.pivotal.cla.mvc.SignClaForm) Test(org.junit.Test)

Example 7 with SignClaForm

use of io.pivotal.cla.mvc.SignClaForm in project pivotal-cla by pivotalsoftware.

the class IclaControllerTests method signTelephoneNotRequired.

@Test
public void signTelephoneNotRequired() {
    when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
    when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
    SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
    SignClaForm form = defaultClaForm();
    form.setTelephone("");
    signPage = signPage.form(form).confirm().sign(SignIclaPage.class);
    signPage.assertAt();
    assertThatClaIsSigned(form);
}
Also used : SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) SignClaForm(io.pivotal.cla.mvc.SignClaForm) Test(org.junit.Test)

Example 8 with SignClaForm

use of io.pivotal.cla.mvc.SignClaForm 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();
}
Also used : SignClaForm(io.pivotal.cla.mvc.SignClaForm) Form(io.pivotal.cla.webdriver.pages.SignIclaPage.Form) SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) SignClaForm(io.pivotal.cla.mvc.SignClaForm) Test(org.junit.Test)

Example 9 with SignClaForm

use of io.pivotal.cla.mvc.SignClaForm 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();
}
Also used : SignClaForm(io.pivotal.cla.mvc.SignClaForm) Form(io.pivotal.cla.webdriver.pages.SignIclaPage.Form) SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) SignClaForm(io.pivotal.cla.mvc.SignClaForm) Test(org.junit.Test)

Aggregations

SignClaForm (io.pivotal.cla.mvc.SignClaForm)9 SignIclaPage (io.pivotal.cla.webdriver.pages.SignIclaPage)8 Test (org.junit.Test)8 Form (io.pivotal.cla.webdriver.pages.SignIclaPage.Form)4