[JVM] HTML report is empty when there have been any before / after hooks executed

229 views
Skip to first unread message

Tom Dunstan

unread,
Apr 7, 2013, 8:18:15 PM4/7/13
to cu...@googlegroups.com
Hi All

cucumber-jvm issue 457 https://github.com/cucumber/cucumber-jvm/issues/497 is a real problem for us. We are using before and after hooks to set up Geb and and clean it up again, and also to clean up certain set up data. This causes the current html report to be empty with javascript errors.

I have submitted a pull request for cucumber-html which fixes the problem by showing before and after blocks in the html report, but only if there were errors, since before and after blocks all through the report would be very noisy.

Just wanted to see if people agreed with the approach, and make sure that it was on the radar before the next release of cucumber-jvm.

Cheers

Tom

Paolo Ambrosio

unread,
Apr 11, 2013, 2:06:42 AM4/11/13
to cu...@googlegroups.com
I can't find where/if cucumber-html is tested. Is it tested anywhere?

On Mon, Apr 8, 2013 at 1:18 AM, Tom Dunstan <t...@tomd.cc> wrote:

> I have submitted a pull request for cucumber-html which fixes the problem by
> showing before and after blocks in the html report, but only if there were
> errors, since before and after blocks all through the report would be very
> noisy.

From what I understand,
src/main/resources/cucumber/formatter/report.js is used as an example
and to try the page rendering.

Tried to put a couple of "before" calls in there and with your patch
there are no errors, but it does not look right. I'm not sure I'm
doing it right and what should be the correct behaviour though.


Paolo

Tom Dunstan

unread,
Apr 11, 2013, 2:26:04 AM4/11/13
to cu...@googlegroups.com
Hi Paolo!

On Thursday, 11 April 2013 15:36:42 UTC+9:30, Paolo Ambrosio wrote:
I can't find where/if cucumber-html is tested. Is it tested anywhere?
 <snip>
From what I understand,
src/main/resources/cucumber/formatter/report.js is used as an example
and to try the page rendering.

It's not tested in the cucumber-html project, that's for sure. Cucumber-html gets included in the cucumber-jvm cucumber-core jar via the maven shade plugin. The closest thing I could find for a test is in https://github.com/cucumber/cucumber-jvm/blob/master/core/src/test/java/cucumber/runtime/formatter/HTMLFormatterTest.java - but even there it's really just testing the java code.
 
Tried to put a couple of "before" calls in there and with your patch
there are no errors, but it does not look right. I'm not sure I'm
doing it right and what should be the correct behaviour though.

Well, it you have a before or after hook which throws an exception, you'll get a call to one of the functions with a structure that looks like it does in the issue that I linked to. I thought it looks pretty much right - a preformatted stacktrace which picks up the red error colour. What does it look like for you?

I guess to really try it out, create a cucumber test which throws an error from a before hook, run it using cucumber-jvm and see how it gets rendered.

Cheers

Tom

Paolo Ambrosio

unread,
Apr 11, 2013, 9:15:04 AM4/11/13
to cu...@googlegroups.com
Hi Tom!

On Thu, Apr 11, 2013 at 7:26 AM, Tom Dunstan <t...@tomd.cc> wrote:
> On Thursday, 11 April 2013 15:36:42 UTC+9:30, Paolo Ambrosio wrote:
>>
>> I can't find where/if cucumber-html is tested. Is it tested anywhere?
>
> It's not tested in the cucumber-html project, that's for sure. Cucumber-html
> gets included in the cucumber-jvm [...] but even there it's really just testing
> the java code.

Those were also my findings :-/

> [...] I thought it looks pretty much right - a preformatted stacktrace which
> picks up the red error colour. What does it look like for you?
> I guess to really try it out, create a cucumber test which throws an error
> from a before hook, run it using cucumber-jvm and see how it gets rendered.

Yes, I've done it now and it looks good to me with both
succeeding/failing single/multiple before/after hooks :-)

You might consider adding it to the report.js in cucumber-html (if it
is an example - perhaps Aslak or Julien can confirm this assumption).


Paolo

Tom Dunstan

unread,
Apr 11, 2013, 9:23:25 PM4/11/13
to cu...@googlegroups.com
Hi Paolo


On Thursday, 11 April 2013 22:45:04 UTC+9:30, Paolo Ambrosio wrote:
Yes, I've done it now and it looks good to me with both
succeeding/failing single/multiple before/after hooks :-)

You might consider adding it to the report.js in cucumber-html (if it
is an example - perhaps Aslak or Julien can confirm this assumption).

Ah, yes I see that now. Yes, it gets excluded from the cucumber-html build, so it must just be for a bit of manual testing. I've now updated my pull request to include before and after examples as well.

Cheers

Tom

Tom Dunstan

unread,
Apr 30, 2013, 12:15:08 AM4/30/13
to cu...@googlegroups.com
On Friday, 12 April 2013 10:53:25 UTC+9:30, Tom Dunstan wrote:
Ah, yes I see that now. Yes, it gets excluded from the cucumber-html build, so it must just be for a bit of manual testing. I've now updated my pull request to include before and after examples as well.

Any interest in applying the pull request to fix cucumber-html up? I'd hate for a new version of cucumber-jvm to go out without this fix, as html reports are currently broken for anyone with before and after hooks.


Thanks

Tom

Paolo Ambrosio

unread,
May 1, 2013, 7:08:08 AM5/1/13
to cu...@googlegroups.com
On Tue, Apr 30, 2013 at 6:15 AM, Tom Dunstan <t...@tomd.cc> wrote:

> Any interest in applying the pull request to fix cucumber-html up? I'd hate
> for a new version of cucumber-jvm to go out without this fix, as html
> reports are currently broken for anyone with before and after hooks.

Hi Tom,

I've merged the pull request, as I've tried it locally with
cucumber-jvm and it fixes issue #497 there. After releasing
cucumber-html, I'm going to update the version on cucumber-jvm to take
advantage of your fix.


Paolo

Tom Dunstan

unread,
May 1, 2013, 8:47:19 PM5/1/13
to cu...@googlegroups.com
On Wednesday, 1 May 2013 20:38:08 UTC+9:30, Paolo Ambrosio wrote:
I've merged the pull request, as I've tried it locally with
cucumber-jvm and it fixes issue #497 there. After releasing
cucumber-html, I'm going to update the version on cucumber-jvm to take
advantage of your fix.

Great, thanks Paolo!

Cheers

Tom 

Paolo Ambrosio

unread,
May 19, 2013, 6:57:57 AM5/19/13
to cu...@googlegroups.com
Hi Tom,

Sorry it took so long: I was waiting for the release karma on npmjs.
I've just released cucumber-html 0.2.3 and updated cucumber-jvm to use
it.


Paolo

Tom Dunstan

unread,
May 19, 2013, 9:47:59 PM5/19/13
to cu...@googlegroups.com

Sorry it took so long: I was waiting for the release karma on npmjs.
I've just released cucumber-html 0.2.3 and updated cucumber-jvm to use
it.

Great, thanks Paolo. Do we publish cucumber-jvm snapshots anywhere? While I can build it myself locally, I don't have a local mavenish repo to push a locally built shapshot to, so other devs are still using the buggy version here until I can bump the cucumber-jvm version.

Thanks

Tom

aslak hellesoy

unread,
May 19, 2013, 9:53:37 PM5/19/13
to Cucumber Users
On Sun, May 19, 2013 at 8:47 PM, Tom Dunstan <t...@tomd.cc> wrote:

Sorry it took so long: I was waiting for the release karma on npmjs.
I've just released cucumber-html 0.2.3 and updated cucumber-jvm to use
it.

Great, thanks Paolo. Do we publish cucumber-jvm snapshots anywhere?

Not yet, but I'd like to!

Pull requests welcome.

Aslak
 
While I can build it myself locally, I don't have a local mavenish repo to push a locally built shapshot to, so other devs are still using the buggy version here until I can bump the cucumber-jvm version.

Thanks

Tom

--
-- Rules --
 
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
 
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Tom Dunstan

unread,
May 19, 2013, 11:12:30 PM5/19/13
to cu...@googlegroups.com
On Monday, May 20, 2013 11:23:37 AM UTC+9:30, Aslak Hellesøy wrote:
Great, thanks Paolo. Do we publish cucumber-jvm snapshots anywhere?

Not yet, but I'd like to!

Pull requests welcome.

OK, I read the linked-to blog post. There are a few things that might make it a bit difficult to do this:
 - You can only issue pull requests to a branch that exists, and the magic "travis" branch doesn't exist atm.
 - I don't have the sonatype username/password to encrypt, so I can't even really test it.

If someone wants to encrypt the sonatype username / password with my travis repo key a la:

gem install travis
travis encrypt "sonatype-username" -r tomdcc/cucumber-jvm
travis encrypt "sonatype-password" -r tomdcc/cucumber-jvm

And then send me back the results, I'll try pushing snapshots from a travis build from my fork, then all someone will have to do is merge the pull requests and substitute the encrypted-for-my fork values with encrypted-for cucumber/cucumber-jvm values, and it should be all sweet.

Cheers

Tom

Tom Dunstan

unread,
May 23, 2013, 11:21:35 PM5/23/13
to cu...@googlegroups.com
On Monday, May 20, 2013 11:23:37 AM UTC+9:30, Aslak Hellesøy wrote:

Cheers

Tom

Tom Dunstan

unread,
May 29, 2013, 9:05:42 PM5/29/13
to cu...@googlegroups.com, cukes...@googlegroups.com
Any interest in this?

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages