refactor: 💡 Create generateScreenshotPath as test helper

Create generateScreenshotPath as test helper
This commit is contained in:
Carlos Alcaide Corvo committed 2021-10-18 11:08:19 -07:00
1 parent 2a3c65678e
commit 4db7dc89c7
2 files changed
+14

No files matched your search

+7
View File
@@ -1,6 +1,7 @@
/* eslint-disable no-undef */
const { test, expect } = require('@playwright/test');
const { _electron: electron } = require('playwright');
<<<<<<< HEAD
const {
generateScreenshotPath,
returnExecutablePath,
@@ -9,6 +10,12 @@ const {
let electronApp = null;
const screenshotsDirectory = 'targets/';
const executablePath = returnExecutablePath(process.platform, process.arch);
=======
const { generateScreenshotPath } = require('./test-helpers');
let electronApp = null;
const screenshotsDirectory = 'targets/';
>>>>>>> 8c489b81 (refactor: 💡 Create generateScreenshotPath as test helper)
test.beforeEach(async () => {
electronApp = await electron.launch({
+7
View File
@@ -9,13 +9,18 @@ const path = require('path');
*/
exports.generateScreenshotPath = (screenshotTestDirectory, fileName) => {
const screenshotFormat = '.png';
<<<<<<< HEAD
const screenshotsRootPath = path.join(__dirname, 'screenshots');
=======
const screenshotsRootPath = path.join(__dirname, '/screenshots/');
>>>>>>> 8c489b81 (refactor: 💡 Create generateScreenshotPath as test helper)
const screenshotPath = path.join(
screenshotsRootPath,
screenshotTestDirectory
);
return path.join(screenshotPath, fileName).concat(screenshotFormat);
};
<<<<<<< HEAD
/**
*
@@ -42,3 +47,5 @@ exports.returnExecutablePath = (platform, arch) => {
console.error(error);
}
};
=======
>>>>>>> 8c489b81 (refactor: 💡 Create generateScreenshotPath as test helper)