Search in sources :

Example 21 with DashboardView

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));
}
Also used : Node(org.jenkinsci.test.acceptance.po.Node) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Test(org.junit.Test)

Example 22 with DashboardView

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));
}
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 23 with DashboardView

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);
}
Also used : UnstableJobsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.UnstableJobsPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Test(org.junit.Test)

Example 24 with DashboardView

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));
}
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 25 with DashboardView

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));
}
Also used : BuildStatisticsPortlet(org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) Test(org.junit.Test)

Aggregations

DashboardView (org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView)35 Test (org.junit.Test)32 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)16 BuildStatisticsPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.BuildStatisticsPortlet)7 JobsGridPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.JobsGridPortlet)4 LatestBuildsPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.LatestBuildsPortlet)4 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)3 TestStatisticsChartPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.TestStatisticsChartPortlet)3 UnstableJobsPortlet (org.jenkinsci.test.acceptance.plugins.dashboard_view.UnstableJobsPortlet)3 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)2 NestedView (org.jenkinsci.test.acceptance.plugins.nested_view.NestedView)2 Build (org.jenkinsci.test.acceptance.po.Build)2 Folder (org.jenkinsci.test.acceptance.po.Folder)2 Issue (org.jvnet.hudson.test.Issue)2 Description (org.hamcrest.Description)1 Matcher (org.jenkinsci.test.acceptance.Matcher)1 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 WithCredentials (org.jenkinsci.test.acceptance.junit.WithCredentials)1 WithDocker (org.jenkinsci.test.acceptance.junit.WithDocker)1 AnalysisPlugin (org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisPlugin)1