public abstract class ReportPortalStoryReporter
extends org.jbehave.core.reporters.NullStoryReporter
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ReportPortalStoryReporter.Entity<T> |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CODE_REF |
static java.lang.String |
FINISH_REQUEST |
static java.lang.String |
PARAMETERS |
static java.lang.String |
PARENT |
static java.lang.String |
START_REQUEST |
static java.lang.String |
START_TIME |
| Constructor and Description |
|---|
ReportPortalStoryReporter(java.util.function.Supplier<com.epam.reportportal.service.Launch> launchSupplier,
com.epam.reportportal.service.tree.TestItemTree testItemTree) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterExamples()
Finishes the last examples item
|
void |
afterScenario(org.jbehave.core.steps.Timing timing)
Finishes scenario in ReportPortal
|
void |
afterStory(boolean givenStory)
Finishes story in ReportPortal
|
void |
beforeExamples(java.util.List<java.lang.String> steps,
org.jbehave.core.model.ExamplesTable table) |
void |
beforeScenario(org.jbehave.core.model.Scenario scenario)
Starts scenario in ReportPortal (test level)
|
void |
beforeStep(org.jbehave.core.model.Step step)
Starts step in ReportPortal (TestStep level)
|
void |
beforeStory(org.jbehave.core.model.Story story,
boolean givenStory)
Starts story (test suite level) in ReportPortal
|
protected com.epam.ta.reportportal.ws.model.FinishTestItemRQ |
buildFinishTestItemRequest(io.reactivex.Maybe<java.lang.String> id,
com.epam.reportportal.listeners.ItemStatus status,
com.epam.ta.reportportal.ws.model.issue.Issue issue)
Build finish test item request object
|
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ |
buildLifecycleMethodStartRq(com.epam.reportportal.listeners.ItemType type,
java.lang.String name,
java.lang.String codeRef,
java.util.Date startTime)
Extension point to customize lifecycle method (before/after) creation event/request
|
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ |
buildLifecycleSuiteStartRq(java.lang.String name,
java.lang.String codeRef,
java.util.Date startTime)
Extension point to customize lifecycle suite (before/after) creation event/request
|
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ |
buildStartExampleRq(org.jbehave.core.model.Scenario scenario,
java.util.Map<java.lang.String,java.lang.String> example,
java.lang.String codeRef,
java.util.Date startTime)
Extension point to customize test creation event/request
|
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ |
buildStartScenarioRq(org.jbehave.core.model.Scenario scenario,
java.lang.String codeRef,
java.util.Date startTime)
Extension point to customize test creation event/request
|
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ |
buildStartStepRq(java.lang.String step,
java.lang.String codeRef,
java.util.Map<java.lang.String,java.lang.String> params,
java.util.Date startTime)
Extension point to customize test creation event/request
|
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ |
buildStartStoryRq(org.jbehave.core.model.Story story,
java.lang.String codeRef,
java.util.Date startTime)
Extension point to customize test creation event/request
|
protected void |
createIgnoredSteps(java.lang.String step,
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf leaf)
Extension point to customize ignored steps insides
|
protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf |
createLeaf(com.epam.reportportal.listeners.ItemType type,
com.epam.ta.reportportal.ws.model.StartTestItemRQ rq,
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf parent)
Creates and starts a test item leaf
|
protected void |
createNotPerformedSteps(java.lang.String step,
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf leaf)
Extension point to customize a not performed step insides
|
protected void |
createPendingSteps(java.lang.String step,
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf leaf)
Extension point to customize pending steps insides
|
protected void |
evaluateAndFinishLastItem()
Pulls the last item in the structure stack, evaluates it status by child element statuses and finish it
|
protected com.epam.reportportal.listeners.ItemStatus |
evaluateStatus(com.epam.reportportal.listeners.ItemStatus currentStatus,
com.epam.reportportal.listeners.ItemStatus childStatus)
Calculate an Item status according to its child item status and current status.
|
void |
example(java.util.Map<java.lang.String,java.lang.String> tableRow,
int exampleIndex) |
void |
failed(java.lang.String step,
java.lang.Throwable cause)
Finishes a test step with a failed status
|
protected void |
finishItem(io.reactivex.Maybe<java.lang.String> id,
com.epam.reportportal.listeners.ItemStatus status,
com.epam.ta.reportportal.ws.model.issue.Issue issue)
Finishes a test item on Report Portal
|
protected void |
finishItem(com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf item,
com.epam.reportportal.listeners.ItemStatus status)
Finishes an item in the structure
|
protected void |
finishLastItem(com.epam.reportportal.listeners.ItemStatus status)
Finishes the last item in the structure
|
protected java.lang.String |
formatExampleStep(java.lang.String step,
java.util.Map<java.lang.String,java.lang.String> example)
Formats an Example test name
|
protected java.util.Set<com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ> |
getAttributes(org.jbehave.core.model.Meta meta)
Converts a JBehave
Meta object into a Set of ItemAttributesRQ ready to use in a request to Report Portal |
protected java.util.Set<com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ> |
getAttributes(org.jbehave.core.model.Scenario scenario)
Retrieves scenario metas and converts it into a
Set of ItemAttributesRQ ready to use in a request to Report Portal |
protected java.util.Set<com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ> |
getAttributes(org.jbehave.core.model.Story story)
Retrieves story metas and converts it into a
Set of ItemAttributesRQ ready to use in a request to Report Portal |
protected java.util.Date |
getItemDate(com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf parent)
Retrieves a test item date from bypassed tree leaf and compares it with the current date.
|
java.util.Optional<com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf> |
getLastStep()
Returns an item leaf of the last step reported with a reporter instance
|
protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf |
getLeaf()
Returns current test item leaf in Test Tree.
|
protected java.util.function.Function<java.lang.String,com.epam.ta.reportportal.ws.model.log.SaveLogRQ> |
getLogSupplier(com.epam.reportportal.listeners.LogLevel level,
java.lang.String message)
Prepare a function which creates a
SaveLogRQ from a Throwable |
protected java.lang.String |
getScenarioName(org.jbehave.core.model.Scenario scenario)
Extension point to customize scenario naming.
|
protected java.util.List<com.epam.ta.reportportal.ws.model.ParameterResource> |
getStepParameters(java.util.Map<java.lang.String,java.lang.String> params)
Converts parameters map into Report Portal's
ParameterResource list ready to use in a request to Report Portal |
protected java.lang.String |
getStoryName(org.jbehave.core.model.Story story)
Extension point to customize story naming.
|
protected com.epam.reportportal.service.item.TestCaseIdEntry |
getTestCaseId(java.lang.String codeRef,
java.util.List<java.lang.String> params)
Creates a
TestCaseIdEntry by code reference and parameter map. |
protected java.util.List<java.lang.String> |
getUsedParameters(java.lang.String step)
Return parameter names used in bypassed step
|
void |
ignorable(java.lang.String step)
Report ignored step
|
void |
notPerformed(java.lang.String step)
Report a not performed step
|
void |
pending(org.jbehave.core.steps.StepCreator.PendingStep step) |
protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf |
retrieveLeaf()
Returns current test item leaf in Test Tree.
|
void |
scenarioExcluded(org.jbehave.core.model.Scenario scenario,
java.lang.String filter) |
protected void |
sendStackTraceToRP(io.reactivex.Maybe<java.lang.String> itemId,
java.lang.Throwable thrown)
Send a message to report portal about appeared failure
|
protected void |
simulateStep(java.lang.String step) |
protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf |
startLifecycleMethod(java.lang.String name,
com.epam.reportportal.listeners.ItemType itemType,
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf parent)
Starts a lifecycle step on Report Portal
|
protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf |
startStep(java.lang.String name,
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf parent)
Starts a scenario step on Report Portal
|
protected io.reactivex.Maybe<java.lang.String> |
startTestItem(io.reactivex.Maybe<java.lang.String> parentId,
com.epam.ta.reportportal.ws.model.StartTestItemRQ rq)
Starts a test item on Report Portal
|
void |
storyCancelled(org.jbehave.core.model.Story story,
org.jbehave.core.model.StoryDuration storyDuration) |
void |
successful(java.lang.String step)
Finishes step in ReportPortal
|
afterComposedSteps, afterGivenStories, afterScenarios, afterScenarioSteps, afterStoriesSteps, afterStorySteps, beforeComposedSteps, beforeGivenStories, beforeScenarios, beforeScenarioSteps, beforeStoriesSteps, beforeStorySteps, comment, dryRun, failedOutcomes, givenStories, givenStories, lifecycle, narrative, pending, pendingMethods, restarted, restartedStory, storyExcludedpublic static final java.lang.String CODE_REF
public static final java.lang.String START_TIME
public static final java.lang.String PARAMETERS
public static final java.lang.String PARENT
public static final java.lang.String START_REQUEST
public static final java.lang.String FINISH_REQUEST
public ReportPortalStoryReporter(java.util.function.Supplier<com.epam.reportportal.service.Launch> launchSupplier,
com.epam.reportportal.service.tree.TestItemTree testItemTree)
@Nonnull public java.util.Optional<com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf> getLastStep()
protected java.lang.String getStoryName(@Nonnull
org.jbehave.core.model.Story story)
story - JBehave's story object@Nonnull
protected java.util.Set<com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ> getAttributes(@Nonnull
org.jbehave.core.model.Meta meta)
Meta object into a Set of ItemAttributesRQ ready to use in a request to Report Portalmeta - JBehave's meta object@Nonnull
protected java.util.Set<com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ> getAttributes(@Nonnull
org.jbehave.core.model.Story story)
Set of ItemAttributesRQ ready to use in a request to Report Portalstory - JBehave's story object@Nonnull
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ buildStartStoryRq(@Nonnull
org.jbehave.core.model.Story story,
@Nonnull
java.lang.String codeRef,
@Nullable
java.util.Date startTime)
story - JBehave story objectcodeRef - A story code referencestartTime - a story start time which will be passed to RPprotected java.lang.String getScenarioName(org.jbehave.core.model.Scenario scenario)
scenario - JBehave's scenario object@Nonnull
protected java.util.Set<com.epam.ta.reportportal.ws.model.attribute.ItemAttributesRQ> getAttributes(@Nonnull
org.jbehave.core.model.Scenario scenario)
Set of ItemAttributesRQ ready to use in a request to Report Portalscenario - JBehave's scenario object@Nonnull
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ buildStartScenarioRq(@Nonnull
org.jbehave.core.model.Scenario scenario,
@Nonnull
java.lang.String codeRef,
@Nullable
java.util.Date startTime)
scenario - JBehave scenario objectcodeRef - A scenario code referencestartTime - a scenario start time which will be passed to RP@Nullable
protected java.util.List<com.epam.ta.reportportal.ws.model.ParameterResource> getStepParameters(@Nullable
java.util.Map<java.lang.String,java.lang.String> params)
ParameterResource list ready to use in a request to Report Portalparams - a parameters map@Nonnull
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ buildStartExampleRq(@Nonnull
org.jbehave.core.model.Scenario scenario,
@Nonnull
java.util.Map<java.lang.String,java.lang.String> example,
@Nonnull
java.lang.String codeRef,
@Nullable
java.util.Date startTime)
scenario - JBehave scenario objectexample - an example mapcodeRef - a step code referencestartTime - a step start time which will be passed to RP@Nonnull
protected java.util.List<java.lang.String> getUsedParameters(@Nonnull
java.lang.String step)
step - a step name pattern@Nonnull
protected java.lang.String formatExampleStep(@Nonnull
java.lang.String step,
@Nullable
java.util.Map<java.lang.String,java.lang.String> example)
step - a step name patternexample - example parameters map@Nullable
protected com.epam.reportportal.service.item.TestCaseIdEntry getTestCaseId(@Nullable
java.lang.String codeRef,
@Nullable
java.util.List<java.lang.String> params)
TestCaseIdEntry by code reference and parameter map.codeRef - a test code referenceparams - test parameters map (if any)@Nonnull
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ buildStartStepRq(@Nonnull
java.lang.String step,
@Nonnull
java.lang.String codeRef,
@Nullable
java.util.Map<java.lang.String,java.lang.String> params,
@Nullable
java.util.Date startTime)
step - JBehave step namecodeRef - a step code referenceparams - Examples parameters for current iterationstartTime - a step start time which will be passed to RP@Nonnull
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ buildLifecycleSuiteStartRq(@Nonnull
java.lang.String name,
@Nullable
java.lang.String codeRef,
@Nullable
java.util.Date startTime)
name - a lifecycle suite namecodeRef - the suite code referencestartTime - item start time@Nonnull
protected com.epam.ta.reportportal.ws.model.StartTestItemRQ buildLifecycleMethodStartRq(@Nonnull
com.epam.reportportal.listeners.ItemType type,
@Nonnull
java.lang.String name,
@Nullable
java.lang.String codeRef,
@Nullable
java.util.Date startTime)
type - item typename - a lifecycle method namecodeRef - method's code referencestartTime - item start time@Nonnull
protected io.reactivex.Maybe<java.lang.String> startTestItem(@Nullable
io.reactivex.Maybe<java.lang.String> parentId,
@Nonnull
com.epam.ta.reportportal.ws.model.StartTestItemRQ rq)
parentId - an id of a parent itemrq - a request to Report Portal@Nonnull
protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf createLeaf(@Nonnull
com.epam.reportportal.listeners.ItemType type,
@Nonnull
com.epam.ta.reportportal.ws.model.StartTestItemRQ rq,
@Nullable
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf parent)
type - the item typerq - a request to Report Portalparent - a parent test item leaf@Nonnull
protected java.util.Date getItemDate(@Nullable
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf parent)
parent - a parent test item leaf@Nullable protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf retrieveLeaf()
@Nullable protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf getLeaf()
protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf startStep(@Nonnull
java.lang.String name,
@Nonnull
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf parent)
name - a step nameparent - a parent test item leaf@Nonnull
protected com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf startLifecycleMethod(@Nonnull
java.lang.String name,
@Nonnull
com.epam.reportportal.listeners.ItemType itemType,
@Nonnull
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf parent)
name - a step nameitemType - lifecycle item typeparent - a parent test item leaf@Nonnull
protected com.epam.ta.reportportal.ws.model.FinishTestItemRQ buildFinishTestItemRequest(@Nonnull
io.reactivex.Maybe<java.lang.String> id,
@Nullable
com.epam.reportportal.listeners.ItemStatus status,
@Nullable
com.epam.ta.reportportal.ws.model.issue.Issue issue)
id - item ID referencestatus - item result statusissue - test item issue to set (if any)protected void finishItem(@Nullable
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf item,
@Nullable
com.epam.reportportal.listeners.ItemStatus status)
item - an item to finishstatus - a status to set on finishprotected void finishLastItem(@Nullable
com.epam.reportportal.listeners.ItemStatus status)
status - a status to set on finish@Nullable
protected com.epam.reportportal.listeners.ItemStatus evaluateStatus(@Nullable
com.epam.reportportal.listeners.ItemStatus currentStatus,
@Nullable
com.epam.reportportal.listeners.ItemStatus childStatus)
currentStatus - an Item statuschildStatus - a status of its child elementStatusEvaluation.evaluateStatus(ItemStatus, ItemStatus)protected void evaluateAndFinishLastItem()
@Nonnull
protected java.util.function.Function<java.lang.String,com.epam.ta.reportportal.ws.model.log.SaveLogRQ> getLogSupplier(@Nonnull
com.epam.reportportal.listeners.LogLevel level,
@Nullable
java.lang.String message)
SaveLogRQ from a Throwablelevel - a log levelmessage - a message to attachSaveLogRQ supplier Functionprotected void sendStackTraceToRP(@Nonnull
io.reactivex.Maybe<java.lang.String> itemId,
@Nullable
java.lang.Throwable thrown)
itemId - an ID of an Item to which bypassed stacktrace will be attachedthrown - Throwable object with details of the failureprotected void finishItem(@Nonnull
io.reactivex.Maybe<java.lang.String> id,
@Nonnull
com.epam.reportportal.listeners.ItemStatus status,
@Nullable
com.epam.ta.reportportal.ws.model.issue.Issue issue)
id - an ID of an Itemstatus - a status of the item which will be setissue - an optional issue which will be setprotected void createIgnoredSteps(@Nullable
java.lang.String step,
@Nonnull
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf leaf)
step - a step nameleaf - the step test item leafprotected void createNotPerformedSteps(@Nullable
java.lang.String step,
@Nonnull
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf leaf)
step - a step nameleaf - the step test item leafprotected void createPendingSteps(@Nullable
java.lang.String step,
@Nonnull
com.epam.reportportal.service.tree.TestItemTree.TestItemLeaf leaf)
step - a step nameleaf - the step test item leafprotected void simulateStep(@Nonnull
java.lang.String step)
public void beforeStory(@Nonnull
org.jbehave.core.model.Story story,
boolean givenStory)
beforeStory in interface org.jbehave.core.reporters.StoryReporterbeforeStory in class org.jbehave.core.reporters.NullStoryReporterstory - JBehave story objectgivenStory - whether this story is givenpublic void afterStory(boolean givenStory)
afterStory in interface org.jbehave.core.reporters.StoryReporterafterStory in class org.jbehave.core.reporters.NullStoryReporterpublic void storyCancelled(org.jbehave.core.model.Story story,
org.jbehave.core.model.StoryDuration storyDuration)
storyCancelled in interface org.jbehave.core.reporters.StoryReporterstoryCancelled in class org.jbehave.core.reporters.NullStoryReporterpublic void beforeScenario(@Nonnull
org.jbehave.core.model.Scenario scenario)
beforeScenario in interface org.jbehave.core.reporters.StoryReporterbeforeScenario in class org.jbehave.core.reporters.NullStoryReporterscenario - JBehave scenario objectpublic void afterScenario(org.jbehave.core.steps.Timing timing)
afterScenario in interface org.jbehave.core.reporters.StoryReporterafterScenario in class org.jbehave.core.reporters.NullStoryReporterpublic void beforeStep(@Nonnull
org.jbehave.core.model.Step step)
beforeStep in interface org.jbehave.core.reporters.StoryReporterbeforeStep in class org.jbehave.core.reporters.NullStoryReporterstep - Step to be reportedpublic void beforeExamples(java.util.List<java.lang.String> steps,
org.jbehave.core.model.ExamplesTable table)
beforeExamples in interface org.jbehave.core.reporters.StoryReporterbeforeExamples in class org.jbehave.core.reporters.NullStoryReporterpublic void example(java.util.Map<java.lang.String,java.lang.String> tableRow,
int exampleIndex)
example in interface org.jbehave.core.reporters.StoryReporterexample in class org.jbehave.core.reporters.NullStoryReporterpublic void afterExamples()
afterExamples in interface org.jbehave.core.reporters.StoryReporterafterExamples in class org.jbehave.core.reporters.NullStoryReporterpublic void successful(java.lang.String step)
successful in interface org.jbehave.core.reporters.StoryReportersuccessful in class org.jbehave.core.reporters.NullStoryReporterpublic void failed(java.lang.String step,
java.lang.Throwable cause)
failed in interface org.jbehave.core.reporters.StoryReporterfailed in class org.jbehave.core.reporters.NullStoryReporterstep - a step namecause - a reason of a failurepublic void ignorable(java.lang.String step)
ignorable in interface org.jbehave.core.reporters.StoryReporterignorable in class org.jbehave.core.reporters.NullStoryReporterstep - a step namepublic void notPerformed(java.lang.String step)
notPerformed in interface org.jbehave.core.reporters.StoryReporternotPerformed in class org.jbehave.core.reporters.NullStoryReporterstep - a step namepublic void pending(org.jbehave.core.steps.StepCreator.PendingStep step)
pending in interface org.jbehave.core.reporters.StoryReporterpending in class org.jbehave.core.reporters.NullStoryReporterpublic void scenarioExcluded(org.jbehave.core.model.Scenario scenario,
java.lang.String filter)
scenarioExcluded in interface org.jbehave.core.reporters.StoryReporterscenarioExcluded in class org.jbehave.core.reporters.NullStoryReporter