Skip to content

Commit

Permalink
fix: code
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Aug 30, 2024
1 parent 36ca270 commit deed016
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/helper/Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -3920,15 +3920,18 @@ async function refreshContextSession() {
function saveVideoForPage(page, name) {
if (!page.video()) return null
const fileName = `${`${global.output_dir}${pathSeparator}videos${pathSeparator}${uuidv4()}_${clearString(name)}`.slice(0, 245)}.webm`
page.video().saveAs(fileName)
if (!page) return
page
.video()
.delete()
.catch((e) => {})
.saveAs(fileName)
.then(() => {
if (!page) return
page
.video()
.delete()
.catch(() => {})
})
return fileName
}

async function saveTraceForContext(context, name) {
if (!context) return
if (!context.tracing) return
Expand Down

0 comments on commit deed016

Please sign in to comment.