Running Tests via the Jenkins Plugin UI

This guide contains instructions for using the BitBar Run-in-Cloud plugin from the UI. For instructions on Pipeline, see Running Tests With a Pipeline Script.

Configure

Note

Ensure that Jenkins is running under Java 11 or higher to use the plugin.

Open the Jenkins main configuration page (Manage Jenkins > System) in the BitBar Run-in-Cloud section and fill in the necessary BitBar Cloud account information. Click the Authorize & Save button to validate account details.

BitBar Run-in-Cloud configurations

Run-in-Cloud - Build Step

Open an existing Jenkins job or create a new one. From the job configuration, add a new build step.

To run tests in BitBar Cloud, select a target project, upload a new application or/and instrumentation package to that project, and define the file name in the corresponding field.

Jenkings plugin - Build step

Annotations can be configured in the following section. For more information on how to use annotations to execute subsets of tests, see Using annotations.

Using_annotations.png

The following fields are only for Android Instrumentation runs:

  • Device group

  • Device language

  • Screenshots configuration

  • Custom test runner

  • Tests with annotation

  • Tests without annotation

  • Use test cases from

API call

Jenkins is pulling BitBar Cloud for results. The test results are copied to the Jenkins workspace after the tests are finished.

API call

Hook URL

BitBar Cloud sends a post message to a defined URL when a test run is finished. RiC listens to the message in the default location and downloads results when the post message arrives. The listened URL can be changed.

A POST message body:

testRunId=%s&projectId=%s&status=FINISHED

Important

To ensure seamless integration, the HOOK URL must be accessible from the Internet, meaning that the Jenkins instance should be reachable from BitBar Cloud.

Hook URL

Using annotations

Android InstrumentationTestRunner allows you to filter test runs from a specific Java package or class, but in addition, you can also use custom Java annotations in your test methods to filter the test runs.

Create custom annotations

All you have to do is to create a class like this:

package com.testdroid.test.annotations;
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface MyAnnotation {
}

Then, annotate your test method:

@MyAnnotation
public void testButtonClick() throws Exception {
    /*    test code    */
}

Example

Here is an example Eclipse project with annotations in use.

See Also

Publication date: