opnsense-nordvpn-plugin/tests/ui/playwright.config.js

25 lines
704 B
JavaScript

const { defineConfig } = require('@playwright/test');
const baseURL = process.env.OPNSENSE_UI_BASE_URL;
if (!baseURL) {
throw new Error('Set OPNSENSE_UI_BASE_URL to the disposable OPNsense WebGUI URL.');
}
const hostname = new URL(baseURL).hostname;
const isLoopback = ['127.0.0.1', '::1', '[::1]', 'localhost'].includes(hostname);
if (!isLoopback && process.env.OPNSENSE_UI_TEST_ALLOW_REMOTE !== '1') {
throw new Error('Set OPNSENSE_UI_TEST_ALLOW_REMOTE=1 to test a remote disposable OPNsense deployment.');
}
module.exports = defineConfig({
testDir: './specs',
timeout: 30000,
workers: 1,
use: {
baseURL,
ignoreHTTPSErrors: isLoopback,
trace: 'retain-on-failure',
},
});