test: parameterize CHRNX browser environment
This commit is contained in:
2 files changed
+10
-1
No files matched your search
@@ -8,7 +8,7 @@ export default defineConfig({
|
|||||||
retries: process.env.CI ? 2 : 0,
|
retries: process.env.CI ? 2 : 0,
|
||||||
reporter: 'html',
|
reporter: 'html',
|
||||||
use: {
|
use: {
|
||||||
baseURL: 'http://localhost:8888',
|
baseURL: process.env.CHRNX_E2E_BASE_URL || 'http://localhost:8888',
|
||||||
trace: 'on-first-retry',
|
trace: 'on-first-retry',
|
||||||
},
|
},
|
||||||
projects: [
|
projects: [
|
||||||
|
|||||||
@@ -2,6 +2,15 @@ import assert from 'node:assert/strict';
|
|||||||
import { readFile, readdir } from 'node:fs/promises';
|
import { readFile, readdir } from 'node:fs/promises';
|
||||||
import test from 'node:test';
|
import test from 'node:test';
|
||||||
|
|
||||||
|
test( 'Playwright selects an environment-specific base URL with a root default', async () => {
|
||||||
|
const config = await readFile( 'playwright.config.mjs', 'utf8' );
|
||||||
|
|
||||||
|
assert.match(
|
||||||
|
config,
|
||||||
|
/baseURL:\s*process\.env\.CHRNX_E2E_BASE_URL\s*\|\|\s*['"]http:\/\/localhost:8888['"]/,
|
||||||
|
);
|
||||||
|
} );
|
||||||
|
|
||||||
test( 'Playwright seeds deterministic local fixtures once outside browser workers', async () => {
|
test( 'Playwright seeds deterministic local fixtures once outside browser workers', async () => {
|
||||||
const config = await readFile( 'playwright.config.mjs', 'utf8' );
|
const config = await readFile( 'playwright.config.mjs', 'utf8' );
|
||||||
const setup = await readFile( 'tests/e2e/global-setup.mjs', 'utf8' );
|
const setup = await readFile( 'tests/e2e/global-setup.mjs', 'utf8' );
|
||||||
|
|||||||
Reference in new issue
Block a user