Search in sources :

Example 1 with WarningsPerProjectPortlet

use of org.jenkinsci.test.acceptance.plugins.analysis_collector.WarningsPerProjectPortlet in project acceptance-test-harness by jenkinsci.

the class AnalysisCollectorPluginTest method should_aggregate_warnings_in_dashboard_portlet.

/**
 * Sets up a dashboard view with a warnings-per-project portlet. Builds a job and checks if the portlet shows the
 * correct number of warnings. Then one of the tools is deselected. The portlet should then show only the remaining
 * number of warnings.
 */
@Test
@WithPlugins("dashboard-view")
public void should_aggregate_warnings_in_dashboard_portlet() {
    // avoid JENKINS-49026
    checkExtensionAreDeployed("hudson.plugins.analysis.dashboard.AbstractPortlet", Collections.EMPTY_SET);
    FreeStyleJob job = createFreeStyleJob();
    buildSuccessfulJob(job);
    DashboardView dashboard = jenkins.views.create(DashboardView.class, createRandomName());
    dashboard.configure();
    dashboard.matchAllJobs();
    WarningsPerProjectPortlet portlet = addWarningsPortlet(dashboard);
    dashboard.save();
    dashboard.open();
    verifyWarningsCountInPortlet(job.name, dashboard);
    // uncheck Open Tasks
    dashboard.configure(() -> portlet.checkCollectedPlugin(TASKS, false));
    dashboard.open();
    assertThat(dashboard, not(hasWarnings(job.name, TASKS.getId(), TASKS_ALL)));
}
Also used : WarningsPerProjectPortlet(org.jenkinsci.test.acceptance.plugins.analysis_collector.WarningsPerProjectPortlet) DashboardView(org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) Test(org.junit.Test) WithPlugins(org.jenkinsci.test.acceptance.junit.WithPlugins)

Example 2 with WarningsPerProjectPortlet

use of org.jenkinsci.test.acceptance.plugins.analysis_collector.WarningsPerProjectPortlet in project acceptance-test-harness by jenkinsci.

the class AnalysisCollectorPluginTest method addWarningsPortlet.

private WarningsPerProjectPortlet addWarningsPortlet(DashboardView dashboard) {
    WarningsPerProjectPortlet portlet = dashboard.addBottomPortlet(WarningsPerProjectPortlet.class);
    portlet.setName("My Warnings");
    portlet.hideZeroWarningsProjects(false);
    portlet.showImagesInTableHeader(true);
    return portlet;
}
Also used : WarningsPerProjectPortlet(org.jenkinsci.test.acceptance.plugins.analysis_collector.WarningsPerProjectPortlet)

Aggregations

WarningsPerProjectPortlet (org.jenkinsci.test.acceptance.plugins.analysis_collector.WarningsPerProjectPortlet)2 WithPlugins (org.jenkinsci.test.acceptance.junit.WithPlugins)1 DashboardView (org.jenkinsci.test.acceptance.plugins.dashboard_view.DashboardView)1 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)1 Test (org.junit.Test)1