-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
HTML cannot be rendered if a 'text/json' attachment is present #1787
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
Comments
@luke-hill It looks like @mitchgrout as a workaround can you turn the hash into a string when calling |
It does appear that an explicit {
"attachment": {
"body": "{\"foo\":42}",
"contentEncoding": "IDENTITY",
"mediaType": "text/json",
"testCaseStartedId": "d175d079-76cf-43ba-b6b6-77064365b781",
"testStepId": "0b071290-cd83-4db0-b7c1-b24fd9a8bf98"
}
} |
It's likely there is an issue. The html-formatter has another issue whereby errors aren't being rendered correctly. @mitchgrout so you know my rough priority / timelines.
I appreciate this is a long timeline, just lots of stuff for me to tackle. If you have capacity and want to look into the html formatter feel free. There are issues there with errors (I think it's using the wrong property) |
👓 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):✅ 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?
features/test.feature
with:features/step_definitions/all.rb
with:features/support/env.rb
with:cucumber -f html -o cucumber.html
cucumber.html
into a browser of choice, and check that:attachment
message is present in the message list, andattachment
message is removed, the page is rendered correctly📚 Any additional context?
No response
The text was updated successfully, but these errors were encountered: