fix install config
This commit is contained in:
@@ -1,17 +1,8 @@
|
||||
import { chromium, FullConfig } from '@playwright/test';
|
||||
import { existsSync, renameSync } from 'fs';
|
||||
import { chromium, type FullConfig } from '@playwright/test';
|
||||
|
||||
import { ADMIN_USERNAME, ADMIN_PASSWORD, PORT } from '../constants';
|
||||
|
||||
export const CONFIG_FILE = 'AdGuardHome.yaml';
|
||||
export const TEMP_CONFIG_FILE = 'AdGuardHome.yaml.temp';
|
||||
|
||||
async function globalSetup(config: FullConfig) {
|
||||
// Backup existing config file if it exists
|
||||
if (existsSync(CONFIG_FILE)) {
|
||||
renameSync(CONFIG_FILE, TEMP_CONFIG_FILE);
|
||||
}
|
||||
|
||||
const browser = await chromium.launch({
|
||||
slowMo: 100,
|
||||
});
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
import { existsSync, renameSync, unlinkSync } from 'fs';
|
||||
import { CONFIG_FILE, TEMP_CONFIG_FILE } from './globalSetup';
|
||||
import { existsSync, unlinkSync } from 'fs';
|
||||
|
||||
export const CONFIG_FILE = '/tmp/AdGuard.temp.e2e.yaml';
|
||||
|
||||
async function globalTeardown() {
|
||||
// Remove the test config file
|
||||
if (existsSync(CONFIG_FILE)) {
|
||||
unlinkSync(CONFIG_FILE);
|
||||
}
|
||||
|
||||
// Restore the original config file if it exists
|
||||
if (existsSync(TEMP_CONFIG_FILE)) {
|
||||
renameSync(TEMP_CONFIG_FILE, CONFIG_FILE);
|
||||
}
|
||||
}
|
||||
|
||||
export default globalTeardown;
|
||||
|
||||
Reference in New Issue
Block a user