diff --git a/client/playwright.config.ts b/client/playwright.config.ts index f6871a03..1a6d2de9 100644 --- a/client/playwright.config.ts +++ b/client/playwright.config.ts @@ -1,6 +1,7 @@ import { defineConfig, devices } from '@playwright/test'; import path from 'path'; +import { CONFIG_FILE_PATH } from './tests/constants'; /** * See https://playwright.dev/docs/test-configuration. @@ -42,7 +43,7 @@ export default defineConfig({ webServer: { stdout: process.env.CI ? 'pipe' : 'ignore', - command: `${!process.env.CI ? 'sudo ' : ''}./AdGuardHome --local-frontend -v -c /tmp/AdGuard.temp.e2e.yaml`, + command: `${!process.env.CI ? 'sudo ' : ''}./AdGuardHome --local-frontend -v -c ${CONFIG_FILE_PATH}`, url: 'http://127.0.0.1:3000', cwd: '..', reuseExistingServer: !process.env.CI, diff --git a/client/tests/constants.ts b/client/tests/constants.ts index e3634d6e..48a47e5c 100644 --- a/client/tests/constants.ts +++ b/client/tests/constants.ts @@ -1,3 +1,4 @@ export const ADMIN_USERNAME = 'admin'; export const ADMIN_PASSWORD = 'superpassword'; export const PORT = 3000; +export const CONFIG_FILE_PATH = '/tmp/AdGuard.e2e.yaml'; diff --git a/client/tests/e2e/globalTeardown.ts b/client/tests/e2e/globalTeardown.ts index ae2b60e5..7d23273a 100644 --- a/client/tests/e2e/globalTeardown.ts +++ b/client/tests/e2e/globalTeardown.ts @@ -1,11 +1,10 @@ import { existsSync, unlinkSync } from 'fs'; - -export const CONFIG_FILE = '/tmp/AdGuard.temp.e2e.yaml'; +import { CONFIG_FILE_PATH } from '../constants'; async function globalTeardown() { // Remove the test config file - if (existsSync(CONFIG_FILE)) { - unlinkSync(CONFIG_FILE); + if (existsSync(CONFIG_FILE_PATH)) { + unlinkSync(CONFIG_FILE_PATH); } }