diff --git a/src/index.ts b/src/index.ts index 2b18f73..e029061 100644 --- a/src/index.ts +++ b/src/index.ts @@ -295,12 +295,14 @@ export default class VideoReporter extends WdioReporter { if (!allureOutputDir) { return } - const abortTime = Date.now() + this.options.videoRenderTimeout + const abortTime = this.options.videoRenderTimeout + + const startTime = new Date().getTime() waitForVideosToExist(this.videos, abortTime) waitForVideosToBeWritten(this.videos, abortTime) - if (new Date().getTime() > abortTime) { + if (new Date().getTime() - startTime > abortTime) { console.log('videoRenderTimeout triggered, not all videos finished writing to disk before patching Allure') }