use of org.jenkinsci.test.acceptance.po.JenkinsConfig in project acceptance-test-harness by jenkinsci.
the class FormValidationTest method validate.
@Test
public void validate() throws Exception {
JenkinsConfig c = jenkins.getConfigPage();
c.configure();
c.numExecutors.set(16);
FormValidation formValidation = c.numExecutors.getFormValidation();
assertThat(formValidation, silent());
c.numExecutors.set(-16);
formValidation = c.numExecutors.getFormValidation();
// support older jenkins versions
String errorMessage = jenkins.getVersion().isNewerThan(new VersionNumber("2.104")) ? "Not a non-negative number" : "Not an integer";
assertThat(formValidation, reports(Kind.ERROR, errorMessage));
}
use of org.jenkinsci.test.acceptance.po.JenkinsConfig in project acceptance-test-harness by jenkinsci.
the class MissionControlTest method testBuildQueue.
/**
* Test the existence and number of builds in the queue.
*/
@Test
public void testBuildQueue() {
MissionControlView view = jenkins.views.create(MissionControlView.class, "mission-control-sample-view");
view.configure(() -> view.setHideBuildQueue(true));
view.open();
assertThat(driver, not(hasContent("Build queue")));
view.configure(() -> view.setHideBuildQueue(false));
JenkinsConfig master = jenkins.getConfigPage();
master.configure(() -> master.labels.set("notQueued"));
FreeStyleJob job = jenkins.jobs.create(FreeStyleJob.class, "queuedJob");
job.configure(() -> job.setLabelExpression("queued"));
job.scheduleBuild();
view.open();
assertThat(view.getBuildQueueArea().getBuildQueueSize(), is(1));
job.configure(() -> job.setLabelExpression("notQueued"));
job.getLastBuild().waitUntilFinished();
view.open();
assertThat(view.getBuildQueueArea().getBuildQueueSize(), is(0));
}
use of org.jenkinsci.test.acceptance.po.JenkinsConfig in project acceptance-test-harness by jenkinsci.
the class ArtifactoryPluginTest method configureArtifactory.
ArtifactoryGlobalConfig.Server configureArtifactory(ArtifactoryContainer artifactory) {
JenkinsConfig config = jenkins.getConfigPage();
config.configure();
ArtifactoryGlobalConfig global = new ArtifactoryGlobalConfig(config);
Server server = global.addServer();
server.id.set("artifactoryId");
server.url.set(artifactory.getURL());
server.username.set("admin");
server.password.set("password");
config.save();
return server;
}
use of org.jenkinsci.test.acceptance.po.JenkinsConfig in project acceptance-test-harness by jenkinsci.
the class DockerBuildStepTest method configureTcpEndpoint.
@Before
public void configureTcpEndpoint() {
assumeNotNull(DOCKER_DAEMON_TCP);
final JenkinsConfig global = jenkins.getConfigPage();
global.configure();
GlobalDockerConfig pluginConfig = new GlobalDockerConfig(global);
pluginConfig.restApiUrl(DOCKER_DAEMON_TCP);
pluginConfig.testConnection();
global.save();
}
use of org.jenkinsci.test.acceptance.po.JenkinsConfig in project acceptance-test-harness by jenkinsci.
the class FormValidationTest method jsValidation.
private void jsValidation() {
JenkinsConfig c = jenkins.getConfigPage();
c.configure();
c.numExecutors.set(16);
FormValidation formValidation = c.numExecutors.getFormValidation();
assertThat(formValidation, silent());
c.numExecutors.set(-16);
formValidation = c.numExecutors.getFormValidation();
// support older jenkins versions
String errorMessage = jenkins.getVersion().isNewerThan(new VersionNumber("2.295")) ? "Not a non-negative integer" : "Not a non-negative number";
assertThat(formValidation, reports(Kind.ERROR, errorMessage));
}
Aggregations