refactor: 💡 Create generateScreenshotPath as test helper
Create generateScreenshotPath as test helper
This commit is contained in:
1 parent
2a3c65678e
commit
4db7dc89c7
2 files changed
+14
No files matched your search
@@ -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({
|
||||
|
||||
@@ -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)
|
||||
Reference in new issue
Block a user