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

25 lines
690 B
JavaScript
Raw Permalink Normal View History

2026-08-07 00:29:07 +09:00
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.');
}
2026-08-07 00:29:07 +09:00
module.exports = defineConfig({
testDir: './specs',
timeout: 30000,
workers: 1,
use: {
baseURL,
ignoreHTTPSErrors: isLoopback,
2026-08-07 01:02:10 +09:00
trace: 'off',
2026-08-07 00:29:07 +09:00
},
});