spock-reports
spock-reports copied to clipboard
Parameter value not showing in the step name
Hi there,
I'm trying to refer to parameter name in my step definition e.g. when: "I need to see this parameter value #parameterName"
But the parameter value doesn't show in the final report. Please see the screenshots below:
This was working fine in Spock 1, but seems to have stopped working in certain cases in Spock 2.
I think this has to do with @Unroll
being now the default... did you mark your test with whatever the NOT-unrolled annotation is or it's unrolled?
Hi, I have tried with both unrolled and regular versions of the report. The result is the same.
This scenario is included in the tests.
See com.athaydes.spockframework.report.FakeTest
and the expected reports using in the assertions:
-
src/test/resources/com/athaydes/spockframework/report/internal/FakeTestReport.html
-
src/test/resources/FakeTest.md
Only the unrolled case is checked because there is no way to resolve the parameter otherwise, as the block shows up only once and there are potentially many values the block variable could have, so which one should we use?
I tried this spec for manual tests:
import spock.lang.Specification
import spock.lang.Unroll
class MySpec extends Specification {
@Unroll
def 'check values'( ){
expect: 'parameter has value #value'
true
where:
value << [1, 2, 3]
}
}
Result:

As the tests are passing, there must be something in your environment or tests that is different than the tests are checking.
Can you provide a specification that presents this problem even with an unrolled annotation?
Closing this due to lack of feedback.