Constrain UI tests to disposable targets
This commit is contained in:
parent
1ef0b80415
commit
7c4f4ffe0d
1 changed files with 18 additions and 9 deletions
|
|
@ -6,13 +6,20 @@ 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: true,
|
||||
ignoreHTTPSErrors: isLoopback,
|
||||
trace: 'retain-on-failure',
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue