[JVM] Propagate glue/cucumber options to formatter/reporter

33 views
Skip to first unread message

Vaclav Stengl

unread,
Sep 25, 2016, 6:11:56 PM9/25/16
to Cukes
Hello,

lang: Java 1.7
Dependencies:
<groupId>info.cukes</groupId>
<artifactId>cucumber-junit</artifactId>
<version>1.2.4</version>

<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.4</version>

I am writting custom plugin for Cucumber tests executed by Jenkins and web. app to present reports + statistics etc.

I have following problem: bcs reports are in development our testers need to use another Jenkins plugin to present reports from Cucumber so my company wants to use two plugins simultaneously while our solution is not complete (it will gather data for now).

I know I can add formatter via @CucumberOptions in attribute plugin, but i need to propagate to Reporter/Formatter instance used glue (its for statistics purposes - its reused *.feature so its counted only once but for reports it standalone run) and for both interface calls i need it will se same instance (holds inner state).

I have tried:
1, Rewrite jUnit Cucumber runner create my Reporter/Formatter here and pass it with other Reporter/Formatter retrieved from CucumberOptions class to JUnitReporter .
    I wanted to rewrite JUnitReporter so it will take List of  Reporter/Formatter and call all of them for Reporter/Formatter methods, but one of JUnitReporter attributes call package protected method (executionUnitRunner.describeChild(runnerStep)) so i cant rewrite this class easily.

Is there any solution for this problem?

Thx for answer,
V

Reply all
Reply to author
Forward
0 new messages