Append datetime string to end of filename for screenshot

This commit is contained in:
Jon Lane 2022-01-04 10:34:30 -08:00
parent aee1f0880f
commit 333ea308b8
1 changed files with 3 additions and 2 deletions

View File

@ -8,8 +8,9 @@ const { resolveLocalE2ePath } = require( './test-config' );
* @param message
* @return {Promise<{filePath: string, title: string}|{filePath: *, title: *}>}
*/
const takeScreenshotFor = async ( message ) => {
const title = message.replace( /\.$/, '' );
const takeScreenshotFor = async (message) => {
let now = new Date();
const title = `${message.replace( /\.$/, '' )}-${now.getDate()}${now.getHours()}${now.getMinutes()}${now.getSeconds()}`;
const savePath = resolveLocalE2ePath( 'screenshots' );
const filePath = path.join(
savePath,