Decoupling Reporter with the HTML5 messaging API

18 views
Skip to first unread message

Hermann Schmidt

unread,
Jul 27, 2015, 11:00:10 AM7/27/15
to Jasmine
Hi,

would it be possible to write a Reporter, which sends all results via postMessage() to an iframe, where the actual html report is located?

My idea was to have the html report result and the application (an ExtJS5 thingie in my case) side-by-side in the same window. For that, I want to isolate the HTML report in an iframe and send all results from the main window, where the tests run in the App context, to the iframe. A special Reporter should use postMesssage() instead of creating DOM elements. The html report page in the iframe would listen to the messages and produce the report as we know it (modified HtmlRunner).

I don't understand enough about the inner mechanics of Jasmine to identify the right places to hook into. I couldn't quite figure out what the API of a Runner must look like to work with Jasmine.

Is this a feasible idea at all? Is the Runner a sufficient isolation point for the purpose I described?

Thanks
Hermann

Gregg Van Hove

unread,
Jul 27, 2015, 2:53:56 PM7/27/15
to jasmi...@googlegroups.com
I think what you want to do is write a [custom reporter](http://jasmine.github.io/edge/custom_reporter.html). Reporters are not intrinsically tied to HTML, but the built-in HTMLReporter is.

Hope this helps,

-Gregg

--
You received this message because you are subscribed to the Google Groups "Jasmine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jasmine-js+...@googlegroups.com.
To post to this group, send email to jasmi...@googlegroups.com.
Visit this group at http://groups.google.com/group/jasmine-js.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages