use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView in project acceptance-test-harness by jenkinsci.
the class DashboardViewPluginTest method configureDashboardFilterBuildExecutors.
@Test
public void configureDashboardFilterBuildExecutors() throws Exception {
final boolean filterBuildExecutors = true;
Node s = slave1.install(jenkins).get();
s.configure();
s.setLabels("test");
s.save();
FreeStyleJob job = jenkins.jobs.create();
DashboardView v = createDashboardView();
v.configure(() -> {
v.mainArea.setFilterBuildExecutors(filterBuildExecutors);
});
v.open();
final List<String> headers = v.buildExecutorStatus.getHeaders();
final List<String> executors = v.buildExecutorStatus.getExecutors();
assertThat(headers.size(), is(2));
assertThat(executors.size(), greaterThan(1));
job.configure(() -> {
job.setLabelExpression("test");
});
v.open();
final List<String> headers2 = v.buildExecutorStatus.getHeaders();
final List<String> executors2 = v.buildExecutorStatus.getExecutors();
// If only one node, the title header is not shown.
assertThat(headers2.size(), is(0));
assertThat(executors2.size(), is(1));
}
use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView 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));
}
use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView in project acceptance-test-harness by jenkinsci.
the class DashboardViewPluginTest method unstableJobsPortlet_showOnlyFailedJobs.
@Test
public void unstableJobsPortlet_showOnlyFailedJobs() {
DashboardView v = createDashboardView();
UnstableJobsPortlet unstableJobsPortlet = v.addBottomPortlet(UnstableJobsPortlet.class);
unstableJobsPortlet.setShowOnlyFailedJobs(true);
v.save();
FreeStyleJob unstableJob = createUnstableFreeStyleJob();
buildUnstableJob(unstableJob);
assertJobInUnstableJobsPortlet(unstableJobsPortlet, unstableJob.name, false);
FreeStyleJob failingJob = createFailingFreeStyleJob();
buildFailingJob(failingJob);
assertJobInUnstableJobsPortlet(unstableJobsPortlet, failingJob.name, true);
}
use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView 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));
}
use of org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView 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));
}
Aggregations