Yep. I've actually attended to it already, and am producing reports with 
the full label, both from non-spec objects and in setupSpec(). I was more 
wondering in-general, whether there's a reason in-principal not to support 
such reporting through setup/teardown of the spec.

On Thursday, March 8, 2018 at 4:10:06 AM UTC+11, Marcin Erdmann wrote:
>
> Ok, I see what the problem is. You are using GebReportingSpec.report() 
> which indeed is designed to only work from within feature methods and not 
> fixture methods. This is because it uses the name of the test method when 
> generating the report label (see 
> https://github.com/geb/geb/blob/1eae07a36595094dc311ca98c063fb9484976413/module/geb-spock/src/main/groovy/geb/spock/GebReportingSpec.groovy#L63)
>  
> and gebReportingSpecTestName on which you're getting the NPE is a JUnit 
> rule which means that it is not initialized when setupSpec() is executed.
>
> One workaround would be to directly use Browser.report() instead of 
> GebReportingSpec.report() as you already are interacting with a browser 
> instance in your fixture method. The only downside is that you'd have to 
> put some effort into creating meaningful labels for your reports because 
> you'd obviously loose the label decoration that GebReportingSpec.report() 
> gives you.
>
> On Wed, Mar 7, 2018 at 6:06 AM, Samuel Rossinovic <[email protected] 
> <javascript:>> wrote:
>
>> Attempting to call report() from setupSpec() yields:
>> java.lang.NullPointerException: Cannot get property 'methodName' on null 
>> object
>>
>>
>> As to the use-case: I think reports are a very powerful feature. Indeed, 
>> the manual states that the reporting mechanism "*can be used to snapshot 
>> the state of the browser at any point in time.*" I have specs that 
>> interact with the browser in setupSpec(), and reporting over those 
>> interactions is as-valuable in my view as reporting done in the actual 
>> features.
>>
>> Example of interactions that I am inclined to push-into setupSpec when 
>> doing blaxbox testing is recreating any entities that are required by the 
>> spec, but are not directly part of the FUT. If setupSpec doesn't work 
>> correctly, it can fail the test, so reporting on setupSpec can be very 
>> helpful.
>>
>> Thanks!
>>
>>
>>
>> On Wednesday, March 7, 2018 at 7:03:06 AM UTC+11, Marcin Erdmann wrote:
>>>
>>> Hi Samuel,
>>>
>>> Can you please elaborate on why you believe it's not supported in 
>>> setupSpec/cleanupSpec? Also, can you explain why you have a requirement for 
>>> it?
>>>
>>> Marcin
>>>
>>> On Sun, Feb 18, 2018 at 11:05 PM, Samuel Rossinovic <
>>> [email protected]> wrote:
>>>
>>>> Hi.
>>>> Seems that calling GebReportingSpec.report() from the specification 
>>>> setup/teardown methods is unsupported ATM. Was wondering if there are any 
>>>> plans for supporting it?
>>>> Thanks!
>>>>
>>>> -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Geb User Mailing List" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/geb-user/bf64757b-e0a3-4e19-9fdc-9a3c869dfb54%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/geb-user/bf64757b-e0a3-4e19-9fdc-9a3c869dfb54%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Geb User Mailing List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/geb-user/caafdc6d-c847-4589-8224-a4d7e28068b3%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/geb-user/caafdc6d-c847-4589-8224-a4d7e28068b3%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "Geb 
User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/geb-user/7ddadf36-3e47-4ff5-a09b-8e570f9dcc2a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to