use of org.jenkinsci.test.acceptance.po.Control in project acceptance-test-harness by jenkinsci.
the class JobDslPluginTest method should_create_new_job_by_using_template.
/**
* Tests whether a new job with template created by JobDsl exists and includes
* same description like the template job when the seed job is build.
*/
@Test
public void should_create_new_job_by_using_template() {
// Arrange
String testedJobName = "MyJob";
String jobDescription = "My sample despription";
Job templateJob = jenkins.jobs.create(FreeStyleJob.class, "Template");
templateJob.configure();
Control descriptionControl = templateJob.control(by.name("description"));
descriptionControl.set(jobDescription);
templateJob.save();
String jobDslScript = String.format("job('%s') { using('%s') }", testedJobName, templateJob.name);
Job seed = createSeedJobWithJobDsl(jobDslScript);
// Act
seed.scheduleBuild().shouldSucceed();
// Assert
Job job = jenkins.jobs.get(Job.class, testedJobName);
job.open();
assertThat(job.getDescription(), containsString(jobDescription));
}
use of org.jenkinsci.test.acceptance.po.Control in project acceptance-test-harness by jenkinsci.
the class CredentialsTest method verifyCredentialNotPresent.
private void verifyCredentialNotPresent(String domain, String user, String credDescription, ManagedCredentials mc) {
jenkins.visit(generateUrlForCredentialsStore(domain, user));
Control cred = mc.checkIfCredentialsExist(credDescription);
assertFalse(cred.exists());
}
use of org.jenkinsci.test.acceptance.po.Control in project acceptance-test-harness by jenkinsci.
the class ColumnsArea method remove.
/**
* Remove the list item for a column from the list of displayed columns.
*
* @param column column, the name of the column that will be removed.
*/
public void remove(Column column) {
final Control deleteButton = getDeleteFor(column);
deleteButton.click();
}
use of org.jenkinsci.test.acceptance.po.Control in project acceptance-test-harness by jenkinsci.
the class JcascManage method configure.
/**
* Configure and apply the new source
*/
public void configure(String path) {
Control control = control("/newSource");
control.set(path);
waitFor().withTimeout(5, TimeUnit.SECONDS).ignoring(AssertionError.class).until(() -> {
assertThat(control.getFormValidation(), FormValidation.reports(FormValidation.Kind.OK, "The configuration can be applied"));
return true;
});
clickButton("Apply new configuration");
verifySuccessfulApplication();
}
use of org.jenkinsci.test.acceptance.po.Control in project acceptance-test-harness by jenkinsci.
the class JGitInstallation method addJGit.
public static JGitInstallation addJGit(Jenkins jenkins) {
ConfigurablePageObject toolsPage = ToolInstallation.ensureConfigPage(jenkins);
final String name = JGitInstallation.class.getAnnotation(ToolInstallationPageObject.class).name();
final Control button = toolsPage.control(by.button("Add " + name));
String pathPrefix = button.resolve().getAttribute("path").replaceAll(Pattern.quote("hetero-list-add[tool]"), "tool");
return ToolInstallation.addTool(jenkins, JGitInstallation.class, pathPrefix, new Runnable() {
@Override
public void run() {
button.selectDropdownMenu("JGit");
}
});
}
Aggregations