diff --git a/.gitignore b/.gitignore index f962ae8..2d34988 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,10 @@ src/main/java/.DS_Store .classpath .project .settings/** +report.templ +*.iml +download**/* +Report/ + +images/ +viettel/ \ No newline at end of file diff --git a/Report/report.templ b/Report/report.templ deleted file mode 100644 index 0fc64d8..0000000 --- a/Report/report.templ +++ /dev/null @@ -1,340 +0,0 @@ - - - - Applitools batch(es) summary report $title - - - - - - - - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Batches#%
Passed$batches.batchesPassed$numberTool.format("#0.00", $batches.batchesPassedRate)
Failed$batches.batchesFailed$numberTool.format("#0.00", $batches.batchesFailedRate)
Unresolved$batches.batchesUnresolved$numberTool.format("#0.00", $batches.batchesUnresolvedRate)
Running$batches.batchesRunning$numberTool.format("#0.00", $batches.batchesRunningRate)
Total$batches.size()100
-
-
- -
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Tests#%
Passed$batches.testsPassed$numberTool.format("#0.00", $batches.testsPassedRate)
Failed$batches.testsFailed$numberTool.format("#0.00", $batches.testsFailedRate)
Unresolved$batches.testsUnresolved$numberTool.format("#0.00", $batches.testsUnresolvedRate)
Running$batches.testsRunning$numberTool.format("#0.00", $batches.testsRunningRate)
Total$batches.testsTotal-
-
-
-
-
-
-
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Steps#%
Matched$batches.StepsMatched$numberTool.format("#0.00", $batches.stepsMatchedRate)
Mismatched$batches.stepsMismatched$numberTool.format("#0.00", $batches.stepsMismatchedRate)
New$batches.stepsNew$numberTool.format("#0.00", $batches.stepsNewRate)
Missing$batches.stepsMissing$numberTool.format("#0.00", $batches.stepsMissingRate)
Total$batches.stepsTotal-
-
-
-
-
-
-
- - #macro( badge $status ) - #if ($status == "Unresolved") - badge-warning - #elseif ($status == "Passed") - badge-success - #elseif ($status == "Running") - badge-primary - #else - badge-danger - #end - #end - -
-
-

Batches details

- - - - - - - - - - - - - - #set($b = 1) - #foreach($batch in $batches) - - - - - - - - - - - - - - #set($b = $b + 1) - #end - -
#StatusNamePassedFailedUnresolvedTotal
$b $batch.Status $batch.name$batch.TestsPassed$batch.TestsFailed$batch.TestsUnresolved$batch.TotalTests
- - - - - - - - - - - - - - - #set($i = 1) - #foreach($test in $batch.tests) - - - - - - - - - - - #set($failedSteps = $test.getFailedSteps()) - #if ($failedSteps.size() > 0) - - - #end - #set($i = $i + 1) - #end - -
#StatusNameMatchMismatchNewMissingTotal
$i$test.getStatus() $test.scenarioName $test.MatchedCount$test.MismatchedCount$test.NewCount$test.MissingCount$test.TotalActualSteps
-
- #foreach($step in $failedSteps) - - #end -
-
-
-
-
-
-
- - \ No newline at end of file diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index 7ba1509..970732b 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -4,15 +4,15 @@ com.applitools.eyesutilities EyesUtilities eyes-utilities - 1.5.10-SNAPSHOT + 1.5.18 http://maven.apache.org - ../jars/${artifactId}_${version} + ../jars/${project.artifactId}_${project.version} org.owasp dependency-check-maven - 7.1.1 + 8.3.1 @@ -23,7 +23,7 @@ maven-shade-plugin - 3.2.4 + 3.5.0 package @@ -42,6 +42,7 @@ maven-jar-plugin + 3.3.0 @@ -57,7 +58,7 @@ junit junit - 4.12 + 4.13.2 test @@ -68,8 +69,8 @@ - 8 - 8 + 1.8 + 1.8 UTF-8 diff --git a/downloadArtifacts.sh b/downloadArtifacts.sh new file mode 100755 index 0000000..64cb6c1 --- /dev/null +++ b/downloadArtifacts.sh @@ -0,0 +1,80 @@ +#!/bin/bash + +set -e + +if [ $# -eq 0 ]; then + echo "No arguments provided. Usage:" + echo " ./downloadArtifacts.sh " + echo "example:" + echo " ./downloadArtifacts.sh [all|anidiffs|diffs|images|playback|report] myDownloadDir eyes.applitools.com" + exit 1 +fi + +downloadCommand=$1 +url=$2 +downloadPath=$3 +key=$4 +serverUrl=$5 + +if [[ -z $downloadCommand ]]; then + downloadCommand="all" + echo "downloadCommand not provided. Downloading $downloadCommand" +fi + +if [[ -z $key ]]; then + echo "Applitools View Key is not specified. Using the value set as env variable: 'APPLITOOLS_VIEW_KEY'" + if [[ -z $APPLITOOLS_VIEW_KEY ]]; then + echo "'APPLITOOLS_VIEW_KEY' is not set" + exit 1 + fi + key=$APPLITOOLS_VIEW_KEY +fi + +if [[ -z $downloadPath ]]; then + downloadPath="./downloadArtifacts/$(date "+%Y-%m-%d/%H-%M-%S")" + echo "downloadPath is NOT SET. Using default: '$downloadPath'" +else + downloadPath=$downloadPath/$(date "+%Y-%m-%d/%H-%M-%S") + echo "downloadPath: '$downloadPath'" +fi +mkdir -p $downloadPath + +if [[ -z $url ]]; then + echo "URL is not provided." + exit 1 +fi + +if [[ -z $serverUrl ]]; then + echo "APPLITOOLS_SERVER_URL is not provided. Use default: eyes.applitools.com" + serverUrl="eyes.applitools.com" +fi + +function download() { + echo "Downloading batch artifacts using command: '$1' from batch url: '$2' to: '$downloadPath/$1'" + echo "java -jar jars/EyesUtilities_1.6.1.jar $1 -as $serverUrl -k "APPLITOOLS_VIEW_KEY" -d '$downloadPath/$1/{test_id}-{test_name}/file:{step_index}{step_tag}{artifact_type}.{file_ext}' $url" + java -jar jars/EyesUtilities_1.6.1.jar $1 -as $serverUrl -k $key -d "$downloadPath/$1/{test_id}-{test_name}/file:{step_index}{step_tag}{artifact_type}.{file_ext}" $url +} + +function downloadReport() { + echo "Generating batch 'report' from batch url: '$2' to: '$downloadPath/$1'" + echo "java -jar jars/EyesUtilities_1.6.1.jar $1 -as $serverUrl -k "APPLITOOLS_VIEW_KEY" -d '$downloadPath/$1/report.html' $url" + mkdir -p $downloadPath/$1 + java -jar jars/EyesUtilities_1.6.1.jar report -as $serverUrl -k $key -d "$downloadPath/$1/report.html" -rt "customName" $url +} + +function run() { + echo "downloadArtifacts" + if [[ "$downloadCommand" = "all" ]]; then + download "anidiffs" $url + download "diffs" $url + download "images" $url + download "playback" $url + downloadReport "report" $url + elif [[ "$downloadCommand" = "report" ]]; then + downloadReport "report" $url + else + download "$downloadCommand" $url + fi +} + +run diff --git a/jars/EyesUtilities_1.6.1.jar b/jars/EyesUtilities_1.6.1.jar new file mode 100644 index 0000000..4034636 Binary files /dev/null and b/jars/EyesUtilities_1.6.1.jar differ diff --git a/pom.xml b/pom.xml index 9208bdd..7ff33a6 100644 --- a/pom.xml +++ b/pom.xml @@ -24,16 +24,16 @@ test - org.apache.httpcomponents httpclient - 4.5.13 + 4.5.14 - + org.apache.maven.plugins maven-shade-plugin - 3.4.1 + 3.5.0 org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0