use of org.jenkinsci.test.acceptance.plugins.analysis_collector.AnalysisCollectorColumn in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method should_set_warnings_count_in_list_view_column.
/**
* Sets up a list view with a warnings column. Builds a job and checks if the column shows the correct number of
* warnings and provides a direct link to the actual warning results. Also verifies that the mouse-over tooltip will
* show the correct number of warnings per checked plugin.
*/
@Test
public void should_set_warnings_count_in_list_view_column() {
FreeStyleJob job = createFreeStyleJob();
buildSuccessfulJob(job);
ListView view = jenkins.views.create(ListView.class, "list");
view.configure();
view.matchAllJobs();
view.addColumn(AnalysisCollectorColumn.class);
view.save();
view.open();
WebElement warningsCell = view.find(by.xpath(XPATH_LISTVIEW_WARNING_TD));
assertThat(warningsCell.getText(), is(String.valueOf(TOTAL)));
String tooltip = warningsCell.getAttribute("tooltip");
assertThat(tooltip, allOf(containsString("<a href=\"view/list/job/" + job.name + "/checkstyle\">" + CHECKSTYLE_ALL + "</a>"), containsString("<a href=\"view/list/job/" + job.name + "/findbugs\">" + FINDBUGS_ALL + "</a>"), containsString("<a href=\"view/list/job/" + job.name + "/pmd\">" + PMD_ALL + "</a>"), containsString("<a href=\"view/list/job/" + job.name + "/warnings\">" + WARNINGS_ALL + "</a>")));
view.configure();
AnalysisCollectorColumn column = view.getColumn(AnalysisCollectorColumn.class);
column.checkPlugin(PMD, false);
view.save();
view.open();
// check that PMD warnings are not collected to total warning number and tooltip
warningsCell = view.find(by.xpath(XPATH_LISTVIEW_WARNING_TD));
assertThat(warningsCell.getText(), is(String.valueOf(TOTAL - PMD_ALL)));
tooltip = warningsCell.getAttribute("tooltip");
assertThat(tooltip, not(containsString("<a href=\"job/" + job.name + "/pmd\">" + PMD_ALL + "</a>")));
}
Aggregations