Open Sweetie7 opened 7 months ago
Node.js version: [21.7.3] NPM version: [10.5.0] webdriver.io version: [8.35.1] @wdio/cucumber-framework version: [8.35.0] wdio-cucumberjs-json-reporter version: [5.2.1] multiple-cucumber-html-reporter: [3.6.2],
I have configured in my webdriverio framework to create json file using wdio-cucumberjs-json-reporter, and then I am creating using the same json file html report using multiple-cucumber-html-reporter. I have added in Steps to capture screenshot using browser.saveScreenshot(), but this screenshots are not getting attached to html report.
I have added below lines in wdio.conf.js file.
I have a this step in StepDef where I am taking screenshot.
But when the report is generated, screenshot is not available with the step.
@Sweetie7 thanks for reporting! Any contributions are appreciated.
Hi @Sweetie7, Please try to use this one instead of browser.saveScreenshot:
import cucumberJson from 'wdio-cucumberjs-json-reporter';
cucumberJson.attach(await browser.takeScreenshot(), 'image/png');
Describe your question with as much detail as possible A clear and concise question that doesn't require too much conversation. Need more help? Find us on Discord
If it's about a specific piece of code, try and include some of it to support your question. [...]
Environment (please complete the following information):
Additional context Add any other context about the problem here.