Search in sources :

Example 1 with Form

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();
}
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 2 with Form

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();
}
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 3 with Form

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();
}
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 4 with Form

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();
}
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)4 SignIclaPage (io.pivotal.cla.webdriver.pages.SignIclaPage)4 Form (io.pivotal.cla.webdriver.pages.SignIclaPage.Form)4 Test (org.junit.Test)4