MaterialRepository#resolveMaterial() method resolves Path to save your 'Material' obtained during a run of WebDriver-based testing. 'Material' includes for example - PNG files as screenshots of a Web page - PDF files downloaded from a Web page - JSON files responded by Rest API - XML files responded by SOAP server The file name of a Material is defined as:
<encoded URL>§<suffix>.<file extension>for example
http%3A%2F%2Fdemoaut.katalon.com%2F§atoz.png
| Type Params | Return Type | Name and description |
|---|---|---|
|
int |
clear(java.util.List<TSuiteResultId> tSuiteResultIdList)delete all descendant directories and files belonging to the tSuiteName + tSuiteTimestamp directory. |
|
int |
clear(TSuiteName tSuiteName)delete all descendant directories and files beloging to the tSuiteName directory. |
|
int |
clear(TSuiteResultId tSuiteResultId, boolean scan)delete all descendant directories and files belonging to the tSuiteName + tSuiteTimestamp directory. |
|
int |
clearRest(TSuiteResultId tSuiteResultId, boolean scan)identify all TSuiteResultId contained in the MaterialRespository, and delete those except the specfied one. |
|
MaterialPairs |
createMaterialPairsForChronosMode(TSuiteName capturingTSuiteName, TExecutionProfile capturingTExecutionProfile)Scans the Materials directory to look up pairs of Material objects to compare for the Chronos mode |
|
MaterialPairs |
createMaterialPairsForTwinsMode(TSuiteName capturingTSuiteName)Scans the Materials directory to look up pairs of Material objects to compare for the Twins mode. |
|
void |
deleteBaseDirContents()delete all descendant directories and files of the base directory. |
|
TSuiteResult |
ensureTSuiteResultPresent(java.lang.String testSuiteName, java.lang.String executionProfile, java.lang.String testSuiteTimestamp) |
|
TSuiteResult |
ensureTSuiteResultPresent(TSuiteName tSuiteName, TExecutionProfile tExecutionProfile, TSuiteTimestamp tSuiteTimestamp) |
|
TSuiteResult |
ensureTSuiteResultPresent(TSuiteResultId tSuiteResultId) |
|
MaterialMetadataBundle |
findMaterialMetadataBundleOfCurrentTSuite() |
|
java.nio.file.Path |
getBaseDir() |
|
java.lang.String |
getCurrentExecutionProfile() |
|
TSuiteResult |
getCurrentTSuiteResult() |
|
java.nio.file.Path |
getCurrentTestSuiteDirectory() |
|
java.lang.String |
getCurrentTestSuiteId() |
|
java.lang.String |
getCurrentTestSuiteTimestamp() |
|
RepositoryRoot |
getRepositoryRoot() |
|
java.util.Set<java.nio.file.Path> |
getSetOfMaterialPathRelativeToTSuiteTimestamp(TSuiteName tSuiteName, TExecutionProfile tExecutionProfile) |
|
long |
getSize() |
|
TCaseResult |
getTCaseResult(TSuiteName tSuiteName, TExecutionProfile tExecutionProfile, TSuiteTimestamp tSuiteTimestamp, TCaseName tCaseName)
|
|
java.util.List<TSuiteName> |
getTSuiteNameList() |
|
TSuiteResult |
getTSuiteResult(TSuiteResultId tSuiteResultId) |
|
java.util.List<TSuiteResultId> |
getTSuiteResultIdList(TSuiteName tSuiteName, TExecutionProfile tExecutionProfile) |
|
java.util.List<TSuiteResultId> |
getTSuiteResultIdList() |
|
java.util.List<TSuiteResult> |
getTSuiteResultList(java.util.List<TSuiteResultId> tSuiteResultIdList) |
|
java.util.List<TSuiteResult> |
getTSuiteResultList() |
|
java.nio.file.Path |
getTestCaseDirectory(java.lang.String testCaseId) |
|
boolean |
hasMaterialMetadataBundleOfCurrentTSuite() |
|
boolean |
isAlreadyMarked() |
|
java.nio.file.Path |
locateMaterialMetadataBundle(TSuiteResultId tSuiteResultId)@param tSuiteResult |
|
java.nio.file.Path |
locateMaterialMetadataBundle(TSuiteResult tSuiteResult) |
|
java.nio.file.Path |
makeIndex()Scan the [project dir]/Materialsdirectory to create [project dir]/Materials/index.htmlfile. |
|
void |
markAsCurrent(java.lang.String testSuiteId, java.lang.String executionProfile, java.lang.String testSuiteTimestamp) |
|
void |
markAsCurrent(TSuiteName tSuiteName, TExecutionProfile tExecutionProfile, TSuiteTimestamp tSuiteTimestamp) |
|
void |
markAsCurrent(TSuiteResultId tSuiteResultId) |
|
boolean |
printVisitedURLsAsMarkdown(java.io.Writer writer) |
|
boolean |
printVisitedURLsAsTSV(java.io.Writer writer) |
|
java.nio.file.Path |
resolveMaterialPath(java.lang.String testCaseId, java.lang.String fileName, MaterialDescription description)Returns a Path of a Material file. |
|
java.nio.file.Path |
resolveMaterialPath(java.lang.String testCaseId, java.lang.String subPath, java.lang.String fileName, MaterialDescription description) |
|
java.nio.file.Path |
resolveMaterialPath(TCaseName testCaseName, java.lang.String fileName, MaterialDescription description) |
|
java.nio.file.Path |
resolveMaterialPath(TCaseName testCaseName, java.lang.String subPath, java.lang.String fileName, MaterialDescription description) |
|
java.nio.file.Path |
resolveMaterialPathByURLPathComponents(java.lang.String testCaseId, java.net.URL url, int startingDepth, java.lang.String defaultName, FileType fileType, MaterialDescription description)@param testCaseId |
|
java.nio.file.Path |
resolveMaterialPathByURLPathComponents(java.lang.String testCaseId, java.lang.String subPath, java.net.URL url, int startingDepth, java.lang.String defaultName, FileType fileType, MaterialDescription description) |
|
java.nio.file.Path |
resolveMaterialPathByURLPathComponents(TCaseName testCaseName, java.net.URL url, int startingDepth, java.lang.String defaultName, FileType fileType, MaterialDescription description) |
|
java.nio.file.Path |
resolveMaterialPathByURLPathComponents(TCaseName testCaseName, java.lang.String subPath, java.net.URL url, int startingDepth, java.lang.String DefaultName, FileType fileType, MaterialDescription description) |
|
java.nio.file.Path |
resolveScreenshotPath(java.lang.String testCaseId, java.net.URL url, MaterialDescription description)Returns a Path of a Material file. |
|
java.nio.file.Path |
resolveScreenshotPath(java.lang.String testCaseId, java.lang.String subPath, java.net.URL url, MaterialDescription description) |
|
java.nio.file.Path |
resolveScreenshotPath(TCaseName tCaseName, java.net.URL url, MaterialDescription description) |
|
java.nio.file.Path |
resolveScreenshotPath(TCaseName tCaseName, java.lang.String subPath, java.net.URL url, MaterialDescription description) |
|
java.nio.file.Path |
resolveScreenshotPathByURLPathComponents(java.lang.String testCaseId, java.net.URL url, int startingDepth, java.lang.String defaultName, MaterialDescription description)Returns a Path of a Material file. |
|
java.nio.file.Path |
resolveScreenshotPathByURLPathComponents(java.lang.String testCaseId, java.lang.String subPath, java.net.URL url, int startingDepth, java.lang.String defaultName, MaterialDescription description) |
|
java.nio.file.Path |
resolveScreenshotPathByURLPathComponents(TCaseName tCaseName, java.net.URL url, int startingDepth, java.lang.String defaultName, MaterialDescription description) |
|
java.nio.file.Path |
resolveScreenshotPathByURLPathComponents(TCaseName tCaseName, java.lang.String subPath, java.net.URL url, int startingDepth, java.lang.String defaultName, MaterialDescription description) |
|
void |
scan()scan the baseDir to recognize the current directories/files configuration |
|
java.lang.String |
toJsonText() |
| Methods inherited from class | Name |
|---|---|
interface TSuiteResultTree |
addTSuiteResult, getTSuiteNameList, getTSuiteResult, getTSuiteResult, getTSuiteResultIdList, getTSuiteResultIdList, getTSuiteResultList, getTSuiteResultList, getTSuiteResultList, getTSuiteResultList, hasTSuiteResult |
interface VTLoggerEnabled |
setVisualTestingLogger |
delete all descendant directories and files belonging to the tSuiteName + tSuiteTimestamp directory. will remove the tSuiteTimestamp directory, but will retain the tSuiteName directory.
delete all descendant directories and files beloging to the tSuiteName directory. will remove the tSuiteTimestamp directory.
delete all descendant directories and files belonging to the tSuiteName + tSuiteTimestamp directory. will remove the tSuiteTimestamp directory, but will retain the tSuiteName directory.
to - perform scan() or notidentify all TSuiteResultId contained in the MaterialRespository, and delete those except the specfied one. For example, you can identify the TSuiteResultId which is marked as current, and delete the rest except the current one by this:
MaterialRepository mr = ... TSuiteResultId currentTSuiteResultId = mr.getCurrentTSuiteResult().getId() mr.clearRest(currentTSuiteResultId, true)
Scans the Materials directory to look up pairs of Material objects to compare
for the Chronos mode
This method perform the following search under the Materials directory
in order to identify which Material object to be included.
1. selects all ./Materials/
Scans the Materials directory to look up pairs of Material objects to compare
for the Twins mode.
This method perform the following search under the Materials directory
in order to identify which Material object to be included.
1. selects all ./Materials/
delete all descendant directories and files of the base directory. The base directory is retained.
Scan the
[project dir]/Materialsdirectory to create
[project dir]/Materials/index.htmlfile. The makeIndex() method was once removed from the MaterialRepository interface at the Materials-0.71.0.jar. See the diff at https://github.com/kazurayam/Materials/commit/4e42834b4889949b93a4282c4a6e2d94f56795a6#diff-c7b1f72fa3889f9e5ae3ae79ec4d95f5 But makeIndex() was added back at the Materials-0.71.4 in order to restore backward compatibility. See the related issue at https://forum.katalon.com/t/logging-http-response-headers-and-bodies-of-web-service-materials-applied/13803/13
Returns a Path of a Material file. Example:
MaterialRepository mr = MaterialRepositoryFactory.createInstance(Path.get('./Materials'))
mr.putCurrentTestSuite('Test Suites/main/TS1', '20180530_130419')
Path path = mr_.resolveMaterialPath('Test Cases/main/TC1', 'screenshot1.png')
assert path.toString().endsWith('Materials/main.TS1/20180530_130419/main.TC1/screenshot1.png')
Returns a Path of a Material file. Examples:
MaterialRepository mr = MaterialRepositoryFactory.createInstance(Path.get('./Materials'))
mr.putCurrentTestSuite('Test Suites/main/TS1', '20180530_130419')
Path path = mr.resolveScreenshotPath(
'Test Cases/main/TC1',
new URL('https://katalon-demo-cura.herokuapp.com/'))
assert path.toString() == 'Materials/main.TS1/20180530_130419/main.TC1/http%3A%2F%2Fdemoaut.katalon.com%2F.png'
Returns a Path of a Material file. Examples:
MaterialRepository mr = MaterialRepositoryFactory.createInstance(Path.get('./Materials'))
mr.putCurrentTestSuite('Test Suites/main/TS1', '20180530_130419')
Path path = mr.resolveScreenshotPathByURLPathComponents(
'Test Cases/main/TC1',
new URL('https://katalon-demo-cura.herokuapp.com/'),
0,
'top')
assert path.toString().endsWith('Materials/main.TS1/20180530_130419/main.TC1/top.png')
MaterialRepository mr = MaterialRepositoryFactory.createInstance(Path.get('./Materials'))
mr.putCurrentTestSuite('Test Suites/main/TS1', '20180530_130419')
Path path = mr.resolveScreenshotPathByURLPathComponents(
'Test Cases/main/TC1',
new URL('https://katalon-demo-cura.herokuapp.com/aaa/appointment'),
1,
'top')
assert path.toString().endsWith('Materials/main.TS1/20180530_130419/main.TC1/appointment.png')
scan the baseDir to recognize the current directories/files configuration