Page tree
Skip to end of metadata
Go to start of metadata
  • All actions are also available for project admins and users


URLMethodParametersresults
/api/v1/test-run/execute-test-run-asyncPOST

executionType - String - xcuitest / espresso.

runningType - String - coverage / fastFeedback

  1. Coverage - all of the tests will be executed on all of the selected devices.

  2. Fast feedback - all of the tests will be spread across the selected devices.

app - File - application under test.

testApp -File - espresso / XCUI tests.

deviceQueries - List of strings (XPath queries). Test run should run on devices that match provided queries (device per query).

uuid(optional) - String- provision profile UUID to sign the Application and the test application.

runTags(optional) - String - map as JSON - wanted tags to upload to the reporter.

Example: {“ApplicationName”:”eriBank”, ”AppVersion”:”11.2”, “os”:”android”}

overallTimeout(optional) - Long - number of milliseconds. Timeout for the overall test run. If not provided - default value (14,400,000) - 4 hours - should be used.

creationTimeout(optional) - Long - number of milliseconds. Timeout for test request in queued status. If not provided - default value (14,400,000) - 4 hours - should be used.

ignoreTestFile(optional) - File- file should include ignore tests.

  • iOS - xcscheme file
  • Android - txt file which includes full class name and method name with the format below:
    full_class_name, method name
    full_class_name2, method name2

maxDevices(optional, use only with fast feedback) - Long- Maximum number of devices to use during the execution. default value - max available devices license.

minDevices(optional, use only with fast feedback) - Long- Minimum number of devices to use during the execution. default value - 1.

Return a response immediately.

JSON output:

  1. Test Run Id

  2. Link to reporter


/api/v1/test-run/execute-test-run
POST

executionType - String - xcuitest/espresso.

runningType - String - coverage/fastFeedback

  1. Coverage - all of the tests will be executed on all of the selected devices.

  2. Fast feedback - all of the tests will be spread across the selected devices.

app - File - application under test.

testApp -File - espresso/XCUI tests.

deviceQueries - List of strings (XPath queries). Test run should run on devices that match provided queries (device per query).

uuid(optional) - String- provision profile UUID to sign the Application and the test application.

runTags(optional) - String - map as JSON - wanted tags to upload to the reporter.

Example: {“ApplicationName”:”eriBank”, ”AppVersion”:”11.2”, “os”:”android”}

overallTimeout(optional) - Long - number of milliseconds. Timeout for overall test run. If not provided - default value (14,400,000) - 4 hours - should be used.

creationTimeout(optional) - Long - number of milliseconds. Timeout for test request in queued status. If not provided - default value (14,400,000) - 4 hours - should be used.


ignoreTestFile(optional) - File- file should include ignore tests.

  • iOS - xcscheme file
  • Android - txt file which includes full class name and method name with the format below:
    full_class_name, method name
    full_class_name2, method name2

maxDevices(optional, use only with fast feedback) - Long- Maximum number of devices to use during the execution. default value - max available devices license.

minDevices(optional, use only with fast feedback) - Long- Minimum number of devices to use during the execution. default value - 1.


Return a response after the executed test run finishes.

JSON output:

  1. Test Run Id

  2. Total number of tests.

  3. Number of passed tests.

  4. Number of failed tests.

  5. Number of skipped tests.

  6. Number of running tests.

  7. Number of queued tests.

  8. Link to reporter.

/api/v1/test-run/{id}/cancel
POST

id - test run id


Cancel all tests of the executed suit.
/api/v1/test-run/{id}/statusGETid - test run id

JSON output:

  1. Test Run Id

  2. Total number of tests.

  3. Number of passed tests.

  4. Number of failed tests.

  5. Number of skipped tests.

  6. Number of running tests.

  7. Number of queued tests.

  8. Link to reporter.



The examples below use the Unirest HTTP library.  To compile and run them, use the following Maven dependency:

<dependency>
    <groupId>com.mashape.unirest</groupId>
    <artifactId>unirest-java</artifactId>
    <version>1.4.9</version>
</dependency>


or Gradle dependency:

dependencies {
	compile group: 'com.mashape.unirest', name: 'unirest-java', version: '1.4.9'
}



Code Examples


executeTestRunAsync
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import java.io.File;
import org.junit.Test;


public class ExecuteTestRunAsync {

    String urlBase = "http://cloudHost:cloudPort"; // modify hostname and port as applicable your environment
    String user = "admin";
    String password = "password"; // modify the admin password as applicable your environment
    String url = urlBase + "/api/v1/test-run/execute-test-run-async";
    String pathToTestApp = "pathtoTestApp"; // path to XcuiTests or espresso tests
    String pathToApp = "pathToFIle";

    @Test
    public void executeTestRunAsync() throws UnirestException {
        File app = new File(pathToApp);      
        File testApp =  new File(pathToTestApp);
        HttpResponse<String> response = Unirest.post(url)
            .basicAuth(user, password)
            .queryString("executionType", "espresso")
			.queryString("runningType", "coverage")
			.queryString("deviceQueries", "@os='android'")
            .field("app", app)
            .field("testApp", testApp)
            .asString();
        System.out.println(response.getBody());
    }
}


executeTestRun
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import java.io.File;
import org.junit.Test;


public class ExecuteTestRun {

    String urlBase = "http://cloudHost:cloudPort"; // modify hostname and port as applicable your environment
    String user = "admin";
    String password = "password"; // modify the admin password as applicable your environment
    String url = urlBase + "/api/v1/test-run/execute-test-run";
    String pathToTestApp = "pathtoTestApp"; // path to XcuiTests or espresso tests
    String pathToApp = "pathToFIle";

    @Test
    public void executeTestRun() throws UnirestException {
        File app = new File(pathToApp);      
        File testApp =  new File(pathToTestApp);
		Unirest.setTimeouts(0, 0); //set infinity timeout for post request
        HttpResponse<String> response = Unirest.post(url)
            .basicAuth(user, password)
            .queryString("executionType", "espresso")
			.queryString("runningType", "coverage")
			.queryString("deviceQueries", "@os='android'")
            .field("app", app)
            .field("testApp", testApp)
            .asString();
        System.out.println(response.getBody());
    }
}



cancelTestRun
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import org.junit.Test;

public class TestRun {
    String urlBase = "http://cloudHost:cloudPort";   // modify hostname and port as applicable your environment
    String user = "admin";
    String password = "password";  // modify the admin password as applicable your environment
	Long testRunId = testRunId; // need to put here the test run id
	String url = urlBase + "/api/v1/test-run/" + testRunId +"/cancel";



    @Test
    public void cancelTestRun() throws UnirestException {
        
        HttpResponse<String> response = Unirest.get(url)
            .basicAuth(user, password)
            .asString();

        System.out.println(response.getBody());

    }

}


getTestRunStatus
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import org.junit.Test;

public class TestRun {
    String urlBase = "http://cloudHost:cloudPort";   // modify hostname and port as applicable your environment
    String user = "admin";
    String password = "password";  // modify the admin password as applicable your environment
	Long testRunId = testRunId; // need to put here the test run id
	String url = urlBase + "/api/v1/test-run/" + testRunId +"/status";



    @Test
    public void getTestRunStatus() throws UnirestException {
        
        HttpResponse<String> response = Unirest.get(url)
            .basicAuth(user, password)
            .asString();

        System.out.println(response.getBody());

    }

}


  • No labels