jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

HTML formatter #121

Closed nilbus closed 11 years ago

nilbus commented 11 years ago

As part of our Jenkins CI build, I want to store build artifacts of any failures: a static version of the HTML report page and all required assets needed to support it.

How feasible would it be to make an HTML formatter? I'm happy to help implement it, but I would love some guidance on the best way to approach this with your existing Teaspoon::Formatters interface.

jejacks0n commented 11 years ago

That would be nice. I considered doing it at some point, but have you investigated tapout?

It may work to pipe the output out using the teaspoon tap-y formatter, and then using tapout to build something else.

nilbus commented 11 years ago

Interesting idea, though I'm really looking to get the same output format as the HTML reporter.

Now that I think about it, maybe for this kind of output, I shouldn't be using the Console reporter at all, and just grab the output directly from /teaspoon/default from the server it starts up. What do you think?

jejacks0n commented 11 years ago

there's not an easy way to get the html from the browser to ruby.. we use json in the console reporter, pass it through to phantomjs or selenium, and then use that information in the formatters.

I'd say it's probably better to provide a custom formatter -- they're pretty simple, and if you look at the existing ones you'll see how they work pretty easily. I'd take a pull request for this if it makes sense to do so.

nilbus commented 11 years ago

If that's not easily done, I don't know that it's worth the effort. For my purposes, I think it'll work to just redirect the dot formatter to stdout and use a text file for the report.

Feel free to close this if you don't think it'll happen.

Thanks!

nilbus commented 11 years ago

I actually may attack this after all.

jejacks0n commented 11 years ago

Cool, I'll be around this weekend -- if you need any guidance. Hit up my email and I can get on skype if you need.

jejacks0n commented 11 years ago

I'm closing this assuming that you'll be submitting a pull request. Thanks!