Skip to content

Built-in html formatter generates a blank html report if scenarios have not finished yet completely #120

@seleniumghost

Description

@seleniumghost

👓 What did you see?

When running tests using built-in html formatter, it generates a blank HTML file until all scenarios finished completely.

✅ What did you expect to see?

HTML report to be generated should not be blank after a scenario has been finished

📦 Which tool/library version are you using?

cucumber 8.0.0
cucumber-html-formatter 19.2.0
ruby 3.1.1
Windows 10

🔬 How could we reproduce it?

Steps to reproduce the behavior:

  1. Have more than one scenario in a test.
  2. Execute cucumber --format HTML --out report.html
  3. Open the html report when test is still running and html file is blank.

📚 Any additional context?

As I have not found it in the issue list, I'm picking up the issue mentioned in comment cucumber/cucumber-ruby#1524 (comment) as it shows up as unacceptable drawback compared with older versions, especially when having a lot of scenarios or long scenarios or even both of this. Additionally, when issues like cucumber/cucumber-ruby#1524 occur, the whole report is affected and not only a part of it.

written by marnen:

Unfortunately, the way that’s done makes the Cucumber HTML report much less useful than it used to be. Back in the day, Cucumber used to use a similar approach to RSpec: it wrote straight HTML as scenarios ran, so that the file would render something useful in the browser before it was completely written. That makes it ideal for monitoring a long run with lots of scenarios.

Current Cucumber HTML output, though, renders nothing until the run is complete (I think because window.CUCUMBER_MESSAGES isn’t well-formed JSON/JS till the final closing bracket is written), which means I need to wait for the entire run to finish before I see any output. Is there an HTML formatter for current Cucumber that doesn’t have this drawback? I haven’t found one, and I really miss the old RSpec-like behavior. (And if this is off-topic, I’ll raise a new issue or ask on the list.)

answered by mattwynne:

In fact, this kind of live monitoring of a test run from a browser should now be easier to do, given that the results are streamed out as little ndjson packets. The problem would be getting that stream from your Cucumber process to your browser. It's a really cool idea, but yes it is off-topic for this thread I think :) If you're interested in pursuing it, let's create a new issue (in https://github.com/cucumber/cucumber) and discuss it there.


This text was originally generated from a template, then edited by hand. You can modify the template here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions