Skip to main content

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

KeyTypeDescription
versionStringThe version of HyperExecute YAML you are using.
runsonlinux, mac, or winThe OS on which you will run your Test. Can provide ${matrix.os} as well to run a multi OS job.
preList of StringsThe actions that are performed before test execution.

General Parameters

KeyTypeDescription
globalTimeoutIntegerIt 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.
runtimeMapInstall any dependent language/framework with any specific version.
jobLabelList of StringsAdd tags or labels to jobs. This allows you to search your jobs using the labels or tags assigned to them.
failFastMapFlag to fail a job faster if there are x consecutive failures.
baseMapInherit the configurations of a base YAML file into your parent file.
sourcePayloadMapYou 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.
hostsOverrideList of MapsIf you want to add custom domain mappings in local DNS entry.
envMapNo
frameworkStatusOnlyBooleanSet status of scenario based on it’s tests status / remarks.
testSuiteTimeoutIntegerIt 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.
testSuiteStepIntegerIt is used to timeout individual scenario stages in a task. Each scenario in each task should get completed before this time.
retryOnFailureBooleanIf set to true, then it will retry tests based on maxRetries key as defined below.
Default value is false.
maxRetriesIntegerThe maximum number of times your scenarios can be retried.
If retryOnFailure is true then Default value will be 2. Value Range 1 to 5.
retryOptionsArrayRetries the test case if found specific errors in the logs.
testDiscoveryMapThis key is used to locate or discover relevant tests via class names, filters, file names, etc.
preDirectivesMapSimilar to pre with option to retry and specify shell.
postList of StringsThe actions that are performed after test execution.
postDirectivesMapSimilar to post with option to retry.
alwaysRunPostStepsBooleanExecute the Post Steps in every scenario case
cachekeyStringFile which can be used to generate unique key for cache. Example : package.json
cacheDirectoriesList of StringsDependency directories that are cached to improve the test execution speed.
projectNameStringSegregate data at a project/repo level
reportBooleanTo 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
partialReportsMapConfigurations related to generate report.
errorCategorizedOnFailureOnlyBooleanControl the behavior of error categorization generated on your tests
mergeArtifactsBooleanMerge all the artifacts generated by each task.
uploadArtefactsMapThe uploadArtifacts key contains the path and the name of the file which you want to download later as an artifact when job finishes.
linkValidityIntegerCustomize the duration of validity for report and artifact URLs generated after job completion.
stripParentDirectoryBooleanWhen mergeArtifacts is true, providing this flag will strip the parent directory from all the downloaded artifacts and place the artifacts in base path.
generateArtifactAfterEveryStageBooleanWith 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.
taskIdentifierInNonConflictingArtifactsBooleanThis flag when set to true specifies that the task ID should be included in the non-conflicting artifacts.
smartGridBooleanWhen enabled, it will reduce the browser setup time in case of windows.
scenarioCommandStatusOnlyBooleanWhen 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.
skipArtifactStageIfNoTestBooleanWhen enabled, it will mark artifact stage as skipped when there is no selenium/cdp test executed in the task.
cypressBooleanThis is required to be true in case user is running Cypress test suite.
cypressOpsMapThis map is used to pass cypress specific options.
shellStringDefines the shell on which all your commands should run.
dataJsonPathArray of StringDataJsonPaths helps to distribute data over VMs based on different Jsons.
strictBooleanIf 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.
codeDirectoryStringDefines in which directory all of your commands defined in yaml would run. Your code would be downloaded in this directory.
cacheTestURLBooleanIt enables users to cache static test files.
afterAllMapIt is used to run commands after the job has finished.
captureScreenRecordingForScenariosboolIf this key is set to true, the video will be recorded for whole scenario execution
buildConfigMapFor managing the Hyperlink behaviour.
captureCSVResultBooleanIf this directive is enabled, it will generate the performance stats artifact having aggregated information for the time taken by Selenium Commands.
matrixEnvPrefixBooleanThis flag is used to prefix env variables with HE_ENV_ being set when you run a job in “matrix” mode. Default is false.
dynamicAllocationBooleanThis flag dynamically allocate test cases to workers as they become available and ensures that all available resources are used to run tests.
collectLocalGitDataBooleanThis flag is used to store the git diff data related to the repository used to run HyperExecute Jobs.
backgroundMapIt is used to trigger long-running Application Servers tasks like running WebApps or databases
varsMapHere 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}.
tunnelBooleanIf 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.
tunnelOptsMapAll the configuration related to tunnel will be mention here. Please note tunnelOpts will work along with either tunnel or tunnelNames.
tunnelNamesList of StringsList of tunnels name which has been registered and running with HyperExecute.
testRunnerExecutorStringTo switch the test execution from powershell to the command line.
workingDirectoryPath of LocationThis flag determines where test discovery and execution commands operate, including the creation of associated files or directories.

AutoSplit Mode Parameters

KeyTypeDescription
autosplitBooleanAutosplit 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.
concurrencyIntegerIndicates the number of concurrent sessions on HyperExecute.
testDiscoveryMapThis key is used to locate or discover relevant tests via class names, filters, file names, etc.
testRunnerCommandStringA command used to run a single test entity in isolation.This entity could be a file , module, feature or scenario.

Matrix Mode Parameters

KeyTypeDescription
matrixStringA matrix allows you to create multiple tasks by performing variable substitutions in a single job definition.
combineTasksInMatrixModeBooleanThis 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.
testSuitesStringA command to run the tests that were mentioned in the scenario key for matrix based test execution.

Hybrid Mode Parameters

KeyTypeDescription
parallelismIntegerParallelism 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
macParallelismIntegerIt defines number of mac VM to be spawned for job.
winParallelismIntegerIt defines number of win VM to be spawned for job.
linuxParallelismIntegerIt defines number of linux VM to be spawned for job.
testRunnerCommandStringA command used to run a single test entity in isolation.This entity could be a file , module, feature or scenario.
macTestRunnerCommandStringTest runner command for MAC.
winTestRunnerCommandStringTest runner command for Windows.
linuxTestRunnerCommandStringTest runner command for Linux.

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.

Image

Step 2: Select your preferred test automation framework.

Image

Step 3 You will be redirected to the configuring section, where you can configure the HyperExecute YAML parameters. Click on Generate YAML button.

Image

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.

Image

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
testSuiteTimeout: 65
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