forked from geoffbullen/build-pipeline-plugin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from ovorobio/JENKINS-31088
[JENKINS-31088] show displayName by default
- Loading branch information
Showing
4 changed files
with
85 additions
and
2 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
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
74 changes: 74 additions & 0 deletions
74
...a/au/com/centrumsystems/hudson/plugin/buildpipeline/BuildPipelineViewDisplayNameTest.java
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,74 @@ | ||
package au.com.centrumsystems.hudson.plugin.buildpipeline; | ||
|
||
import au.com.centrumsystems.hudson.plugin.buildpipeline.BuildPipelineView; | ||
import au.com.centrumsystems.hudson.plugin.buildpipeline.DownstreamProjectGridBuilder; | ||
import au.com.centrumsystems.hudson.plugin.buildpipeline.testsupport.BuildCardComponent; | ||
import au.com.centrumsystems.hudson.plugin.buildpipeline.testsupport.PipelinePage; | ||
import hudson.model.FreeStyleProject; | ||
import hudson.tasks.BuildTrigger; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Ignore; | ||
import org.junit.Rule; | ||
import org.junit.Test; | ||
import org.jvnet.hudson.test.JenkinsRule; | ||
import org.openqa.selenium.WebDriver; | ||
import org.openqa.selenium.firefox.FirefoxDriver; | ||
import org.openqa.selenium.support.ui.WebDriverWait; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
public class BuildPipelineViewDisplayNameTest { | ||
protected WebDriver webDriver; | ||
|
||
@Rule | ||
public JenkinsRule j = new JenkinsRule(); | ||
|
||
@Before | ||
public void before() { | ||
webDriver = new FirefoxDriver(); | ||
WebDriverWait wait = new WebDriverWait(webDriver, 30); | ||
} | ||
|
||
@After | ||
public void cleanUpWebDriver() { | ||
if (webDriver != null) { | ||
webDriver.close(); | ||
webDriver.quit(); | ||
} | ||
} | ||
|
||
/** | ||
* checks that pipeline box uses displayName | ||
*/ | ||
@Ignore | ||
@Test | ||
public void testDisplayName() throws Exception { | ||
final FreeStyleProject freestyle1 = j.createFreeStyleProject("freestyle1"); | ||
|
||
freestyle1.setDisplayName("fancyname1"); | ||
|
||
freestyle1.scheduleBuild(); | ||
j.waitUntilNoActivity(); | ||
|
||
BuildPipelineView pipeline = new BuildPipelineView("pipeline", "", | ||
new DownstreamProjectGridBuilder(freestyle1.getFullName()), | ||
"1", //num displayed | ||
false, //trigger only latest | ||
true, // manual trigger | ||
false, // parameters | ||
false, //params in header | ||
false, //definition header | ||
1, null, null); | ||
|
||
j.getInstance().addView(pipeline); | ||
|
||
PipelinePage pipelinePage = new PipelinePage(webDriver, pipeline.getViewName(), j.getURL()); | ||
pipelinePage.open(); | ||
|
||
BuildCardComponent buildCardComponent = pipelinePage.buildCard(1, 1, 2); | ||
|
||
assertTrue("The displayName should be visible", | ||
buildCardComponent.hasDisplayName("fancyname1")); | ||
} | ||
} |
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