Comparing version 19.1.4 to 19.1.5
@@ -19,2 +19,6 @@ 'use strict'; | ||
}, | ||
getVideoName: async (context) => { | ||
const filePath = await context.getScreenshot(context, { video: true }); | ||
return path.basename(filePath); | ||
}, | ||
exit: async (context, failData) => { | ||
@@ -21,0 +25,0 @@ await context.stopDevice(); |
{ | ||
"name": "uitest", | ||
"version": "19.1.4", | ||
"version": "19.1.5", | ||
"description": "Run mocha in a browser environment.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -62,6 +62,17 @@ ;(function() { | ||
saveVideo(context) { | ||
return new Promise((resolve, reject) => { | ||
window.__execCommand('getVideoName').then(name => { | ||
const filePath = `./screenshots/${name}`; | ||
this.appendToContext(context, filePath); | ||
resolve(filePath); | ||
}); | ||
}); | ||
}, | ||
saveScreenshot(context) { | ||
return new Promise((resolve, reject) => { | ||
const name = `${getUUID()}.png`; | ||
this.appendToContext(context, `./screenshots/${name}`); | ||
const filePath = `./screenshots/${name}`; | ||
this.appendToContext(context, filePath); | ||
resolve(this.screenshot(name)); | ||
@@ -72,3 +83,4 @@ }); | ||
screenshot(name) { | ||
return window.__execCommand('screenshot', './reports/screenshots/' + name); | ||
const filePath = `./reports/screenshots/${name}`; | ||
return window.__execCommand('screenshot', filePath); | ||
}, | ||
@@ -75,0 +87,0 @@ |
549699
14575