Search in sources :

Example 6 with BuildStatisticsPortlet

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

the class DashboardViewPluginTest method buildStatisticsPortlet_failedNr.

@Test
public void buildStatisticsPortlet_failedNr() {
    DashboardView v = createDashboardView();
    BuildStatisticsPortlet stats = v.addBottomPortlet(BuildStatisticsPortlet.class);
    v.save();
    buildFailingJob(createFailingFreeStyleJob());
    v.open();
    assertThat(stats.getNumberOfBuilds(JobType.FAILED), is(1));
}
Also used : BuildStatisticsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) Test(org.junit.Test)

Example 7 with BuildStatisticsPortlet

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

the class DashboardViewPluginTest method configureDashboardFilterOnlyDisabledJobs.

@Test
@Ignore("The statistics portlet shows only one job in total (the disabled one). it is shown as successful (1) but disabled(0)." + "I found no way to get a disabled number other than zero when status filter is set to disabled. ")
public void configureDashboardFilterOnlyDisabledJobs() {
    DashboardView v = createDashboardView();
    BuildStatisticsPortlet stats = v.addBottomPortlet(BuildStatisticsPortlet.class);
    v.configure(() -> {
        v.jobFilters.setStatusFilter(JobFiltersArea.StatusFilter.DISABLED);
    });
    final FreeStyleJob active = createFreeStyleJob();
    final FreeStyleJob disabled = createFreeStyleJob();
    buildSuccessfulJob(active);
    buildSuccessfulJob(disabled);
    disabled.configure(disabled::disable);
    v.open();
    assertThat(stats.getNumberOfBuilds(JobType.TOTAL), is(1));
    // When run the number of disabled jobs is zero.
    assertThat(stats.getNumberOfBuilds(JobType.DISABLED), is(1));
}
Also used : BuildStatisticsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

BuildStatisticsPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet)7 DashboardView (org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView)7 Test (org.junit.Test)7 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)4 Ignore (org.junit.Ignore)1