public class AllureLifecycle
extends java.lang.Object
| Constructor and Description |
|---|
AllureLifecycle()
Creates a new lifecycle with default results writer.
|
AllureLifecycle(AllureResultsWriter writer)
Creates a new lifecycle instance with specified
AllureResultsWriter. |
| Modifier and Type | Method and Description |
|---|---|
void |
addAttachment(java.lang.String name,
java.lang.String type,
java.lang.String fileExtension,
byte[] body)
Adds attachment into current test or step if any exists.
|
void |
addAttachment(java.lang.String name,
java.lang.String type,
java.lang.String fileExtension,
java.io.InputStream stream)
Adds attachment to current running test or step.
|
java.util.Optional<java.lang.String> |
getCurrentTestCase()
Returns uuid of current running test case if any.
|
java.util.Optional<java.lang.String> |
getCurrentTestCaseOrStep()
Returns uuid of current running test case or step if any.
|
java.lang.String |
prepareAttachment(java.lang.String name,
java.lang.String type,
java.lang.String fileExtension)
Adds attachment to current running test or step, and returns source.
|
void |
scheduleTestCase(java.lang.String containerUuid,
io.qameta.allure.model.TestResult result)
Schedules test case with given parent.
|
void |
scheduleTestCase(io.qameta.allure.model.TestResult result)
Schedule given test case.
|
boolean |
setCurrentTestCase(java.lang.String uuid)
Sets specified test case uuid as current.
|
void |
startPrepareFixture(java.lang.String containerUuid,
java.lang.String uuid,
io.qameta.allure.model.FixtureResult result)
Start a new prepare fixture with given parent.
|
void |
startStep(java.lang.String uuid,
io.qameta.allure.model.StepResult result)
Start a new step as child step of current running test case or step.
|
void |
startStep(java.lang.String parentUuid,
java.lang.String uuid,
io.qameta.allure.model.StepResult result)
Start a new step as child of specified parent.
|
void |
startTearDownFixture(java.lang.String containerUuid,
java.lang.String uuid,
io.qameta.allure.model.FixtureResult result)
Start a new tear down fixture with given parent.
|
void |
startTestCase(java.lang.String uuid)
Starts test case with given uuid.
|
void |
startTestContainer(java.lang.String containerUuid,
io.qameta.allure.model.TestResultContainer container)
Starts test container with specified parent container.
|
void |
startTestContainer(io.qameta.allure.model.TestResultContainer container)
Starts test container.
|
void |
stopFixture(java.lang.String uuid)
Stops fixture by given uuid.
|
void |
stopStep()
Stops current running step.
|
void |
stopStep(java.lang.String uuid)
Stops step by given uuid.
|
void |
stopTestCase(java.lang.String uuid)
Stops test case by given uuid.
|
void |
stopTestContainer(java.lang.String uuid)
Stops test container by given uuid.
|
void |
updateFixture(java.util.function.Consumer<io.qameta.allure.model.FixtureResult> update)
Updates current running fixture.
|
void |
updateFixture(java.lang.String uuid,
java.util.function.Consumer<io.qameta.allure.model.FixtureResult> update)
Updates fixture by given uuid.
|
void |
updateStep(java.util.function.Consumer<io.qameta.allure.model.StepResult> update)
Updates current step.
|
void |
updateStep(java.lang.String uuid,
java.util.function.Consumer<io.qameta.allure.model.StepResult> update)
Updates step by specified uuid.
|
void |
updateTestCase(java.util.function.Consumer<io.qameta.allure.model.TestResult> update)
Shortcut for
updateTestCase(String, Consumer) for current running test case uuid. |
void |
updateTestCase(java.lang.String uuid,
java.util.function.Consumer<io.qameta.allure.model.TestResult> update)
Updates test case by given uuid.
|
void |
updateTestContainer(java.lang.String uuid,
java.util.function.Consumer<io.qameta.allure.model.TestResultContainer> update)
Updates test container.
|
void |
writeAttachment(java.lang.String attachmentSource,
java.io.InputStream stream)
Writes attachment with specified source.
|
void |
writeTestCase(java.lang.String uuid)
Writes test case with given uuid using configured
AllureResultsWriter. |
void |
writeTestContainer(java.lang.String uuid)
Writes test container with given uuid.
|
public AllureLifecycle()
AllureLifecycle(AllureResultsWriter)public AllureLifecycle(AllureResultsWriter writer)
AllureResultsWriter.writer - the results writer.public void startTestContainer(java.lang.String containerUuid,
io.qameta.allure.model.TestResultContainer container)
containerUuid - the uuid of parent container.container - the container.public void startTestContainer(io.qameta.allure.model.TestResultContainer container)
container - the container.public void updateTestContainer(java.lang.String uuid,
java.util.function.Consumer<io.qameta.allure.model.TestResultContainer> update)
uuid - the uuid of container.update - the update function.public void stopTestContainer(java.lang.String uuid)
uuid - the uuid of container.public void writeTestContainer(java.lang.String uuid)
uuid - the uuid of container.public void startPrepareFixture(java.lang.String containerUuid,
java.lang.String uuid,
io.qameta.allure.model.FixtureResult result)
containerUuid - the uuid of parent container.uuid - the fixture uuid.result - the fixture.public void startTearDownFixture(java.lang.String containerUuid,
java.lang.String uuid,
io.qameta.allure.model.FixtureResult result)
containerUuid - the uuid of parent container.uuid - the fixture uuid.result - the fixture.public void updateFixture(java.util.function.Consumer<io.qameta.allure.model.FixtureResult> update)
updateFixture(String, Consumer).update - the update function.public void updateFixture(java.lang.String uuid,
java.util.function.Consumer<io.qameta.allure.model.FixtureResult> update)
uuid - the uuid of fixture.update - the update function.public void stopFixture(java.lang.String uuid)
uuid - the uuid of fixture.public java.util.Optional<java.lang.String> getCurrentTestCase()
public java.util.Optional<java.lang.String> getCurrentTestCaseOrStep()
public boolean setCurrentTestCase(java.lang.String uuid)
uuid - the uuid of test case.public void scheduleTestCase(java.lang.String containerUuid,
io.qameta.allure.model.TestResult result)
containerUuid - the uuid of container.result - the test case to schedule.public void scheduleTestCase(io.qameta.allure.model.TestResult result)
result - the test case to schedule.public void startTestCase(java.lang.String uuid)
uuid - the uuid of test case to start.public void updateTestCase(java.util.function.Consumer<io.qameta.allure.model.TestResult> update)
updateTestCase(String, Consumer) for current running test case uuid.update - the update function.public void updateTestCase(java.lang.String uuid,
java.util.function.Consumer<io.qameta.allure.model.TestResult> update)
uuid - the uuid of test case to update.update - the update function.public void stopTestCase(java.lang.String uuid)
Stage.FINISHED and also
stop timestamp is calculated. Result would be stored in memory until
writeTestCase(String) method is called. Also stopped test case could be
updated by updateTestCase(String, Consumer) method.uuid - the uuid of test case to stop.public void writeTestCase(java.lang.String uuid)
AllureResultsWriter.uuid - the uuid of test case to write.public void startStep(java.lang.String uuid,
io.qameta.allure.model.StepResult result)
startStep(String, String, StepResult).uuid - the uuid of step.result - the step.public void startStep(java.lang.String parentUuid,
java.lang.String uuid,
io.qameta.allure.model.StepResult result)
parentUuid - the uuid of parent test case or step.uuid - the uuid of step.result - the step.public void updateStep(java.util.function.Consumer<io.qameta.allure.model.StepResult> update)
updateStep(String, Consumer).update - the update function.public void updateStep(java.lang.String uuid,
java.util.function.Consumer<io.qameta.allure.model.StepResult> update)
uuid - the uuid of step.update - the update function.public void stopStep()
stopStep(String).public void stopStep(java.lang.String uuid)
uuid - the uuid of step to stop.public void addAttachment(java.lang.String name,
java.lang.String type,
java.lang.String fileExtension,
byte[] body)
addAttachment(String, String, String, InputStream)name - the name of attachmenttype - the content type of attachmentfileExtension - the attachment file extensionbody - attachment contentpublic void addAttachment(java.lang.String name,
java.lang.String type,
java.lang.String fileExtension,
java.io.InputStream stream)
name - the name of attachmenttype - the content type of attachmentfileExtension - the attachment file extensionstream - attachment contentpublic java.lang.String prepareAttachment(java.lang.String name,
java.lang.String type,
java.lang.String fileExtension)
writeAttachment(String, InputStream) method.name - the name of attachmenttype - the content type of attachmentfileExtension - the attachment file extensionpublic void writeAttachment(java.lang.String attachmentSource,
java.io.InputStream stream)
attachmentSource - the source of attachment.stream - the attachment content.