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

Frames from a previous test/suite are being added to the next test/suite

Open Diazole opened this issue 2 years ago • 2 comments

Describe the bug The last frame from the previous test is incorrectly saved as the first frame of the current test.

On the last test, a screenshot was taken after the call to ffmpeg.

I'm not sure where to start looking to help diagnose this issue as it appears to be a sync problem.

Log I have trimmed some of the incoming commands as I don't believe they add value.

--- New suite: Test Suite 1 ---


--- New test: Test 1 ---
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 0)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 1)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 2)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 3)
ffmpeg command: "ffmpeg.exe" ...



--- New suite: Test Suite 2 ---


--- New test: Test 1 ---
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 4)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 0)
Incoming command: /session/:sessionId/element/55a8bedc-cca0-4e40-bdfc-9f70884dec4b/text => [text]
ffmpeg command: "ffmpeg.exe" ...



--- New suite: Test Suite 3 ---


--- New test: Test 1 ---
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 1)
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 0)
ffmpeg command: "ffmpeg.exe" ...
Incoming command: /session/:sessionId/screenshot => [screenshot]
- Screenshot!! (frame: 1)
Incoming command: /session/:sessionId => [:sessionId]

To Reproduce I'll attempt to create an example repo and update this issue soon

Expected behavior Frames from a previous test/suite shouldn't be added to the current test/suite

Environment (please complete the following information):

  • wdio-video-reporter version: 3.4.0
  • WebdriverIO version: 8.0.13
  • Mode: WDIO Testrunner
  • If WDIO Testrunner, running sync/async: async
  • Node.js version: v18.12.1
  • NPM version: 8.19.2
  • Browser name and version: Chrome 109

Diazole avatar Jan 19 '23 15:01 Diazole

I saw this behaviour as well when working on other issues in video-reporter, but the previous test frames were always saved into the correct folder - they were just returned late. Everything happens asynchronously internally, so the screenshots are received some time after they are requested. I also noticed that onTestStart for the next test was called before onTestEnd for the preceding test had completed in many cases.

Following the log output gave the impression of frames for different tests being mixed but examining the filesystem following the suite run showed everything to be in order.

Are you seeing different behaviour?

wadjei avatar Jan 26 '23 17:01 wadjei

@Diazole thanks for raising the issue. Mind providing a minimal reproducible example to help us investigate the issue?

christian-bromann avatar Jan 03 '24 03:01 christian-bromann