π What did you see?
The generated HTML report ends with this line:
<script>
window.CUCUMBER_MESSAGES = [
β
What did you expect to see?
window.CUCUMBER_MESSAGES array should be populated:
<script>
window.CUCUMBER_MESSAGES = [
{"meta":{"protocolVersion":"32.3.1","implementation":{"name":"cucumber-ruby","version":"11.1.0"},"runtime":{"name":"ruby","version":"4.0.5"},"os":{"name":"linux","version":"#1 SMP PREEMPT_DYNAMIC Sun, 17 May 2026 17:23:07 +0000"},"cpu":{"name":"x86_64"}}},
...
]
</script>
π¦ Which tool/library version are you using?
ruby v4.0.5
cucumber-ruby v11.1.0
linux
π¬ How could we reproduce it?
- Setup a blank project
- Add
Gemfile
# frozen_string_literal: true
source 'https://rubygems.org'
gem 'cucumber'
- Add basic feature file:
features/feature/test.feature
Feature: Test
Scenario: Run a step
When I run a single step
- Add step definition:
features/step_definitions/test.rb
# frozen_string_literal: true
When('I run a single step') do
expect(1).to eq(1)
end
- Run
bundle install
- Run
bundle exec cucumber --format html --out report.html
π Any additional context?
I found that the probable cause was that output_envelope is defined but not subscribed to the :envelope event
I am working around the issue with this monkey-patch:
features/support/html_formatter_fix.rb
# frozen_string_literal: true
require 'cucumber/formatter/html'
module Cucumber
module Formatter
class HTML
alias _bugfix_original_initialize initialize
def initialize(config)
_bugfix_original_initialize(config)
config.on_event(:envelope) do |event|
envelope = event.envelope
@html_formatter.write_message(envelope)
@html_formatter.write_post_message if envelope.test_run_finished
end
end
end
end
end
π What did you see?
The generated HTML report ends with this line:
β What did you expect to see?
window.CUCUMBER_MESSAGES array should be populated:
π¦ Which tool/library version are you using?
ruby v4.0.5
cucumber-ruby v11.1.0
linux
π¬ How could we reproduce it?
Gemfilefeatures/feature/test.featurefeatures/step_definitions/test.rbbundle installbundle exec cucumber --format html --out report.htmlπ Any additional context?
I found that the probable cause was that output_envelope is defined but not subscribed to the :envelope event
I am working around the issue with this monkey-patch:
features/support/html_formatter_fix.rb