Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-33162] Tried to expose blocking in test case.
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
.../java/org/jenkinsci/test/acceptance/plugins/parameterized_trigger/BuildTriggerConfig.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,18 @@ | ||
package org.jenkinsci.test.acceptance.plugins.parameterized_trigger; | ||
|
||
import org.jenkinsci.test.acceptance.po.Control; | ||
import org.jenkinsci.test.acceptance.po.PageAreaImpl; | ||
|
||
/** | ||
* Configuration section of a trigger/call build step. | ||
* | ||
* @author Ullrich Hafner | ||
*/ | ||
public class BuildTriggerConfig extends PageAreaImpl { | ||
public final Control projects = control("projects"); | ||
public final Control block = control("block"); | ||
|
||
public BuildTriggerConfig(TriggerCallBuildStep parent, String relativePath) { | ||
super(parent, relativePath); | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
...ava/org/jenkinsci/test/acceptance/plugins/parameterized_trigger/TriggerCallBuildStep.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,43 @@ | ||
package org.jenkinsci.test.acceptance.plugins.parameterized_trigger; | ||
|
||
import java.util.List; | ||
|
||
import org.jenkinsci.test.acceptance.po.AbstractStep; | ||
import org.jenkinsci.test.acceptance.po.BuildStep; | ||
import org.jenkinsci.test.acceptance.po.Describable; | ||
import org.jenkinsci.test.acceptance.po.Job; | ||
import org.openqa.selenium.WebElement; | ||
|
||
/** | ||
* Trigger/call build step of the parameterized trigger plug-in. Starts downstream projects. | ||
* | ||
* @author Ullrich Hafner | ||
*/ | ||
@Describable("Trigger/call builds on other projects") | ||
public class TriggerCallBuildStep extends AbstractStep implements BuildStep { | ||
public TriggerCallBuildStep(Job parent, String path) { | ||
super(parent, path); | ||
} | ||
|
||
public BuildTriggerConfig getBuildTriggerConfig(int index) { | ||
WebElement e = self().findElements(by.name("configs")).get(index); | ||
return wrap(e); | ||
} | ||
|
||
/** | ||
* Adds a new trigger setting. | ||
* | ||
* Note that newly added trigger has one entry in there by default. | ||
*/ | ||
public BuildTriggerConfig addTriggerConfig() { | ||
find(by.button("Add trigger...")).click(); | ||
|
||
List<WebElement> all = self().findElements(by.name("configs")); | ||
return wrap(all.get(all.size() - 1)); | ||
} | ||
|
||
private BuildTriggerConfig wrap(WebElement e) { | ||
return new BuildTriggerConfig(this, | ||
e.getAttribute("path").substring(getPath().length() + 1)); | ||
} | ||
} |
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