use of org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method verifyTrendGraph.
protected void verifyTrendGraph(final Job job, final int numberOfWarnings) {
AnalysisAction action = createProjectAction(job);
verifyTrendGraphOverview(job, action, numberOfWarnings);
verifyTrendGraphDetails(job, action, numberOfWarnings);
}
use of org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method should_show_build_health.
/**
* Builds a freestyle job with an enabled publisher of the plug-in under test. Sets the thresholds for the trend
* report so that a health of 0-19% is evaluated for the plug-in under test (shown as tool tip in the Jenkins
* main view).
* TODO: Add different health percentages
*/
@Test
@Issue("JENKINS-28360")
public void should_show_build_health() {
FreeStyleJob job = createFreeStyleJob();
AnalysisAction projectAction = createProjectAction(job);
job.editPublisher(projectAction.getFreeStyleSettings(), settings -> {
settings.setBuildHealthyThreshold(0);
settings.setBuildUnhealthyThreshold(getNumberOfWarnings());
});
buildSuccessfulJob(job);
jenkins.open();
List<WebElement> healthElements = all(by.xpath("//div[@class='healthReportDetails']//tr"));
assertThat(healthElements.size(), is(3));
String expectedText = String.format("%s: %d %s%s found.", projectAction.getPluginName(), getNumberOfWarnings(), projectAction.getAnnotationName(), plural(getNumberOfWarnings()));
assertThatHealthReportIs(healthElements.get(1), expectedText, "00to19");
assertThatHealthReportIs(healthElements.get(2), "Build stability: No recent builds failed.", "80plus");
}
use of org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction in project acceptance-test-harness by jenkinsci.
the class AbstractAnalysisTest method should_store_trend_selection_in_cookie.
/**
* Runs the test case {@link #should_have_trend_graph_with_relative_links_in_freestyle_job()} with a job that
* contains a space in the name. Then the trend is deactivated in the trend configuration view: now the trend should
* be replaced with a link to re-enable the trend. Finally, this link is clicked in order open the trend
* configuration again.
*/
@Test
@Issue({ "JENKINS-25917", "JENKINS-32377" })
@Since("2.0")
public void should_store_trend_selection_in_cookie() {
Job job = buildFreestyleJobTwoTimesInARow();
assertThat(job.name, containsString("_"));
job = job.renameTo(job.name.replace("_", " "));
AnalysisAction action = createProjectAction(job);
verifyTrendGraphOverview(job, action, getNumberOfWarnings());
deactivateTrendGraph(job, action);
}
use of org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction in project acceptance-test-harness by jenkinsci.
the class AnalysisCollectorPluginTest method should_have_clickable_trend_details.
/**
* Builds a freestyle job. Verifies that afterwards a trend graph exists for each of the participating plug-ins.
* Finally, the collector trend graph is verified that contains 6 relative links to the
* plug-in results (one for each priority and build).
*/
@Test
@Issue("JENKINS-30304")
@Since("1.640")
public void should_have_clickable_trend_details() {
FreeStyleJob job = createFreeStyleJob();
buildJobAndWait(job);
buildSuccessfulJob(job);
job.open();
AnalysisAction action = createProjectAction(job);
List<WebElement> graphLinks = job.all(By.linkText("Enlarge"));
assertThat(graphLinks.size(), is(8));
// Last link is the summary
graphLinks.get(graphLinks.size() - 1).click();
assertThatProjectPageTrendIsCorrect(job, action, "../../", getNumberOfWarnings());
}
Aggregations