(page, name)
| 4819 | } |
| 4820 | |
| 4821 | function saveVideoForPage(page, name) { |
| 4822 | if (!page.video()) return null |
| 4823 | const fileName = `${`${store.outputDir}${pathSeparator}videos${pathSeparator}${uuidv4()}_${clearString(name)}`.slice(0, 245)}.webm` |
| 4824 | page |
| 4825 | .video() |
| 4826 | .saveAs(fileName) |
| 4827 | .then(() => { |
| 4828 | if (!page) return |
| 4829 | page |
| 4830 | .video() |
| 4831 | .delete() |
| 4832 | .catch(() => {}) |
| 4833 | }) |
| 4834 | return fileName |
| 4835 | } |
| 4836 | async function saveTraceForContext(context, name) { |
| 4837 | if (!context) return |
| 4838 | if (!context.tracing) return |
no test coverage detected