Search in sources :

Example 6 with ClaForm

use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.

the class EditAdminClaTests method editClaInvalidPrimary.

@Test
public void editClaInvalidPrimary() throws Exception {
    ContributorLicenseAgreement springCla = DataUtils.createSpringCla();
    springCla.setId(54321L);
    springCla.setSupersedingCla(cla);
    when(mockClaRepository.findAll()).thenReturn(Arrays.asList(cla, springCla));
    when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
    when(mockClaRepository.findOne(springCla.getId())).thenReturn(springCla);
    when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
    AdminEditClaPage create = AdminEditClaPage.to(getDriver(), springCla.getId());
    create = create.form().name(cla.getName()).primary().submit(AdminEditClaPage.class);
    ClaForm form = create.form();
    form.assertPrimary().hasError("A primary CLA with this name already exists");
}
Also used : ContributorLicenseAgreement(io.pivotal.cla.data.ContributorLicenseAgreement) AdminEditClaPage(io.pivotal.cla.webdriver.pages.admin.AdminEditClaPage) ClaForm(io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm) Test(org.junit.Test)

Example 7 with ClaForm

use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.

the class EditAdminClaTests method editClaRequiredFieldsNameRequired.

@Test
public void editClaRequiredFieldsNameRequired() throws Exception {
    when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
    AdminEditClaPage create = AdminEditClaPage.to(getDriver(), cla.getId());
    create = create.form().name("").submit(AdminEditClaPage.class);
    ClaForm form = create.form();
    form.assertName().hasRequiredError();
    form.assertIndividualContent().hasNoErrors().hasValue(cla.getIndividualContent().getMarkdown());
    form.assertCorporateContent().hasNoErrors().hasValue(cla.getCorporateContent().getMarkdown());
}
Also used : AdminEditClaPage(io.pivotal.cla.webdriver.pages.admin.AdminEditClaPage) ClaForm(io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm) Test(org.junit.Test)

Example 8 with ClaForm

use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.

the class EditAdminClaTests method editClaRequiredFieldsIndividualRequired.

@Test
public void editClaRequiredFieldsIndividualRequired() throws Exception {
    when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
    AdminEditClaPage create = AdminEditClaPage.to(getDriver(), cla.getId());
    create = create.form().individual("").submit(AdminEditClaPage.class);
    ClaForm form = create.form();
    form.assertName().hasNoErrors().hasValue(cla.getName());
    form.assertCorporateContent().hasNoErrors();
    form.assertIndividualContent().hasRequiredError();
}
Also used : AdminEditClaPage(io.pivotal.cla.webdriver.pages.admin.AdminEditClaPage) ClaForm(io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm) Test(org.junit.Test)

Example 9 with ClaForm

use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.

the class EditAdminClaTests method editClaRequiredFieldsAll.

@Test
public void editClaRequiredFieldsAll() throws Exception {
    when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
    when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
    AdminEditClaPage edit = AdminEditClaPage.to(getDriver(), cla.getId());
    edit = edit.form().name("").individual("").corporate("").submit(AdminEditClaPage.class);
    ClaForm form = edit.form();
    form.assertName().hasRequiredError();
    form.assertIndividualContent().hasRequiredError();
    form.assertCorporateContent().hasRequiredError();
}
Also used : AdminEditClaPage(io.pivotal.cla.webdriver.pages.admin.AdminEditClaPage) ClaForm(io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm) Test(org.junit.Test)

Example 10 with ClaForm

use of io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm in project pivotal-cla by pivotalsoftware.

the class EditAdminClaTests method editClaRequiredFieldsCorporateRequired.

@Test
public void editClaRequiredFieldsCorporateRequired() throws Exception {
    when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
    AdminEditClaPage create = AdminEditClaPage.to(getDriver(), cla.getId());
    create = create.form().corporate("").submit(AdminEditClaPage.class);
    ClaForm form = create.form();
    form.assertName().hasNoErrors();
    form.assertIndividualContent().hasNoErrors();
    form.assertCorporateContent().hasRequiredError();
}
Also used : AdminEditClaPage(io.pivotal.cla.webdriver.pages.admin.AdminEditClaPage) ClaForm(io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm) Test(org.junit.Test)

Aggregations

ClaForm (io.pivotal.cla.webdriver.pages.admin.AdminClaFormPage.ClaForm)10 Test (org.junit.Test)10 AdminCreateClaPage (io.pivotal.cla.webdriver.pages.admin.AdminCreateClaPage)5 AdminEditClaPage (io.pivotal.cla.webdriver.pages.admin.AdminEditClaPage)5 ContributorLicenseAgreement (io.pivotal.cla.data.ContributorLicenseAgreement)1