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)));
}
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;
}
Aggregations