Search in sources :

Example 6 with Form

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

Example 7 with Form

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

Example 8 with Form

use of io.pivotal.cla.webdriver.pages.SignCclaPage.Form in project pivotal-cla by pivotalsoftware.

the class CclaControllerTests method signMailingAddressRequired.

@Test
public void signMailingAddressRequired() 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").email("rob@gmail.com").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().hasNoErrors();
    form.assertMailingAddress().hasRequiredError();
    form.assertCountry().hasNoErrors();
    form.assertTelephone().hasNoErrors();
    form.assertConfirm().hasNoErrors();
}
Also used : Form(io.pivotal.cla.webdriver.pages.SignCclaPage.Form) SignCclaPage(io.pivotal.cla.webdriver.pages.SignCclaPage) Test(org.junit.Test)

Example 9 with Form

use of io.pivotal.cla.webdriver.pages.SignCclaPage.Form in project pivotal-cla by pivotalsoftware.

the class CclaControllerTests method signCompanyNameRequired.

@Test
public void signCompanyNameRequired() 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").email("rob@gmail.com").mailingAddress("123 Seasame St").country("USA").telephone("123.456.7890").gitHubOrganization("pivotal").title("Director").confirm().sign(SignCclaPage.class);
    signPage.assertAt();
    form = signPage.form();
    form.assertName().hasNoErrors();
    form.assertEmail().hasNoErrors();
    form.assertCompanyName().hasRequiredError();
    form.assertGitHubOrganization().hasNoErrors();
    form.assertConfirm().hasNoErrors();
}
Also used : Form(io.pivotal.cla.webdriver.pages.SignCclaPage.Form) SignCclaPage(io.pivotal.cla.webdriver.pages.SignCclaPage) Test(org.junit.Test)

Aggregations

SignCclaPage (io.pivotal.cla.webdriver.pages.SignCclaPage)9 Form (io.pivotal.cla.webdriver.pages.SignCclaPage.Form)9 Test (org.junit.Test)9