refactor: 💡 Move returnExecutablePath to e2e test helpers
Move returnExecutablePath to end to end test helpers file. Now the two test files are importing the function from the test helpers file.
This commit is contained in:
1 parent
4db7dc89c7
commit
c056b27176
2 files changed
-14
No files matched your search
@@ -1,7 +1,6 @@
|
||||
/* eslint-disable no-undef */
|
||||
const { test, expect } = require('@playwright/test');
|
||||
const { _electron: electron } = require('playwright');
|
||||
<<<<<<< HEAD
|
||||
const {
|
||||
generateScreenshotPath,
|
||||
returnExecutablePath,
|
||||
@@ -10,12 +9,6 @@ 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({
|
||||
|
||||
@@ -9,18 +9,13 @@ 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
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -47,5 +42,3 @@ exports.returnExecutablePath = (platform, arch) => {
|
||||
console.error(error);
|
||||
}
|
||||
};
|
||||
=======
|
||||
>>>>>>> 8c489b81 (refactor: 💡 Create generateScreenshotPath as test helper)
|
||||
Reference in new issue
Block a user