Search in sources :

Example 16 with SignClaPage

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

the class HomeControllerTests method signIcla.

@Test
@WithSigningUser
public void signIcla() {
    when(mockClaRepository.findByNameAndPrimaryTrue(cla.getName())).thenReturn(cla);
    SignClaPage home = HomePage.go(driver);
    SignIclaPage sign = home.signIcla(SignIclaPage.class);
    sign.assertAt();
}
Also used : SignClaPage(io.pivotal.cla.webdriver.pages.SignClaPage) SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) WithSigningUser(io.pivotal.cla.security.WithSigningUser) Test(org.junit.Test)

Example 17 with SignClaPage

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

the class HomeControllerTests method home.

@Test
public void home() throws Exception {
    SignClaPage home = HomePage.go(driver);
    home.assertAt();
}
Also used : SignClaPage(io.pivotal.cla.webdriver.pages.SignClaPage) Test(org.junit.Test)

Example 18 with SignClaPage

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

the class SmokeTests method all.

@Test
public void all() throws Exception {
    AdminLinkClaPage link = AdminLinkClaPage.to(driverForLinkUser);
    GitHubLoginPage login = new GitHubLoginPage(driverForLinkUser);
    link = login.loginForm().username(linkUser.getGitHubUsername()).password(linkUser.getGitHubPassword()).submit(AdminLinkClaPage.class);
    // getting caught at the redirect page
    link.waitUntilAt();
    takeScreenShot(driverForLinkUser, "cla-link");
    link = link.link(linkUser.getGitHubUsername() + "/cla-test", "pivotal", AdminLinkClaPage.class);
    link.assertAt();
    takeScreenShot(driverForLinkUser, "cla-link-success");
    String pullHtmlUrl = createPullRequest(signUser, 1);
    GitHubLoginPage signLogin = GitHubLoginPage.to(driverForSignUser);
    signLogin.loginForm().username(signUser.getGitHubUsername()).password(signUser.getGitHubPassword()).submit(PullRequestService.class);
    driverForSignUser.get(pullHtmlUrl);
    GitHubPullRequestPage pull = new GitHubPullRequestPage(driverForSignUser);
    pull.assertCommentPleaseSignFor(signUser.getGitHubUsername());
    pull.assertBuildStatusSign();
    takeScreenShot(driverForSignUser, "gh-pull-request-please-sign");
    SignClaPage sign = pull.details();
    sign.waitUntilAt(() -> sign.assertAt());
    takeScreenShot(driverForSignUser, "cla-signclapage-please-sign");
    SignIclaPage signIcla = sign.signIcla(SignIclaPage.class);
    signIcla.assertAt();
    signIcla.form().name("Big Bird").email(1).mailingAddress("123 Seasame St").telephone("123.456.7890").country("USA").confirm();
    takeScreenShot(driverForSignUser, "cla-signicla-please-sign");
    signIcla = signIcla.form().sign(SignIclaPage.class);
    pull = signIcla.pullRequest();
    pull.assertCommentThankYouFor(signUser.getGitHubUsername());
    takeScreenShot(driverForSignUser, "gh-pull-request-thanks");
    pullHtmlUrl = createPullRequest(signUser, 2);
    driverForSignUser.get(pullHtmlUrl);
    pull = new GitHubPullRequestPage(driverForSignUser);
    pull.assertBuildStatusSuccess();
    takeScreenShot(driverForSignUser, "gh-pull-request-already-signed");
}
Also used : SignClaPage(io.pivotal.cla.webdriver.pages.SignClaPage) GitHubLoginPage(io.pivotal.cla.webdriver.pages.github.GitHubLoginPage) GitHubPullRequestPage(io.pivotal.cla.webdriver.pages.github.GitHubPullRequestPage) SignIclaPage(io.pivotal.cla.webdriver.pages.SignIclaPage) AdminLinkClaPage(io.pivotal.cla.webdriver.pages.admin.AdminLinkClaPage) Test(org.junit.Test)

Aggregations

SignClaPage (io.pivotal.cla.webdriver.pages.SignClaPage)18 Test (org.junit.Test)18 WithSigningUser (io.pivotal.cla.security.WithSigningUser)12 User (io.pivotal.cla.data.User)4 SignIclaPage (io.pivotal.cla.webdriver.pages.SignIclaPage)3 CurrentUserRequest (io.pivotal.cla.service.github.CurrentUserRequest)2 PullRequestStatus (io.pivotal.cla.service.github.PullRequestStatus)2 AboutPage (io.pivotal.cla.webdriver.pages.AboutPage)2 SignCclaPage (io.pivotal.cla.webdriver.pages.SignCclaPage)2 AdminLinkClaPage (io.pivotal.cla.webdriver.pages.admin.AdminLinkClaPage)2 WithAnonymousUser (org.springframework.security.test.context.support.WithAnonymousUser)2 AccessToken (io.pivotal.cla.data.AccessToken)1 OAuthAccessTokenParams (io.pivotal.cla.service.github.OAuthAccessTokenParams)1 GitHubLoginPage (io.pivotal.cla.webdriver.pages.github.GitHubLoginPage)1 GitHubPullRequestPage (io.pivotal.cla.webdriver.pages.github.GitHubPullRequestPage)1 InvocationOnMock (org.mockito.invocation.InvocationOnMock)1