use of org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet in project acceptance-test-harness by jenkinsci.
the class DashboardViewPluginTest method buildStatisticsPortlet_unstableNr.
@Test
public void buildStatisticsPortlet_unstableNr() {
DashboardView v = createDashboardView();
BuildStatisticsPortlet stats = v.addBottomPortlet(BuildStatisticsPortlet.class);
v.save();
buildUnstableJob(createUnstableFreeStyleJob());
v.open();
assertThat(stats.getNumberOfBuilds(JobType.UNSTABLE), is(1));
}
use of org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet in project acceptance-test-harness by jenkinsci.
the class DashboardViewPluginTest method buildStatisticsPortlet_totalBuilds.
@Test
public void buildStatisticsPortlet_totalBuilds() {
DashboardView v = createDashboardView();
BuildStatisticsPortlet stats = v.addBottomPortlet(BuildStatisticsPortlet.class);
v.save();
FreeStyleJob successJob = createFreeStyleJob();
FreeStyleJob failingJob = createFailingFreeStyleJob();
FreeStyleJob unstableJob = createUnstableFreeStyleJob();
buildUnstableJob(unstableJob);
buildSuccessfulJob(successJob);
buildSuccessfulJob(successJob);
buildFailingJob(failingJob);
v.open();
assertThat(stats.getNumberOfBuilds(JobType.TOTAL), is(4));
}
use of org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet in project acceptance-test-harness by jenkinsci.
the class DashboardViewPluginTest method buildStatisticsPortlet_success.
@Test
public void buildStatisticsPortlet_success() {
DashboardView v = createDashboardView();
BuildStatisticsPortlet stats = v.addBottomPortlet(BuildStatisticsPortlet.class);
v.save();
buildSuccessfulJob(createFreeStyleJob());
v.open();
assertThat(stats.getNumberOfBuilds(JobType.SUCCESS), is(1));
}
use of org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet in project acceptance-test-harness by jenkinsci.
the class DashboardViewPluginTest method configureDashboardFilterOnlyActivatedJobs.
@Test
public void configureDashboardFilterOnlyActivatedJobs() {
DashboardView v = createDashboardView();
BuildStatisticsPortlet stats = v.addBottomPortlet(BuildStatisticsPortlet.class);
v.configure(() -> {
v.jobFilters.setStatusFilter(JobFiltersArea.StatusFilter.ENABLED);
});
final FreeStyleJob active = createFreeStyleJob();
final FreeStyleJob disabled = createFreeStyleJob();
buildSuccessfulJob(active);
buildSuccessfulJob(disabled);
v.open();
assertThat(stats.getNumberOfBuilds(JobType.TOTAL), is(2));
assertThat(stats.getNumberOfBuilds(JobType.DISABLED), is(0));
disabled.configure(disabled::disable);
v.open();
assertThat(stats.getNumberOfBuilds(JobType.TOTAL), is(1));
assertThat(stats.getNumberOfBuilds(JobType.DISABLED), is(0));
}
use of org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet in project acceptance-test-harness by jenkinsci.
the class DashboardViewPluginTest method buildStatisticsPortlet_Percentage.
@Test
public void buildStatisticsPortlet_Percentage() {
DashboardView v = createDashboardView();
BuildStatisticsPortlet stats = v.addBottomPortlet(BuildStatisticsPortlet.class);
v.save();
FreeStyleJob success = createFreeStyleJob();
FreeStyleJob failing = createFailingFreeStyleJob();
FreeStyleJob unstable = createUnstableFreeStyleJob();
buildSuccessfulJob(success);
v.open();
assertThat(stats.getPercentageOfBuilds(JobType.SUCCESS), is("100.0"));
buildFailingJob(failing);
v.open();
assertThat(stats.getPercentageOfBuilds(JobType.SUCCESS), is("50.0"));
assertThat(stats.getPercentageOfBuilds(JobType.FAILED), is("50.0"));
buildFailingJob(failing);
v.open();
assertThat(stats.getPercentageOfBuilds(JobType.SUCCESS), is("33.33"));
assertThat(stats.getPercentageOfBuilds(JobType.FAILED), is("66.67"));
buildUnstableJob(unstable);
v.open();
assertThat(stats.getPercentageOfBuilds(JobType.SUCCESS), is("25.0"));
assertThat(stats.getPercentageOfBuilds(JobType.FAILED), is("50.0"));
assertThat(stats.getPercentageOfBuilds(JobType.UNSTABLE), is("25.0"));
}
Aggregations