dx: couldn't run e2e "anew" more than once
Massimo Melina committed
Feb 21, 2026 at 17:29 UTC
79b0490f758af615183e63e9e96f2d5f17109668
3 files changed
+6
-3
e2e/frontend.spec.ts
+4
-1
@@ -306,7 +306,10 @@ async function screenshot(page: Page, selectorForMask = '') {
306
307
test('anew', async ({ page, browserName }) => {
308
if (page.viewportSize()?.width! < 1000 || browserName !== 'chromium') return // test only for desktop chromium
309
- await page.goto('http://localhost:82/')
309
+ await wait(500)
310
+ fs.writeFileSync('tests/work2/config.yaml', "port: 8082\nopen_browser_at_start: false\n")
311
+ await wait(2000)
312
+ await page.goto('http://localhost:8082/')
313
await expect(page.getByText('Nothing here')).toBeVisible()
314
await page.getByRole('button', { name: 'Options' }).click()
315
const page1Promise = page.waitForEvent('popup')
playwright.config.ts
+1
-2
@@ -102,8 +102,7 @@ export default defineConfig({
102
url: 'http://127.0.0.1:8081',
103
reuseExistingServer: !process.env.CI,
104
}, { // launch a second server for tests with an empty/default config
105
- command: 'rm -rf tests/work2 && node dist/src --cwd tests/work2 --debug --port 82 --open_browser_at_start false',
106
- url: 'http://127.0.0.1:82',
105
+ command: 'rm -rf tests/work2 && node dist/src --cwd tests/work2 --debug --open_browser_at_start false',
106
reuseExistingServer: !process.env.CI,
107
}]
108
});
src/config.ts
+1
@@ -202,6 +202,7 @@ export const configFile = watchLoad(filePath, text => {
202
try { return setConfig(yaml.parse(text, { uniqueKeys: false }) || {}, false) }
203
catch(e: any) { console.error("Error in", filePath, ':', e.message || String(e)) }
204
}, {
205
+ immediateFirst: true,
206
failedOnFirstAttempt(){
207
startedWithoutConfig = true
208
console.log("No config file, using defaults")