Package io.qameta.allure
Class FileSystemResultsWriter
java.lang.Object
io.qameta.allure.FileSystemResultsWriter
- All Implemented Interfaces:
AllureResultsWriter
Writes Allure result model objects and attachments to the file system.
Create a writer with an output directory and pass it to an AllureLifecycle when results should be persisted as standard Allure files. The writer creates directories as needed and names files consistently with the Allure format.
-
Constructor Summary
ConstructorsConstructorDescriptionFileSystemResultsWriter(Path outputDirectory) Creates a file system results writer with the supplied values.FileSystemResultsWriter(Path outputDirectory, boolean cleanBeforeRun, boolean cleanOnlyOnce) Creates a file system results writer with the supplied values. -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringGenerates and returns the test result container name.protected static StringGenerates and returns the test result container name.protected static StringGenerates and returns the test result name.protected static StringgenerateTestResultName(String uuid) Generates and returns the test result name.voidwrite(io.qameta.allure.model.TestResult testResult) Writes Allure test result bean.voidwrite(io.qameta.allure.model.TestResultContainer testResultContainer) Writes Allure test result container bean.voidwrite(String source, InputStream attachment) Writes given attachment.
-
Constructor Details
-
FileSystemResultsWriter
Creates a file system results writer with the supplied values.- Parameters:
outputDirectory- the output directory
-
FileSystemResultsWriter
Creates a file system results writer with the supplied values.- Parameters:
outputDirectory- the output directorycleanBeforeRun- the clean before runcleanOnlyOnce- the clean only once
-
-
Method Details
-
write
public void write(io.qameta.allure.model.TestResult testResult) Writes Allure test result bean.- Specified by:
writein interfaceAllureResultsWriter- Parameters:
testResult- the given bean to write.
-
write
public void write(io.qameta.allure.model.TestResultContainer testResultContainer) Writes Allure test result container bean.- Specified by:
writein interfaceAllureResultsWriter- Parameters:
testResultContainer- the given bean to write.
-
write
Writes given attachment. Will close the given stream.- Specified by:
writein interfaceAllureResultsWriter- Parameters:
source- the file name of the attachment. Make sure that file name matches the following glob:*-attachment*
. The right way to generate attachment is generate UUID, determinate attachment extension and then use it as{UUID}-attachment.{ext}attachment- the steam that contains attachment body.
-
generateTestResultName
Generates and returns the test result name.- Returns:
- the generated test result name
-
generateTestResultName
Generates and returns the test result name.- Parameters:
uuid- the Allure UUID of the model object- Returns:
- the generated test result name
-
generateTestResultContainerName
Generates and returns the test result container name.- Returns:
- the generated test result container name
-
generateTestResultContainerName
Generates and returns the test result container name.- Parameters:
uuid- the Allure UUID of the model object- Returns:
- the generated test result container name
-