
com.katalon.platform.api.controller.TestExecutionController Maven / Gradle / Ivy
package com.katalon.platform.api.controller;
import java.util.Collections;
import java.util.Map;
import com.katalon.platform.api.exception.PlatformException;
/**
* TestExecutionController is a unique KS Controller to help KS plugins can create a test execution (test suite or test
* suite collection) via KS commandline arguments system.
*
* @since 1.0.11
*/
public interface TestExecutionController extends Controller {
/**
* Creates a UI test execution by the given args
.
*
* Supports almost commands that are listed in
*
* Katalon Command Line options
*
* Supported arguments:
*
* - testSuitePath
* - testSuiteCollectionPath
* - browserType
* - retry
* - retryFailedTestCases
* - remoteWebDriverUrl
* - remoteWebDriverType
* - deviceId
* - config
* - executionProfile
* - g_XXX
*
* @param args Array of arguments
*
* Examples of using:
*
* 1: Execute test suite A with Chrome browser:
*
* args = ["-testSuitePath=path_to_A", "-browserType=Chrome"]
*
*
* 2: Execute test suite A with Android device emulator-5554:
*
* args = ["-testSuitePath=path_to_A", "-browserType=Android", "deviceId=emulator-5554"]
*
*
* 3: Execute test suite collection B:
*
* args = ["-testSuiteCollectionPath=path_to_B"]
* @throws PlatformException if the args are invalid.
* @since 1.0.11
*/
public void run(String[] args) throws PlatformException;
/**
* Creates a UI test execution by the given args
.
*
* Supports almost commands that are listed in
*
* Katalon Command Line options.
*
*
* Supported arguments:
*
* - testSuitePath
* - testSuiteCollectionPath
* - browserType
* - retry
* - retryFailedTestCases
* - remoteWebDriverUrl
* - remoteWebDriverType
* - deviceId
* - config
* - executionProfile
* - g_XXX
*
*
* @param args Array of arguments
*
* Examples of using:
*
* 1: Execute test suite A with Chrome browser:
*
* args = ["-testSuitePath=path_to_A", "-browserType=Chrome"]
*
*
* 2: Execute test suite A with Android device emulator-5554:
*
* args = ["-testSuitePath=path_to_A", "-browserType=Android", "deviceId=emulator-5554"]
*
*
* 3: Execute test suite collection B:
*
* args = ["-testSuiteCollectionPath=path_to_B"]
*
* @param testSuiteInstanceConfiguration contains some configurations for a test suite execution instance.
* @throws PlatformException if the args are invalid.
* @since 1.0.11
*/
public void run(String[] args, TestSuiteInstanceConfiguration testSuiteInstanceConfiguration)
throws PlatformException;
/**
* Describes some configurations of a test execution instance (test suite) such as: VM arguments, environment
* variables,...
*
* @since 1.0.11
*/
public interface TestSuiteInstanceConfiguration {
/**
* @return an array of VM arguments for a test execution instance.
* @since 1.0.11
*/
default String[] getVmArgs() {
return new String[0];
}
/**
* @return a map of environment variables of the runtime test execution.
* @since 1.0.11
*/
default Map getAdditionEnvironmentVariables() {
return Collections.emptyMap();
}
/**
* @return a map of additional data that will use in TestSuiteExecutor.
* @since 1.0.11
*/
default Map getAdditionalData() {
return Collections.emptyMap();
}
}
}