Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to generate HTML report after the test runs? #72

Open
rameshrengasamy opened this issue Nov 22, 2016 · 7 comments
Open

Comments

@rameshrengasamy
Copy link

I am totally new to this language and i was giving it a try to do automation with this library. Is there a way to generate HTML report after the test runs?

@meadsteve
Copy link
Collaborator

Hi @rameshrengasamy not at the moment. The feature set of this tool is quite limited at the moment.

@Dzol
Copy link
Contributor

Dzol commented Dec 13, 2016

Hi @meadsteve,

I'd like to pick this up as we're running White Bread on a CI server where HTML reports would integrate well with the UI.

I hope these can make it into master:

Minimal Modifications + Additions

  • Reach out to configuration for fetching formatters instead of just the one.
    I.e. generalize the line above to read in a (list of) modules with which to format.
  • Implement the progress reporter protocol for and alongside an HTML formatter (somewhat like the console reporter but as a generic server).

More Extensive Changes

  • Replace the Reporter protocol and the current console formatter with and event manager based on a supervisor and generic server.
  • Change the main Whitebread file to start the event manager and the formatters.

If time permits I can make the more extensive changes in a separate PR as they involve structural changes.

@Dzol
Copy link
Contributor

Dzol commented Dec 19, 2016

@rameshrengasamy: This documents how to do HTML reporting https://github.com/meadsteve/white-bread#html-output

@rameshrengasamy
Copy link
Author

@Dzol Thank you so much, ill try it out. I got an error when i tried to run mix white_bread.run. It might be my mistake somewhere too, as I m totally new to this framework. But i can try again and post here

** (MatchError) no match of right hand side value: []
lib/white_bread/command_line/suite_run.ex:34: WhiteBread.CommandLine.SuiteRun.get_suites_from_config/2
lib/white_bread/command_line/suite_run.ex:13: WhiteBread.CommandLine.SuiteRun.run_suites/2
lib/mix/tasks/white_bread.run.ex:20: Mix.Tasks.WhiteBread.Run.run/1
(mix) lib/mix/cli.ex:58: Mix.CLI.run_task/2
(elixir) lib/code.ex:363: Code.require_file/2

@rameshrengasamy
Copy link
Author

@Dzol I got it working, ended up upgrading my Elixir version, it works now...Thank you

@Dzol
Copy link
Contributor

Dzol commented Jan 19, 2017

This ticket was never closed which is a good thing because reporters (including the HTML reporter) can only do their thing on a feature by feature basis. The limitations are obvious: it would be nice to have a report on a suite by suite basis.

Some existing code has to be generalized (i.e. the code responsible for console output) to allow for another reporter which outputs suite information.

By that virtue I suggest we make the more extensive changes above.

We're working on this on a fork it involves some pretty hefty changes.

@Dzol
Copy link
Contributor

Dzol commented Jan 23, 2017

@meadsteve: PR #83 generalizes how reporting is done and improves the HTML reporting.

Here is some HTML output from the test suite (OKs should in fact be green and if there is a failure then the OK is replaced by a red FAILURE):

White Bread Results

Suite: Alternate context

  • OK: Table with step
  • OK: Background doc string
  • OK: The desire to have toasted bread
  • OK: If I had a voice
  • OK: Be sad that no coffee is left
  • OK: If I had a heart
  • OK: Doc string with step
  • OK: Buy last coffee

Suite: Outline context

  • OK: If I had a voice
  • OK: If I had a heart

Suite: Plain context - Songs

  • OK: The desire to have toasted bread
  • OK: Table with step
  • OK: If I had a voice
  • OK: If I had a heart
  • OK: Be sad that no coffee is left
  • OK: Buy last coffee
  • OK: Background doc string
  • OK: Doc string with step

Suite: Singer role

  • OK: If I had a voice
  • OK: If I had a heart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants