Skip to content

Commit 3df438f

Browse files
committed
test: only build nuxt once for browser tests
1 parent 202b582 commit 3df438f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

playwright.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { fileURLToPath } from 'node:url'
33
import { defineConfig, devices } from '@playwright/test'
44
import type { ConfigOptions } from '@nuxt/test-utils/playwright'
55

6+
const baseURL = 'http://localhost:5678'
7+
68
export default defineConfig<ConfigOptions>({
79
testDir: './tests',
810
fullyParallel: true,
@@ -11,10 +13,18 @@ export default defineConfig<ConfigOptions>({
1113
workers: process.env.CI ? 1 : undefined,
1214
reporter: 'html',
1315
timeout: 120_000,
16+
webServer: {
17+
command: 'NODE_ENV=test pnpm build && pnpm preview --port 5678',
18+
url: baseURL,
19+
reuseExistingServer: false,
20+
timeout: 60_000,
21+
},
1422
use: {
23+
baseURL,
1524
trace: 'on-first-retry',
1625
nuxt: {
1726
rootDir: fileURLToPath(new URL('.', import.meta.url)),
27+
host: baseURL,
1828
},
1929
},
2030
projects: [

0 commit comments

Comments
 (0)