Open
Description
👓 What did you see?
Given an object
which represents some JSON object, attach(object, "text/json")
will correctly add an attachment envelope to the output message stream, and will be included in the HTML body. However, attempting to open this report (at least in Chrome) results in only a white screen being rendered.
If for example, object = { "foo": 42 }
, then within the message stream we have (prettified):
{
"attachment": {
"body": {"foo":42},
"contentEncoding": "IDENTITY",
"mediaType": "text/json",
"testCaseStartedId": "a92d9794-86d9-4c14-a913-1f8ddb736289",
"testStepId": "5996f98b-fe36-48e3-94be-b3b2433344c2"
}
}
✅ What did you expect to see?
The page should continue to be loadable, and either display the attached text/json
in a plaintext form or in any other way.
📦 Which tool/library version are you using?
cucumber-html-formatter v19.2.0
🔬 How could we reproduce it?
- Create
features/test.feature
with:
# features/test.feature
Feature: Reproduction of problem
Scenario: Example scenario
When nothing happens
- Create
features/step_definitions/all.rb
with:
When('nothing happens') { }
- Create
features/support/env.rb
with:
After do |test|
context = {
"foo" => 42,
}
attach(context, "text/json")
end
- Run
cucumber -f html -o cucumber.html
- Load the
cucumber.html
into a browser of choice, and check that:- only a white screen is displayed, and
- the
attachment
message is present in the message list, and - if the
attachment
message is removed, the page is rendered correctly
📚 Any additional context?
No response
Metadata
Metadata
Assignees
Labels
No labels