Package com.epam.reportportal.cucumber
Class ScenarioReporter
- java.lang.Object
-
- com.epam.reportportal.cucumber.AbstractReporter
-
- com.epam.reportportal.cucumber.ScenarioReporter
-
- All Implemented Interfaces:
io.cucumber.plugin.ConcurrentEventListener,io.cucumber.plugin.Plugin
public class ScenarioReporter extends AbstractReporter
Cucumber reporter for ReportPortal that reports scenarios as test methods.Mapping between Cucumber and ReportPortal is as follows:
- feature - TEST
- scenario - STEP
- step - log item
Dummy "Root Test Suite" is created because in current implementation of RP test items cannot be immediate children of a launch
Background steps and hooks are reported as part of corresponding scenarios. Outline example rows are reported as individual scenarios with [ROW NUMBER] after the name.
-
-
Field Summary
Fields Modifier and Type Field Description protected com.epam.reportportal.utils.MemoizingSupplier<io.reactivex.Maybe<java.lang.String>>rootSuiteId-
Fields inherited from class com.epam.reportportal.cucumber.AbstractReporter
BACKGROUND_PREFIX, DOCSTRING_DECORATOR, HOOK_, METHOD_OPENING_BRACKET, WORKING_DIRECTORY
-
-
Constructor Summary
Constructors Constructor Description ScenarioReporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidafterLaunch()Finish RP launchprotected voidbeforeLaunch()Manipulations before the launch startsprotected voidbeforeStep(io.cucumber.plugin.event.TestCase testCase, io.cucumber.plugin.event.TestStep testStep)Start Cucumber stepprotected com.epam.ta.reportportal.ws.model.StartTestItemRQbuildStartHookRequest(io.cucumber.plugin.event.TestCase testCase, io.cucumber.plugin.event.HookTestStep testStep)Extension point to customize test creation event/requestprotected com.epam.ta.reportportal.ws.model.StartTestItemRQbuildStartStepRequest(io.cucumber.plugin.event.TestStep testStep, java.lang.String stepPrefix, java.lang.String keyword)Extension point to customize test creation event/requestprotected voidfinishRootItem()Finish root suiteprotected java.lang.StringgetFeatureTestItemType()Return RP launch test item name mapped to Cucumber featureprotected java.util.Optional<io.reactivex.Maybe<java.lang.String>>getRootItemId()protected java.lang.StringgetScenarioTestItemType()Return RP launch test item name mapped to Cucumber scenarioprotected voidstartRootItem()Start root suite-
Methods inherited from class com.epam.reportportal.cucumber.AbstractReporter
afterHooks, afterScenario, afterStep, beforeHooks, beforeScenario, buildFinishTestItemRequest, buildMultilineArgument, buildReportPortal, buildStartFeatureRequest, buildStartLaunchRq, buildStartRuleRequest, buildStartScenarioRequest, embedding, extractAttributes, finishTestItem, finishTestItem, finishTestItem, formatDataTable, getAttributes, getCodeRef, getCodeRef, getCurrent, getDescription, getDescription, getEmbedEventHandler, getHookTypeAndName, getItemTree, getLaunch, getParameters, getReportPortal, getStepName, getTestCaseFinishedHandler, getTestCaseId, getTestCaseId, getTestCaseStartedHandler, getTestRunFinishedHandler, getTestRunStartedHandler, getTestSourceParsedHandler, getTestStepFinishedHandler, getTestStepStartedHandler, getWriteEventHandler, handleEndOfFeature, handleSourceEvents, handleStartOfTestCase, handleTestStepFinished, handleTestStepStarted, mapItemStatus, mapLevel, reportResult, sendLog, sendLog, setEventPublisher, startFeature, startHook, startRule, startScenario, startStep
-
-
-
-
Method Detail
-
beforeLaunch
protected void beforeLaunch()
Description copied from class:AbstractReporterManipulations before the launch starts- Overrides:
beforeLaunchin classAbstractReporter
-
buildStartStepRequest
@Nonnull protected com.epam.ta.reportportal.ws.model.StartTestItemRQ buildStartStepRequest(@Nonnull io.cucumber.plugin.event.TestStep testStep, @Nullable java.lang.String stepPrefix, @Nullable java.lang.String keyword)Description copied from class:AbstractReporterExtension point to customize test creation event/request- Overrides:
buildStartStepRequestin classAbstractReporter- Parameters:
testStep- a cucumber step objectstepPrefix- a prefix of the step (e.g. 'Background')keyword- a step keyword (e.g. 'Given')- Returns:
- a Request to ReportPortal
-
beforeStep
protected void beforeStep(@Nonnull io.cucumber.plugin.event.TestCase testCase, @Nonnull io.cucumber.plugin.event.TestStep testStep)Description copied from class:AbstractReporterStart Cucumber step- Overrides:
beforeStepin classAbstractReporter- Parameters:
testCase- Cucumber's TestCase objecttestStep- a cucumber step object
-
buildStartHookRequest
@Nonnull protected com.epam.ta.reportportal.ws.model.StartTestItemRQ buildStartHookRequest(@Nonnull io.cucumber.plugin.event.TestCase testCase, @Nonnull io.cucumber.plugin.event.HookTestStep testStep)Description copied from class:AbstractReporterExtension point to customize test creation event/request- Overrides:
buildStartHookRequestin classAbstractReporter- Parameters:
testCase- Cucumber's TestCase objecttestStep- a cucumber step object- Returns:
- Request to ReportPortal
-
getFeatureTestItemType
@Nonnull protected java.lang.String getFeatureTestItemType()
Description copied from class:AbstractReporterReturn RP launch test item name mapped to Cucumber feature- Specified by:
getFeatureTestItemTypein classAbstractReporter- Returns:
- test item name
-
getScenarioTestItemType
@Nonnull protected java.lang.String getScenarioTestItemType()
Description copied from class:AbstractReporterReturn RP launch test item name mapped to Cucumber scenario- Specified by:
getScenarioTestItemTypein classAbstractReporter- Returns:
- test item name
-
getRootItemId
@Nonnull protected java.util.Optional<io.reactivex.Maybe<java.lang.String>> getRootItemId()
- Specified by:
getRootItemIdin classAbstractReporter
-
afterLaunch
protected void afterLaunch()
Description copied from class:AbstractReporterFinish RP launch- Overrides:
afterLaunchin classAbstractReporter
-
finishRootItem
protected void finishRootItem()
Finish root suite
-
startRootItem
protected void startRootItem()
Start root suite
-
-