codeceptjs-video-helper
Advanced tools
Comparing version 0.1.2 to 0.1.3
29
index.js
@@ -17,19 +17,24 @@ const path = require('path') | ||
if(!videoDir) return | ||
const mainVideo = pw.page?.video() | ||
let mainVideoPath = mainVideo && await mainVideo.path() | ||
if(mainVideoPath) mainVideoPath = path.relative(videoDir, mainVideoPath) | ||
this.start = this.events[0].at | ||
for(const event of this.events) { | ||
if(event.video) { | ||
event.video = path.relative(videoDir, await event.video.path()) | ||
if(this.events.length) { | ||
this.start = this.events[0].at | ||
for (const event of this.events) { | ||
if (event.video) { | ||
event.video = path.relative(videoDir, await event.video.path()) | ||
} | ||
event.at -= this.start | ||
} | ||
event.at -= this.start | ||
} | ||
this.events.unshift({ type:'init', video: mainVideoPath }) | ||
const scenarioJson = this.events.map(x => JSON.stringify(x)).join('\n') | ||
//console.log("EVENTS:\n" + scenarioJson) | ||
await fs.promises.writeFile(path.resolve(videoDir, 'scenario.json'), scenarioJson) | ||
const mainVideo = pw.page?.video() | ||
if(!mainVideo) return | ||
/// TODO: rewrite mlt export for multiple tests support | ||
let mainVideoPath = await mainVideo.path() | ||
mainVideoPath = path.relative(videoDir, mainVideoPath) | ||
const videos = Array.from(new Set( | ||
(mainVideoPath && [mainVideoPath]).concat(this.events.map(ev => ev.video).filter(x => !!x)) | ||
[mainVideoPath].concat(this.events.map(ev => ev.video).filter(x => !!x)) | ||
)) | ||
@@ -36,0 +41,0 @@ const producers = videos.map(video => |
{ | ||
"name": "codeceptjs-video-helper", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "CodeceptJS Helper for multi sesssion video recording", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
168
9091