Skip to content

Commit

Permalink
Red testcase for JENKINS-37623
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Ponomarev committed Sep 10, 2016
1 parent 2fbcc63 commit a919323
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/test/java/org/tap4j/plugin/util/GraphHelperTest.java
@@ -0,0 +1,38 @@
package org.tap4j.plugin.util;


import com.gargoylesoftware.htmlunit.html.HtmlPage;
import hudson.model.TopLevelItem;
import org.junit.Rule;
import org.junit.Test;
import org.jvnet.hudson.test.Issue;
import org.jvnet.hudson.test.JenkinsRule;
import org.jvnet.hudson.test.recipes.LocalData;

import static org.junit.Assert.assertTrue;


public class GraphHelperTest {

@Rule
public JenkinsRule rule = new JenkinsRule();

@Issue("JENKINS-37623")
@LocalData
@Test
public void renderTooltipsWithFailedBuilds() throws Exception {

TopLevelItem project = rule.jenkins.getItem("testPipeline-randomly-no-data");
JenkinsRule.WebClient wc = rule.createWebClient();
HtmlPage page = wc.getPage(project);

// there should be a TAP result trend graph
rule.assertXPath(page, "//img[@src='tapResults/graph']");

// check that tooltip is rendered for the last build
rule.assertXPath(page, "//area[@title='1 Failure(s)' and @href='16/tapResults/']");

// check that build without TAP action recorded is excluded from graph
assertTrue(page.getByXPath("//area[@href='7/tapResults/']").isEmpty());
}
}
Binary file not shown.

0 comments on commit a919323

Please sign in to comment.