Class 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 Detail

      • rootSuiteId

        protected com.epam.reportportal.utils.MemoizingSupplier<io.reactivex.Maybe<java.lang.String>> rootSuiteId
    • Constructor Detail

      • ScenarioReporter

        public ScenarioReporter()
    • Method Detail

      • 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: AbstractReporter
        Extension point to customize test creation event/request
        Overrides:
        buildStartStepRequest in class AbstractReporter
        Parameters:
        testStep - a cucumber step object
        stepPrefix - 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: AbstractReporter
        Start Cucumber step
        Overrides:
        beforeStep in class AbstractReporter
        Parameters:
        testCase - Cucumber's TestCase object
        testStep - 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: AbstractReporter
        Extension point to customize test creation event/request
        Overrides:
        buildStartHookRequest in class AbstractReporter
        Parameters:
        testCase - Cucumber's TestCase object
        testStep - a cucumber step object
        Returns:
        Request to ReportPortal
      • getFeatureTestItemType

        @Nonnull
        protected java.lang.String getFeatureTestItemType()
        Description copied from class: AbstractReporter
        Return RP launch test item name mapped to Cucumber feature
        Specified by:
        getFeatureTestItemType in class AbstractReporter
        Returns:
        test item name
      • getScenarioTestItemType

        @Nonnull
        protected java.lang.String getScenarioTestItemType()
        Description copied from class: AbstractReporter
        Return RP launch test item name mapped to Cucumber scenario
        Specified by:
        getScenarioTestItemType in class AbstractReporter
        Returns:
        test item name
      • getRootItemId

        @Nonnull
        protected java.util.Optional<io.reactivex.Maybe<java.lang.String>> getRootItemId()
        Specified by:
        getRootItemId in class AbstractReporter
      • finishRootItem

        protected void finishRootItem()
        Finish root suite
      • startRootItem

        protected void startRootItem()
        Start root suite