Skip to content

Commit f01da04

Browse files
authored
test: only build nuxt once for browser tests (#423)
1 parent 202b582 commit f01da04

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
browser:
6262
runs-on: ubuntu-latest
6363
container:
64-
image: mcr.microsoft.com/playwright:v1.57.0-noble
64+
image: mcr.microsoft.com/playwright:v1.58.0-noble
6565

6666
steps:
6767
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

playwright.config.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,27 @@ 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,
911
forbidOnly: !!process.env.CI,
1012
retries: process.env.CI ? 2 : 0,
11-
workers: process.env.CI ? 1 : undefined,
1213
reporter: 'html',
1314
timeout: 120_000,
15+
webServer: {
16+
command: 'NODE_ENV=test pnpm build && pnpm preview --port 5678',
17+
url: baseURL,
18+
reuseExistingServer: false,
19+
timeout: 120_000,
20+
},
1421
use: {
22+
baseURL,
1523
trace: 'on-first-retry',
1624
nuxt: {
1725
rootDir: fileURLToPath(new URL('.', import.meta.url)),
26+
host: baseURL,
1827
},
1928
},
2029
projects: [

0 commit comments

Comments
 (0)