-
Notifications
You must be signed in to change notification settings - Fork 156
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
Supporting HTML tag in screenshot embeddings? #129
Comments
Hi, I subsequently made a small update in the lib/reporter.js with the following code in bold and it seems to work as I have requested above: if (embeddingType === 'text/plain' || embeddingType === 'text/html') { if (!step.text) { |
Here is the git diff. If this looks OK to you I can submit a PR. $ git diff lib/reporter.js - if (embeddingType === 'text/plain') { |
@xywang68 thanks for looking into it. Please submit a PR |
@gkushang , I tried to submit a branch to your git but got access denied. Can you grant permission for me to submit a branch? Or is there another way you prefer me to do? |
Thanks for the PR. All set! |
In order to avoid a huge cucumber-result.json file, instead of embedding the screenshot image as base64 data, I want to attach a HTML tag string like <img>. I am able to attach the tag using scenario.attach() call, but the cucumber-html-reporter is not showing.
Am I not doing this correctly? Otherwise can this be supported?
Here is my code in hooks.js:
var html_tag = '<img src="pulpitrock.jpg" alt="Mountain View">'; scenario.attach(Buffer.from(html_tag, 'utf-8'), 'text/html');
Here is the cucumber result JSON after run:
"embeddings": [ { "data": "PGltZyBzcmM9InB1bHBpdHJvY2suanBnIiBhbHQ9Ik1vdW50YWluIFZpZXciPg==", "mime_type": "text/html" } ],
which the data can be base64 decoded back to the original html_tag string.
The text was updated successfully, but these errors were encountered: