Search in sources :

Example 6 with Control

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));
}
Also used : Control(org.jenkinsci.test.acceptance.po.Control) ProjectDefaultBuildAccessControl(org.jenkinsci.test.acceptance.plugins.authorize_project.ProjectDefaultBuildAccessControl) CoreMatchers.containsString(org.hamcrest.CoreMatchers.containsString) Job(org.jenkinsci.test.acceptance.po.Job) FreeStyleJob(org.jenkinsci.test.acceptance.po.FreeStyleJob) AbstractJUnitTest(org.jenkinsci.test.acceptance.junit.AbstractJUnitTest) Test(org.junit.Test)

Example 7 with Control

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());
}
Also used : Control(org.jenkinsci.test.acceptance.po.Control)

Example 8 with Control

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();
}
Also used : Control(org.jenkinsci.test.acceptance.po.Control)

Example 9 with Control

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();
}
Also used : Control(org.jenkinsci.test.acceptance.po.Control)

Example 10 with Control

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");
        }
    });
}
Also used : Control(org.jenkinsci.test.acceptance.po.Control) ConfigurablePageObject(org.jenkinsci.test.acceptance.po.ConfigurablePageObject) ToolInstallationPageObject(org.jenkinsci.test.acceptance.po.ToolInstallationPageObject)

Aggregations

Control (org.jenkinsci.test.acceptance.po.Control)15 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)1 AbstractJUnitTest (org.jenkinsci.test.acceptance.junit.AbstractJUnitTest)1 ProjectDefaultBuildAccessControl (org.jenkinsci.test.acceptance.plugins.authorize_project.ProjectDefaultBuildAccessControl)1 ConfigurablePageObject (org.jenkinsci.test.acceptance.po.ConfigurablePageObject)1 FreeStyleJob (org.jenkinsci.test.acceptance.po.FreeStyleJob)1 Job (org.jenkinsci.test.acceptance.po.Job)1 ToolInstallationPageObject (org.jenkinsci.test.acceptance.po.ToolInstallationPageObject)1 Test (org.junit.Test)1 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)1 WebDriverException (org.openqa.selenium.WebDriverException)1