Search in sources :

Example 1 with LatestBuildsPortlet

use of org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet in project acceptance-test-harness by jenkinsci.

the class DashboardViewPluginTest method latestsBuildsPortlet_correctJobLink.

@Test
public void latestsBuildsPortlet_correctJobLink() {
    DashboardView v = createDashboardView();
    LatestBuildsPortlet latestBuilds = v.addBottomPortlet(LatestBuildsPortlet.class);
    v.save();
    FreeStyleJob job = createFreeStyleJob();
    buildSuccessfulJob(job);
    v.open();
    latestBuilds.openJob(job.name);
    assertThat(driver, hasContent("Project " + job.name));
}
Also used : LatestBuildsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Test(org.junit.Test)

Example 2 with LatestBuildsPortlet

use of org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet in project acceptance-test-harness by jenkinsci.

the class DashboardViewPluginTest method latestsBuildsPortlet_onlyLatest.

@Test
public void latestsBuildsPortlet_onlyLatest() {
    DashboardView v = createDashboardView();
    LatestBuildsPortlet latestBuilds = v.addBottomPortlet(LatestBuildsPortlet.class);
    v.save();
    FreeStyleJob job = createFreeStyleJob();
    for (int i = 0; i <= LatestBuildsPortlet.NUMBER_OF_BUILDS + 1; i++) buildSuccessfulJob(job);
    v.open();
    assertThat(latestBuilds.hasBuild(1), is(false));
}
Also used : LatestBuildsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Test(org.junit.Test)

Example 3 with LatestBuildsPortlet

use of org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet in project acceptance-test-harness by jenkinsci.

the class DashboardViewPluginTest method latestsBuildsPortlet_correctJobAndBuild.

@Test
public void latestsBuildsPortlet_correctJobAndBuild() {
    DashboardView v = createDashboardView();
    LatestBuildsPortlet latestBuilds = v.addBottomPortlet(LatestBuildsPortlet.class);
    v.save();
    FreeStyleJob job = createFreeStyleJob();
    v.open();
    assertThat(latestBuilds.hasJob(job.name), is(false));
    Build build1 = buildSuccessfulJob(job);
    Build build2 = buildSuccessfulJob(job);
    v.open();
    assertThat(latestBuilds.hasJob(job.name), is(true));
    assertThat(latestBuilds.hasBuild(build1.getNumber()), is(true));
    assertThat(latestBuilds.hasBuild(build2.getNumber()), is(true));
}
Also used : LatestBuildsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet) Build(org.jenkinsci.test.acceptance.po.Build) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Test(org.junit.Test)

Example 4 with LatestBuildsPortlet

use of org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet in project acceptance-test-harness by jenkinsci.

the class DashboardViewPluginTest method latestsBuildsPortlet_correctBuildLink.

@Test
public void latestsBuildsPortlet_correctBuildLink() {
    DashboardView v = createDashboardView();
    LatestBuildsPortlet latestBuilds = v.addBottomPortlet(LatestBuildsPortlet.class);
    v.save();
    Build build = buildSuccessfulJob(createFreeStyleJob());
    v.open();
    latestBuilds.openBuild(build.getNumber());
    assertThat(driver, hasContent("Build #" + build.getNumber()));
}
Also used : LatestBuildsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet) Build(org.jenkinsci.test.acceptance.po.Build) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) Test(org.junit.Test)

Aggregations

DashboardView (org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView)4 LatestBuildsPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet)4 Test (org.junit.Test)4 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)3 Build (org.jenkinsci.test.acceptance.po.Build)2