webdriverio-community / wdio-html-reporter

Fork of wdio-html-format-reporter
MIT License
18 stars 27 forks source link

Screenshots getting attached to next test step in wdio-html-nice-reporter when executed in Async Mode #88

Open rpeddini opened 2 years ago

rpeddini commented 2 years ago

Hi Team,

By referring the html-nice-reporter document from below URl, we have implemented wdio-html-nice-reporter in our framework. https://webdriver.io/docs/wdio-html-nice-reporter/

Our requirement is to attach the screenshot for failed test steps in master report.

Right now all test scripts in our framework are in sync mode. After making the necessary changes, we were able to see the screenshots to failed test steps in the html report as expected. But, when we shifted our framework to async mode, we are observing the below issue with the same changes -

  1. Screenshot is getting attached to next test step in master report. For Eg., if my test script has 10 test steps and 5,6,7,8,9,10 test steps are failed. In this scenario, 5th test step screenshot is getting attached to 6th test step, 6th test step screenshot is getting attached to 7th test step,....., at the end 9th & 10th test steps screenshots are getting attached to 10th test step.

We are using Javascript, wdio7 with mocha framework.

I have attached the package.json and wdio.conf.js files used in both sync and async modes. PFA files.

ScreenshotIssue_HTML_NICE_REPORTER wdio&package.json.zip

Note : We are using wdio-html-nice-reporter-7.9.1 right now. As we observed the issue, we have also tested with wdio-html-nice-reporter-8.0.2 (latest), observed the same issue in latest version also.

Please look into this and do the needful...!

Thanks & Regards, RajKumar Peddini

jklepek-vendavo commented 1 year ago

I noticed the same issue, although it's not consistent, I'm on version 8.1.0.

jklepek-vendavo commented 1 year ago

Can you look into this issue please?