Search in sources :

Example 1 with SignIclaPage

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

the class IclaControllerTests method signNoRepositoryIdAndNoPullRequestId.

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

Example 2 with SignIclaPage

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

the class IclaControllerTests method signMailingAddressNotRequired.

@Test
public void signMailingAddressNotRequired() {
    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.setMailingAddress("");
    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 3 with SignIclaPage

use of io.pivotal.cla.webdriver.pages.SignIclaPage 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 4 with SignIclaPage

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

the class IclaControllerTests method sign.

@Test
public void sign() {
    when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
    when(mockClaRepository.findOne(cla.getId())).thenReturn(cla);
    SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
    SignClaForm form = defaultClaForm();
    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 5 with SignIclaPage

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

the class IclaControllerTests method signForm.

@Test
public void signForm() {
    when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
    SignIclaPage signPage = SignIclaPage.go(getDriver(), cla.getName());
    signPage.assertClaLink(cla.getName());
    assertThat(signPage.getIndividualCla()).isEqualTo(cla.getIndividualContent().getHtml());
    assertThat(signPage.isSigned()).isFalse();
}
Also used : SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) Test(org.junit.Test)

Aggregations

SignIclaPage (io.pivotal.cla.webdriver.pages.SignIclaPage)17 Test (org.junit.Test)17 SignClaForm (io.pivotal.cla.mvc.SignClaForm)8 Form (io.pivotal.cla.webdriver.pages.SignIclaPage.Form)4 SignClaPage (io.pivotal.cla.webdriver.pages.SignClaPage)3 ContributorLicenseAgreement (io.pivotal.cla.data.ContributorLicenseAgreement)2 WithSigningUser (io.pivotal.cla.security.WithSigningUser)2 AccessToken (io.pivotal.cla.data.AccessToken)1 PullRequestStatus (io.pivotal.cla.service.github.PullRequestStatus)1 AdminLinkClaPage (io.pivotal.cla.webdriver.pages.admin.AdminLinkClaPage)1 GitHubLoginPage (io.pivotal.cla.webdriver.pages.github.GitHubLoginPage)1 GitHubPullRequestPage (io.pivotal.cla.webdriver.pages.github.GitHubPullRequestPage)1