Skip to content

Commit c6b3fa1

Browse files
authored
test(nuxt): Fix nuxt-4 dev E2E test (#18737)
I was under the assumption that playwright will wait for the port `3030` to start testing (as it is configured like this). But it seems like playwright already starts testing when only the temporary port `3035` is available. This fix runs the bash script first and only then starts playwright. Closes #18728
1 parent 5901e70 commit c6b3fa1

3 files changed

Lines changed: 3 additions & 6 deletions

File tree

dev-packages/e2e-tests/test-applications/nuxt-4/nuxt-start-dev-server.bash

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,4 @@ else
4343
echo "Port $TEMP_PORT released successfully"
4444
fi
4545

46-
echo "Starting nuxt dev with Sentry server config..."
47-
48-
# 4. Start the actual dev command which should be used for the tests
49-
NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev
46+
echo "Nuxt dev server can now be started with '--import ./.nuxt/dev/sentry.server.config.mjs'"

dev-packages/e2e-tests/test-applications/nuxt-4/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"clean": "npx nuxi cleanup",
1313
"test": "playwright test",
1414
"test:prod": "TEST_ENV=production playwright test",
15-
"test:dev": "TEST_ENV=development playwright test environment",
15+
"test:dev": "bash ./nuxt-start-dev-server.bash && TEST_ENV=development playwright test environment",
1616
"test:build": "pnpm install && pnpm build",
1717
"test:build-canary": "pnpm add nuxt@npm:nuxt-nightly@latest && pnpm add nitropack@npm:nitropack-nightly@latest && pnpm install --force && pnpm build",
1818
"test:assert": "pnpm test:prod && pnpm test:dev"

dev-packages/e2e-tests/test-applications/nuxt-4/playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if (!testEnv) {
88

99
const getStartCommand = () => {
1010
if (testEnv === 'development') {
11-
return 'bash ./nuxt-start-dev-server.bash';
11+
return "NODE_OPTIONS='--import ./.nuxt/dev/sentry.server.config.mjs' nuxt dev -p 3030";
1212
}
1313

1414
if (testEnv === 'production') {

0 commit comments

Comments
 (0)