wdio-video-reporter icon indicating copy to clipboard operation
wdio-video-reporter copied to clipboard

Construct videos earlier and provide paths to attach to other reporters

Open mikesalvia opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe.

I want to be able to send the created video to ReportPortal, etc. Since all videos are constructed in onRunnerEnd the only place we can do this is onComplete which is kind of late.

Describe the solution you'd like

I want to have access to the last created video path as well as access to file in afterScenario.

Describe alternatives you've considered I have created a workaround storing values in JSON files but not 100% sure this will work.

Additional context None at the current time.

mikesalvia avatar May 25 '21 16:05 mikesalvia

When using this with wdio-reportportal-reporter/service I see lots of weird timing issues. :-(

mikesalvia avatar May 25 '21 21:05 mikesalvia

Toying with the idea of converting this to a service to fit my needs. I will let you know what I find. It does kind of make sense as a service IMO as it isn't generating a reporter but a service that is collecting further data points.

mikesalvia avatar May 26 '21 13:05 mikesalvia

@mikesalvia

Actually the video generation starts at each onTestEnd https://github.com/webdriverio-community/wdio-video-reporter/blob/main/src/index.js#L176

The problem with videos is that it takes a different amount of time to generate each video and write it to the hdd, so what you see at onRunnerEnd and onExit are functions that forces the selenium runner to stay open while videos are still being written to disk, as we had a bug previously where some videos were cut off in the middle.

What you can do is halt each test until its video is ready by using helpers.waitForVideosToExist, my guess is that it would slow down overall test-execution, which is why we wait for videos at the end, but it is possible.

Describe the solution you'd like I want to have access to the last created video path as well as access to file in afterScenario.

You have access to the path in onTestEnd Check: https://github.com/webdriverio-community/wdio-video-reporter/blob/main/src/helpers.js#L56 which is called from: https://github.com/webdriverio-community/wdio-video-reporter/blob/main/src/index.js#L176

presidenten avatar Jul 12 '21 12:07 presidenten

Thanks I will look into this.

mikesalvia avatar Jul 22 '22 04:07 mikesalvia

Closed thank you for the help!

mikesalvia avatar Mar 30 '23 15:03 mikesalvia