Eyes utilities is a Java CLI tool provides extended API features for Applitools Eyes.
This tool based on the assumption that you already have tests with Applitools and you want to gather more information about your test results via the API.
Note: For this tool there is a need in specialty enterprise API key. To get your keys please contact our support.
# The general syntax is derived from the fact that the EyesUtilities tool is built in Java.
Supported Modes:
Generate steps animation:
Generate a set of animated gifs for each failing step.
The animation will iterate between three states:
1. The baseline image
2. The current image
3. The actual image with diff marks
# After the execution , the results will saved in the default location : {workdir_root}/Artifacts/{batch_id}/{test_id}/
Syntax: java -jar EyesUtilities.jar anidiffs -k [EntKey] <[optional params]> [ResultUrl]
# Required parameters:
* -k [EntKey] - Your Enterprise API view key.
* [ResultUrl]- Applitools test result Url to be analyzed.
# Optional parameters:
* -i [mSecs] - Transition interval between the image in milliseconds ( default: 1000).
* -d [pathTmpl]- Specify destination path template.
(default: {workdir_root}/Artifacts/{batch_id}/{test_id}/file:{step_index}{step_tag}{artifact_type}.{file_ext})
# Available path template parameters: user_root, workdir_root, batch_id, test_name, batch_name, app_name, os, hostapp, viewport, branch_name, step_tag, artifact_type, file_ext
Generate test playback:
Generate one unified animated gif with all the current steps of a test.
Syntax: java -jar EyesUtilities.jar playback -k [EntKey] <[optional params]> [ResultUrl]
# Required parameters:
* -k [EntKey] - Your Enterprise API view key.
* [ResultUrl]- Applitools test result Url to be analyzed.
# Optional parameters:
* -i [mSecs] - Transition interval between the image in milliseconds ( default: 1000).
* -d [pathTmpl]- Specify destination path template.
(default: {workdir_root}/Artifacts/{batch_id}/{test_id}/file:{step_index}{step_tag}{artifact_type}.{file_ext})
# Available path template parameters: user_root, workdir_root, batch_id, test_name, batch_name, app_name, os, hostapp, viewport, branch_name, step_tag, artifact_type, file_ext
* -m- A flag, Sets 'on' diff marks if a step is different from it's expected baseline.
Download test diffs:
Downloads the images of the failed steps with diff marks on them.
Syntax: java -jar EyesUtilities.jar diffs -k [EntKey] <[optional params]> [ResultUrl]
# Required parameters:
* -k [EntKey] - Your Enterprise API view key.
* [ResultUrl]- Applitools test result Url to be analyzed.
# Optional parameters:
* -i [mSecs] - Transition interval between the image in milliseconds ( default: 1000).
* -d [pathTmpl]- Specify destination path template.
(default: {workdir_root}/Artifacts/{batch_id}/{test_id}/file:{step_index}{step_tag}{artifact_type}.{file_ext})
# Available path template parameters: user_root, workdir_root, batch_id, test_name, batch_name, app_name, os, hostapp, viewport, branch_name, step_tag, artifact_type, file_ext
Download test images:
Downloads the baseline image and the current image of a test.
Syntax: java -jar EyesUtilities.jar images -k [EntKey] <[optional params]> [ResultUrl]
# Required parameters:
* -k [EntKey] - Your Enterprise API view key.
* [ResultUrl]- Applitools test result Url to be analyzed.
# Optional parameters:
* -a - Flag to download only the current image.
* -b - Flag to download only the baseline image.
* -d [pathTmpl]- Specify destination path template.
(default: {workdir_root}/Artifacts/{batch_id}/{test_id}/file:{step_index}{step_tag}{artifact_type}.{file_ext})
# Available path template parameters: user_root, workdir_root, batch_id, test_name, batch_name, app_name, os, hostapp, viewport, branch_name, step_tag, artifact_type, file_ext
Copy branch:
This command performs branch merging using copy with special flags.
Syntax: java -jar EyesUtilities.jar copybranch -k [BranchKey] -s [SourceBranch] -a [AppName]<[optional params]>
# Required parameters:
* -k [BranchKey] - Your Enterprise branch API key.
* -s [SourceBranch] - Source branch name.
* -a [AppName] - Application name in branch.
# Optional parameters:
* -t [TargetBranch] - Target branch for merge.
* -o - Force overwrite in case of conflict.
* -all - Copy all including unchanged steps.
* -d - Delete the source branch after successful copy.
Generating batch Report:
This command will generate an offline report of a provided Applitools results Url, based on a provided template. The default name and the location of the template is ./report.tmpl
Syntax: java -jar EyesUtilities.jar report -k [EntKey] <[optional params]> [ResultUrl]
# Required parameters:
* -k [EntKey] - Your Enterprise API view key.
* [ResultUrl]- Applitools test result Url to be analyzed.
# Optional parameters:
* -d [FolderPath] - Set custom report output destination. Default: ' . '
* -t [FilePath] - Set report template file. Default ./report.templ
##Template syntax: The engine lies beneath this report generation is based on Velocity framework which widely used in MVC frameworks to implement web-apps. The VTL (Velocity Template Language) syntax reference can be found here.
Here is the partial list of parameters that are exposed for usage in template construction:
# $batch- The project that contains all the tests and batch level data.
* $batch.name - The name of the batch.
* $batch.id - The id of the batch.
*$batch.startedAt - The started date of the batch.
*$batch.testsPassed - The count of passed tests.
*$batch.testsFailed - The count of failed tests.
*$batch.testsNew - The count of new tests that caused baseline creation.
*$batch.getStepsPassed() - The count of total passed steps.
*$batch.getStepsFailed() - The count of total failed steps.
*$batch.getStepNew() - The count of total new steps.
*$batch.getTotalBaselineSteps() - The count of total steps in the baselines.
*$batch.get PassedRate() - 100% based tests in batch pass rate.
* $batch.getFailedRate() - 100% based tests in batch fail rate.
* $batch.getNewRate() - 100% based tests in batch new rate.
* $batch.getStatus() - Calculated test status within Passed/Failed/Unresolved.
* $batch.getIsDefaultStatus() - Returns boolean status whether the appearing calculated status is the default one or was been overridden.
# foreach($test in $batch.tests) - While $batch.tests is list of contained tests objects
* $test.scenarioName - The test name.
* $test.getUrl() - The url of the test.
* $test.TotalActualSteps() - The count of the total steps that were captured in the test.
* $test.PassedCount() - The count of the passed steps in test.
* $test.FailedCount() - The count of the failed steps in test.
* $test.NewCount() - The count of the new steps in test.
* $test.MissingCount() - The count of the missing current images in test.
* #foreach($step in $test.getFailedSteps()) - While $test.getFailedSteps() is the list of contained failed steps objects.
- $step.getAnimatedThumbprints() - Downloads step animated thumbprint and returns file's relative path.
- $step.getExpectedImage() - Downloads step baseline (expected) image and returns file's relative path.
- $step.getActualImage() - Downloads step current image and returns file's relative path.
- $step.getDiff() - Downloads step diff image and returns file's relative path.
* #foreach($step in $test.getSteps() - While $test.getSteps() is the list of steps objects
- $step.getExpectedImage() - Downloads step baseline (expected) image and returns file's relative path.
- $step.getActualImage() - Downloads step current image and returns file's relative path.
A complete example of a template can be found in ./Report/report.templ.
This example generates html report but the same idea can be applied on any textual format.
Further regarding:
# Getting Diff Images Manually.
# Getting Current/Baseline Images Manually
# Accessing the API via TestResultHandler.
# You can find the EyesUtilities code in the following GitHub repository.