HyperExecute YAML
The HyperExecute YAML file serves as the foundational component for test execution within the HyperExecute Platform. The subsequent list enumerates the diverse configuration options supported by HyperExecute YAML, providing you with the flexibility to tailor test execution according to the specific requirements of your project.
Mandatory Parameters
Key | Type | Description |
---|---|---|
version | String | The version of HyperExecute YAML you are using. |
runson | linux, mac, or win | The OS on which you will run your Test. Can provide ${matrix.os} as well to run a multi OS job. |
pre | List of Strings | The actions that are performed before test execution. |
AutoSplit Mode Parameters
Key | Type | Description |
---|---|---|
autosplit | Boolean | Autosplit utilizes an AI-based algorithm to intelligently distribute your discovered tests among concurrent virtual machines (VMs). It takes into account the previous test runs and statuses to achieve the most optimal distribution of tests. By doing so, it maximizes the efficiency and effectiveness of your test execution process. Default value is false . |
concurrency | Integer | Indicates the number of concurrent sessions on HyperExecute. |
testDiscovery | Map | This key is used to locate or discover relevant tests via class names, filters, file names, etc. |
testRunnerCommand | String | A command used to run a single test entity in isolation.This entity could be a file , module, feature or scenario. |
Matrix Mode Parameters
Key | Type | Description |
---|---|---|
matrix | String | A matrix allows you to create multiple tasks by performing variable substitutions in a single job definition. |
combineTasksInMatrixMode | Boolean | This flag is passed in matrix mode to run the (matrix-multiplied) combinations as scenarios in the specified number of HyperExecute machines, instead of 1 machine per matrix-combination. |
testSuites | String | A command to run the tests that were mentioned in the scenario key for matrix based test execution. |
Hybrid Mode Parameters
Key | Type | Description |
---|---|---|
parallelism | Integer | Parallelism defines number VMs to be spawned in case of hybrid mode, if the user is not defining the parallelism then he must define platform specific parallelism (win , mac and linux). If both are defined the preference will be given to platform base parallelism |
macParallelism | Integer | It defines number of mac VM to be spawned for job. |
winParallelism | Integer | It defines number of win VM to be spawned for job. |
linuxParallelism | Integer | It defines number of linux VM to be spawned for job. |
testRunnerCommand | String | A command used to run a single test entity in isolation.This entity could be a file , module, feature or scenario. |
macTestRunnerCommand | String | Test runner command for MAC. |
winTestRunnerCommand | String | Test runner command for Windows. |
linuxTestRunnerCommand | String | Test runner command for Linux. |
Basic Parameters
Key | Type | Description |
---|---|---|
cacheKey | String | File which can be used to generate unique key for cache. Example : package.json |
cacheDirectories | List of Strings | Dependency directories that are cached to improve the test execution speed. |
env | Map | No |
runtime | Map | Install any dependent language/framework with any specific version. |
retryOnFailure | Boolean | If set to true, then it will retry tests based on maxRetries key as defined below. Default value is false . |
maxRetries | Integer | The maximum number of times your scenarios can be retried. If retryOnFailure is true then Default value will be 2. Value Range 1 to 5. |
post | List of Strings | The actions that are performed after test execution. |
report | Boolean | To generate the test report at the end of the job using the framework generated reports, set this value to true. We also need to set partialReports for generating report |
partialReports | Map | Configurations related to generate report. |
errorCategorizedOnFailureOnly | Boolean | Control the behavior of error categorization generated on your tests |
errorCategorizedReport | Map, Boolean | Generate a RCA report for your failed tests. |
jobLabel | List of Strings | Add tags or labels to jobs. This allows you to search your jobs using the labels or tags assigned to them. |
Advanced Parameters
Artifacts
Key | Type | Description |
---|---|---|
mergeArtifacts | Boolean | Merge all the artifacts generated by each task. |
uploadArtefacts | Map | The uploadArtifacts key contains the path and the name of the file which you want to download later as an artifact when job finishes. |
captureCSVResult | Boolean | If this directive is enabled, it will generate the performance stats artifact having aggregated information for the time taken by Selenium Commands. |
skipArtifactStageIfNoTest | Boolean | When enabled, it will mark artifact stage as skipped when there is no selenium/cdp test executed in the task. |
linkValidity | Integer | Customize the duration of validity for report and artifact URLs generated after job completion. |
stripParentDirectory | Boolean | When mergeArtifacts is true, providing this flag will strip the parent directory from all the downloaded artifacts and place the artifacts in base path. |
generateArtifactAfterEveryStage | Boolean | With this flag artifacts will be generated after every stage , without this flag artifacts are generated after every task and avoid any overrides for artifacts of the same name. |
taskIdentifierInNonConflictingArtifacts | Boolean | This flag when set to true specifies that the task ID should be included in the non-conflicting artifacts. |
Timeout
Key | Type | Description |
---|---|---|
globalTimeout | Integer | It sets the max duration (1-150 mins) for a HyperExecute job. It terminates a job exceeding this limit. Default is 90 mins, but can be adjusted based on your requirements. |
testSuiteTimeout | Integer | It is used to set the timeout on all scenario stages inside a task. If defined, your complete test suite should get executed within this time. Its max value is 150 minutes. |
testSuiteStep | Integer | It is used to timeout individual scenario stages in a task. Each scenario in each task should get completed before this time. |
Tunnel
Key | Type | Description |
---|---|---|
tunnel | Boolean | If set to true , tunnel will be spawn on run time , which connects system where we are running the cli to VM where tests are getting executed. |
tunnelOpts | Map | All the configuration related to tunnel will be mention here. Please note tunnelOpts will work along with either tunnel or tunnelNames . |
tunnelNames | List of Strings | List of tunnels name which has been registered and running with HyperExecute. |
Other Advanced Parameters
Key | Type | Description |
---|---|---|
failFast | Map | Flag to fail a job faster if there are x consecutive failures. |
differentialUpload | Map | Minimize the time of upload of code. |
background | Map | It is used to trigger long-running Application Servers tasks like running WebApps or databases |
retryOptions | Array | Retries the test case if found specific errors in the logs. |
base | Map | Inherit the configurations of a base YAML file into your parent file. |
sourcePayload | Map | You can use this to define the source of your test scripts so that the scripts can directly be fetched from your git directly for execution on HyperExecute. |
hostsOverride | List of Maps | If you want to add custom domain mappings in local DNS entry. |
frameworkStatusOnly | Boolean | Set status of scenario based on it’s tests status / remarks. |
vars | Map | Here we define all the variable which can be refer in other parts of yaml. You can use these variables in the YAML file as ${your_variable_name} . |
testRunnerExecutor | String | To switch the test execution from powershell to the command line. |
workingDirectory | Path of Location | This flag determines where test discovery and execution commands operate, including the creation of associated files or directories. |
captureScreenRecordingForScenarios | bool | If this key is set to true, the video will be recorded for whole scenario execution |
buildConfig | Map | For managing the Hyperlink behaviour. |
matrixEnvPrefix | Boolean | This flag is used to prefix env variables with HE_ENV_ being set when you run a job in "matrix" mode. Default is false. |
dynamicAllocation | Boolean | This flag dynamically allocate test cases to workers as they become available and ensures that all available resources are used to run tests. |
collectLocalGitData | Boolean | This flag is used to store the git diff data related to the repository used to run HyperExecute Jobs. |
smartGrid | Boolean | When enabled, it will reduce the browser setup time in case of windows. |
scenarioCommandStatusOnly | Boolean | When enabled, it will mark the scenario as passed even if no test is associated with it or will mark the status of scenario based on the status of the last test executed. |
cypress | Boolean | This is required to be true in case user is running Cypress test suite. |
cypressOps | Map | This map is used to pass cypress specific options. |
shell | String | Defines the shell on which all your commands should run. |
dataJsonPath | Array of String | DataJsonPaths helps to distribute data over VMs based on different Jsons. |
dataJsonBuilder | Array of String | dataJsonBuilder flag reads the data from your specified JSON files for distributed testing scenarios. |
strict | Boolean | If strict is set to true in yaml then the variables used in yaml must be present in either vars or environment variables on the user machine. |
codeDirectory | String | Defines in which directory all of your commands defined in yaml would run. Your code would be downloaded in this directory. |
preDirectives | Map | Similar to pre with option to retry and specify shell. |
postDirectives | Map | Similar to post with option to retry. |
alwaysRunPostSteps | Boolean | Execute the Post Steps in every scenario case |
cacheTestURL | Boolean | It enables users to cache static test files. |
afterAll | Map | It is used to run commands after the job has finished. |
projectName | String | Segregate data at a project/repo level |
Generating a HyperExecute YAML
You can also generate the HyperExecute YAML directly from the HyperExecute Portal. To accomplish this, follow the below mentioned steps:
Step 1: Go to HyperExecute dashboard, click on the Help Center and select Generate YAML from the dropdown.
Step 2: Select your preferred test automation framework.
Step 3 You will be redirected to the configuring section, where you can configure the HyperExecute YAML parameters. Click on Generate YAML button.
Step 4: Once done, you can download the YAML file using the small icon on top. Alternatively, you can copy the contents of the file and modify them further according to your needs on your favorite IDE.
HyperExecute supports multiple languages and testing frameworks. See the comprehensive list & samples here.
Sample HyperExecute YAML
A sample HyperExecute YAML file looks like this:
---
version: 0.1
runson: win
autosplit: true
retryOnFailure: true
maxRetries: 2
concurrency: 1
env:
CACHE_DIR: m2_cache_dir
TARGET_OS: Windows 10
# Dependency caching for Windows
cacheKey: '{{ checksum "pom.xml" }}'
cacheDirectories:
- ${CACHE_DIR}
# shell: bash
pre:
# Create the Cache directory
- mkdir -p m2_cache_dir
# Download and install packages in the CACHE_DIR.
# Skip execution of the tests in the pre step
- mvn -Dmaven.repo.local=${CACHE_DIR} -Dmaven.test.skip=true clean install
testDiscovery:
type: raw
mode: dynamic
command: grep 'public class' src/test/java/hyperexecute/*.java | awk '{print$3}'
testRunnerCommand: mvn `-Dplatname=win `-Dmaven.repo.local=m2_cache_dir `-Dtest=$test test site surefire-report:report