Closed kazurayam closed 4 years ago
The key is the MaterialPairs
interface. It should implement MaterialMetadataBundle getActualMaterialMetadataBundle()
method.
package com.kazurayam.materials
interface MaterialPairs {
MaterialMetadataBundle getExpectedMaterialMetadataBundle()
MaterialMetadataBundle getActualMaterialMetadataBundle()
Materials-0.80.0 now creates a comparison-result-bundle.json file with MaterialDescription
in each ComparisonResult
node.
comparison-result-bundle.json.txt
{
"ComparisonResultBundle": [
{
"ComparisonResult": {
"expectedMaterial": {
"Material": {
"url": "null",
"suffix": "",
"fileType": {
"FileType": {
"extension": "png",
"mimeTypes": [
"image/png"
]
}
},
"path": "/Users/kazuakiurayama/katalon-workspace/VisualTestingInKatalonStudio/Materials/CURA.chronos_capture/CURA_DevelopmentEnv/20200731_073605/CURA.visitSite/screenshots/appointment.php%23summary.png",
"hrefRelativeToRepositoryRoot": "CURA.chronos_capture/CURA_DevelopmentEnv/20200731_073605/CURA.visitSite/screenshots/appointment.php%23summary.png",
"lastModified": "2020-07-30T22:37:07",
"description": "20200731_073605"
}
},
"actualMaterial": {
"Material": {
"url": "null",
"suffix": "",
"fileType": {
"FileType": {
"extension": "png",
"mimeTypes": [
"image/png"
]
}
},
"path": "/Users/kazuakiurayama/katalon-workspace/VisualTestingInKatalonStudio/Materials/CURA.chronos_capture/CURA_DevelopmentEnv/20200731_074106/CURA.visitSite/screenshots/appointment.php%23summary.png",
"hrefRelativeToRepositoryRoot": "CURA.chronos_capture/CURA_DevelopmentEnv/20200731_074106/CURA.visitSite/screenshots/appointment.php%23summary.png",
"lastModified": "2020-07-30T22:42:14",
"description": "20200731_074106"
}
},
"diffMaterial": {
"Material": {
"path": "/Users/kazuakiurayama/katalon-workspace/VisualTestingInKatalonStudio/Materials/CURA.chronos_exam/CURA_DevelopmentEnv/20200731_074107/CURA.ImageDiff_chronos/CURA.visitSite/screenshots/appointment.php%23summary(0.00).png",
"hrefRelativeToRepositoryRoot": "CURA.chronos_exam/CURA_DevelopmentEnv/20200731_074107/CURA.ImageDiff_chronos/CURA.visitSite/screenshots/appointment.php%23summary(0.00).png"
}
},
"criteriaPercentage": 1.43,
"imagesAreSimilar": true,
"diffRatio": 0.0,
"MaterialDescription": {
"category": "1",
"description": "Appointment Confirmation page"
}
}
},
tagged 0.80.0 and will release it.
I checked how much work will be involved to change the Materials/index.html
to display MaterialDescription
. I found it would require more work than I expected. The com.kazurayam.materials.view.IndexerBase
program is not aware of the comparison-result-bundle.json
file at all. And it seems that it is difficult to change IndexerBase. The IndexerBase scans the directory tree as is without know which file is what.
Still I can improve the com.kazurayam.visualtesting.ImageDiffsLister so that it emits reports with MaterialDescription information of each URL. The reports include:
Materials/misc/imageDiffsList.csv
Materials/misc/imageDiffsList.md
Materials/misc/imageDiffsList.ps1
derived from the issue of VisualTestingInKatalonStudio : https://github.com/kazurayam/VisualTestingInKatalonStudio/issues/31
What is given
in a Test Case which visits a URL and saves a screenshot with a MaterialDescription object as a parameter like this:
in https://github.com/kazurayam/VisualTestingInKatalonStudio/commit/6a7fc031548b9e44ca01e11ce790cb0834b9702e
then the information passed as a MaterialDescription is stored in the
Materials/CURA.chronos_capture/<TExecutionProfile>/<TSuiteTimestamp>/<TCaseName>/material-metadata-bundle.json
file likeWhat I need to do
In
Materials/URA.chronos_exam/<TExecutionProfile>/<TSuiteTimestamp>/<TCaseName>/comparison-result-bundle.json
file, I want to add MaterialDescription inserted into ComparisonResult node:then I can add reporting programs to refer to the "MaterialDescription" in the comparison-result-bundle.json.
What is difficult?
In the Materials-0.79.1, the following 2 files are NOT internally linked at all.
Materials/CURA.chronos_capture/<TExecutionProfile>/<TSuiteTimestamp>/CURA.visitSite/material-metadata-bundle.json
Materials/URA.chronos_exam/<TExecutionProfile>/<TSuiteTimestamp>/CURA.ImageDiff_chronos/comparison-result-bundle.json
But I need to find out how to.