forked from kinow/tap-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vladislav Ponomarev
committed
Sep 10, 2016
1 parent
2fbcc63
commit a919323
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.