Skip to content
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

Screenshots are broken in the html report in the recent versions of cucumber #2458

Open
singhm13-nih opened this issue Dec 20, 2024 · 0 comments

Comments

@singhm13-nih
Copy link

👓 What did you see?

i'm using cucumber-js with nightwatch. I recently upgraded cucumber version from 8.11.1 --> 11.1.1. After upgrading I noticed the attached screenshots in the html report appears as broken image. I didn't change any code other than upgrading the dependency version. I downgraded to the version 8.11.1 and screenshot attachments are working fine. I'm not sure from what version it is broken as I tried few recent version and it showing the broken image in the report. Adding the piece of code, that I'm using:

await browser.saveScreenshot(filePath);

if(attachToReport) {
    const screenshotData = fs.readFileSync(filePath, {encoding: 'base64'});
    this.attach(screenshotData, 'image/png'); // Attach screenshot to the JSON output
}

✅ What did you expect to see?

Screenshot attachment should not be corrupted when attaching to the report

📦 Which tool/library version are you using?

node v20.12.2
cucumber 11.1.1
nightwatch 3.7.0

🔬 How could we reproduce it?

  1. setup basic project with nightwatch and cucumber
  2. Attach the screenshot using the code snippet( added in the description)
  3. Generate html report from cucumber json

📚 Any additional context?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant