Search in sources :

Example 1 with AnalysisAction

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);
}
Also used : AnalysisAction(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction)

Example 2 with AnalysisAction

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");
}
Also used : AnalysisAction(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) WebElement(org.openqa.selenium.WebElement) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 3 with AnalysisAction

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);
}
Also used : AnalysisAction(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction) Job(org.jenkinsci.test.acceptance.po.Job) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) WorkflowJob(org.jenkinsci.test.acceptance.po.WorkflowJob) Issue(org.jvnet.hudson.test.Issue) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test) Since(org.jenkinsci.test.acceptance.junit.Since)

Example 4 with AnalysisAction

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());
}
Also used : AnalysisAction(org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) WebElement(org.openqa.selenium.WebElement) Issue(org.jvnet.hudson.test.Issue) Test(org.junit.Test) Since(org.jenkinsci.test.acceptance.junit.Since)

Aggregations

AnalysisAction (org.jenkinsci.test.acceptance.plugins.analysis_core.AnalysisAction)4 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)3 Test (org.junit.Test)3 Issue (org.jvnet.hudson.test.Issue)3 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)2 Since (org.jenkinsci.test.acceptance.junit.Since)2 WebElement (org.openqa.selenium.WebElement)2 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 Job (org.jenkinsci.test.acceptance.po.Job)1 WorkflowJob (org.jenkinsci.test.acceptance.po.WorkflowJob)1