Files
threshold-ui/ui/desktop/tests/end2end/test-helpers.js
T
Carlos Alcaide Corvo fe48e0eba2 refactor: 💡 Create generateScreenshotPath as test helper
Create generateScreenshotPath as test helper
2021-10-15 09:34:18 -07:00

19 lines
607 B
JavaScript

/* eslint-disable no-undef */
const path = require('path');
/**
*
* @param {string} screenshotTestDirectory screenshot directory for the specific test suite
* @param {string} fileName The file name.
* @returns A full path where to save the screenshot.
*/
exports.generateScreenshotPath = (screenshotTestDirectory, fileName) => {
const screenshotFormat = '.png';
const screenshotsRootPath = path.join(__dirname, '/screenshots/');
const screenshotPath = path.join(
screenshotsRootPath,
screenshotTestDirectory
);
return path.join(screenshotPath, fileName).concat(screenshotFormat);
};