New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

codeceptjs-video-helper

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codeceptjs-video-helper - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

34

index.js

@@ -5,3 +5,3 @@ const path = require('path')

class VideoHelper extends Helper {
class VideoHelper extends Helper {
_init() {

@@ -14,3 +14,3 @@ this.events = []

const pw = this.helpers.Playwright
//console.log("PW", pw)
//console.log("PW", pw)
let videoDir = pw.config?.emulate?.recordVideo?.dir

@@ -32,3 +32,5 @@ if(!videoDir) return

await fs.promises.writeFile(path.resolve(videoDir, 'scenario.json'), scenarioJson)
const videos = [mainVideoPath].concat(this.events.map(ev => ev.video).filter(x => !!x))
const videos = Array.from(new Set(
[mainVideoPath].concat(this.events.map(ev => ev.video).filter(x => !!x))
))
const producers = videos.map(video =>

@@ -55,3 +57,3 @@ ` <producer id="${path.basename(video).split('.')[0]}">\n` +

`out="${((at - currentProducer.start) / timePerFrame) | 0}"></entry>`)
currentProducer = to

@@ -79,4 +81,4 @@ lastProducerChange = at

`out="${((this.events.slice(-1)[0].at - currentProducer.start) / timePerFrame) | 0}"></entry>`)
const multitrack =

@@ -92,3 +94,3 @@ ` <tractor>\n` +

const mlt = `<mlt>\n${producers}\n${multitrack}\n</mlt>`
console.log("MLT:\n"+mlt)
//console.log("MLT:\n"+mlt)
await fs.promises.writeFile(path.resolve(videoDir, 'scenario.mlt'), mlt)

@@ -98,3 +100,3 @@ }

async videoWait(n) {
const pw = this.helpers.Playwright
const pw = this.helpers.Playwright
if(pw.config?.emulate?.recordVideo) await pw.wait(n)

@@ -113,3 +115,3 @@ }

//console.log("SESSION START", sessionName)
savedSessionName = sessionName
savedSessionName = sessionName
const emulate = pw.config?.emulate

@@ -123,3 +125,3 @@ const recordVideo = emulate?.recordVideo

const page = context._pages.values().next()?.value
const video = page?.video()
const video = page?.video()
this.events.push({ type: 'startSession', session: sessionName, at: Date.now(), video })

@@ -154,10 +156,14 @@ return context

}
_after(test) {
_after(test) {
this.events.push({ type: 'leaveTest', test: this.currentTest, at: Date.now() })
this.currentTest = null
}
_beforeStep(step) {
_beforeStep(step) {
const pw = this.helpers.Playwright
const page = pw.browserContext._pages.values().next()?.value
const video = page?.video()
this.events.push({
type: 'enterStep', prefix: step.prefix, actor: step.actor, args: step.args, suffix: step.suffix,
at: Date.now()
at: Date.now(),
video
})

@@ -175,3 +181,3 @@ }

}
_passed(test) {
_passed(test) {
this.events.push({ type: 'testPassed', test: test.title, at: Date.now() })

@@ -178,0 +184,0 @@ }

{
"name": "codeceptjs-video-helper",
"version": "0.1.0",
"version": "0.1.1",
"description": "CodeceptJS Helper for multi sesssion video recording",

@@ -24,4 +24,4 @@ "main": "index.js",

"dependencies": {
"@codeceptjs/helper": "^1.0.2"
"@codeceptjs/helper": "^1.0.2"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc