[JVM][HTML] Overwrite the output style

69 views
Skip to first unread message

Lennart

unread,
Feb 19, 2015, 4:34:27 AM2/19/15
to cu...@googlegroups.com
Hi,

I've been struggling with the html output of cucumber-jvm (running it from JUnit), that by far doesn't look as pretty as the ruby output.

To do so, I add in a beforeAll hook: 

  ReportPatcher.runOnShutDown( "cucumber_acceptance_test/smoke-html-report/");

    public static void runOnShutDown( String reportDir )
   
{
       
ReportPatcher patcher = new ReportPatcher( reportDir );
       
Thread patcherThread = new Thread( patcher );
       
Runtime.getRuntime().addShutdownHook( patcherThread );
   
}

that does a:

        copyToOutput("style.css");
        copyToOutput
("formatter.js");

which overwrites the original with my own version of the css and js in the output folder.

using this shutdown hook, and a needing to set the folder statically, makes it a dirty hack. Any suggestions on how to do this better?

Seb Rose

unread,
Feb 23, 2015, 4:45:08 AM2/23/15
to cu...@googlegroups.com
 
 
 
On Thu, 19 Feb 2015, at 09:34 AM, Lennart wrote:
Hi,
 
I've been struggling with the html output of cucumber-jvm (running it from JUnit), that by far doesn't look as pretty as the ruby output.
 
To do so, I add in a beforeAll hook: 
 

ReportPatcher.runOnShutDown("cucumber_acceptance_test/smoke-html-report/");

 

publicstaticvoid runOnShutDown(String reportDir )
{
ReportPatcher patcher =newReportPatcher( reportDir );
Thread patcherThread =newThread( patcher );
Runtime.getRuntime().addShutdownHook( patcherThread );
}

 
that does a:
 

        copyToOutput("style.css");
        copyToOutput("formatter.js");

 
which overwrites the original with my own version of the css and js in the output folder.
 
using this shutdown hook, and a needing to set the folder statically, makes it a dirty hack. Any suggestions on how to do this better?
 
Have you considered submitting a pull request for an improved HTML formatter?
 
--
---
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/d/optout.
 
--
Seb Rose
 

Lennart

unread,
Feb 24, 2015, 8:57:49 AM2/24/15
to cu...@googlegroups.com
I considered it, but I'm not really proud of the code, its a dirty dirty hack.
But, it makes the report look more like the ruby html output, which looks soooo much better.
:-)



Op maandag 23 februari 2015 10:45:08 UTC+1 schreef Seb Rose:
Reply all
Reply to author
Forward
0 new messages