gkushang / cucumber-html-reporter

Generates Cucumber HTML reports in three different themes
MIT License
234 stars 156 forks source link

being able to attach multiple images #84

Open lenntt opened 7 years ago

lenntt commented 7 years ago

I've a test that does an image comparison and would like to have the reference, actual and diff image all in the html report. but as long as there is a single step.image, I can't have them all in the same view.

Simple way to reproduce:

driver.takeScreenshot().then(function (buffer) {
    return scenario.attach(new Buffer(buffer, 'base64'), 'image/png');
    return scenario.attach(new Buffer(buffer, 'base64'), 'image/png'); // or even better: another buffer
}

Expected result: 2 (similar) images in the report

Current result: 1 image in the report

gkushang commented 7 years ago

@lenntt

There is an open PR for this feature. We will work on it on releasing soon.

Thanks!

AltarBeastiful commented 7 years ago

With this we could have a screenshot for each step of the test, wether they pass or fail. This would be useful when debugging failed steps. It's sometimes pretty useful to see screenshots for all the steps following an error.

If possible I'd like to mimic the "Inline screenshots" feature of protractor-beautiful-reporter :

image

rkrisztian commented 6 years ago

@AltarBeastiful, it doesn't seem like you're talking about the same thing, but check out https://github.com/cucumber/cucumber-js/issues/997#issuecomment-377212613 to see how I do it.

krarpitgupta commented 3 years ago

@gkushang Are we planning to implement it, I have similar requirement where need to attach multiple screenshots to a cucumber steps ?

david-vankampen commented 5 months ago

@lenntt

There is an open PR for this feature. We will work on it on releasing soon.

Thanks!

@gkushang I know its been several years, but is this feature still possible to merge? Being able to attach multiple images to a single step would be very helpful. Right now it appears that while it loops on the embeddings attribute of each step, step.image is a singular item, so it will only keep the last image, whereas if step.image was an array, it could keep multiple. Same for other attachment types (text, logs, etc.).