BehatHtmlFormatterPlugin icon indicating copy to clipboard operation
BehatHtmlFormatterPlugin copied to clipboard

different filename for different renderer, and a render for xml file output

Open lucaswong2000 opened this issue 9 years ago • 8 comments

Hi, I am using this plugin, it really helped me a lot! In the title are two additional features that I made to my needs, commited here: https://github.com/lucaswong2000/BehatHtmlFormatterPlugin/commit/7058aa4bba382bd2da3113be2b6ab3b52325118c

If interested, I'd be glad to creat a pull request to merge my changes. ;-)

Thanks again for this awsome plugin!

lucaswong2000 avatar Jul 02 '15 15:07 lucaswong2000

I'm not sure, but there allready are xml formatters out there. Does XML belong in the HTML formatter ?

Please let me know

dutchiexl avatar Jul 02 '15 15:07 dutchiexl

Oh there are already some xml formatters? I couldn't find it. Yeah, maybe you are right, it's a little wired to put a xml formater in html.

Thanks anyway.

lucaswong2000 avatar Jul 02 '15 15:07 lucaswong2000

each time i update composer i go to vendor/emuse/behat-html-formatter/templates/index.html.twig to change this ’’’html

{{ step.output }}
’’’html i think it's related to the same missing feature.

PS. Thanks for this project, great job!

KernelFolla avatar Jul 04 '15 07:07 KernelFolla

You change this to what ?

dutchiexl avatar Aug 12 '15 08:08 dutchiexl

considering I use behat tests also as info for api consumers, i use PRE instead of P tag to have a correct rappresentation of some json output of api, then could be useful if i can override the existing index.html.twig, also to put a logo on top or a different color for success/error (color blindness) or just a different template.

So, in my opinion, ideal is to give the opportunity to choose a different template in the extension settings (behat.yml)

Anyway I can try to do myself a pull request, basically i need to add a renderer_options parameter (as array) in BehatHTMLFormatterExtension.php and pass them between BehatHTMLFormatter BaseRenderer and TwigRenderer, in this way can be used also on other renderer, alternatively renderer option in extension settings should be arrayNode instead of scalarNode

KernelFolla avatar Aug 12 '15 09:08 KernelFolla

I am looking at the architecture to change the way the printing and templating is done. Ideally I will add a feature so that you can write a plugin with the template and put events in all the functions, so that you can change the data.

dutchiexl avatar Aug 12 '15 09:08 dutchiexl

It looks promising, so can i define my own renderer that may inherit your? anyway ping me if you need help in this:)

KernelFolla avatar Aug 12 '15 09:08 KernelFolla

yes exactly!

dutchiexl avatar Aug 12 '15 09:08 dutchiexl