From 4db7dc89c752ade053fe18f2255e5a8f03632ca8 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 13 Oct 2021 14:07:37 -0700 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Create=20generateScr?= =?UTF-8?q?eenshotPath=20as=20test=20helper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create generateScreenshotPath as test helper --- ui/desktop/tests/end2end/targets.spec.js | 7 +++++++ ui/desktop/tests/end2end/test-helpers.js | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/ui/desktop/tests/end2end/targets.spec.js b/ui/desktop/tests/end2end/targets.spec.js index 2ee467d17..e3d59c558 100644 --- a/ui/desktop/tests/end2end/targets.spec.js +++ b/ui/desktop/tests/end2end/targets.spec.js @@ -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({ diff --git a/ui/desktop/tests/end2end/test-helpers.js b/ui/desktop/tests/end2end/test-helpers.js index ff6902143..ffd01eae8 100644 --- a/ui/desktop/tests/end2end/test-helpers.js +++ b/ui/desktop/tests/end2end/test-helpers.js @@ -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)