Skip to content

test(nextjs): Run e2e tests for nextjs-15 in turbopack #17018

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jul 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dev-packages/e2e-tests/test-applications/nextjs-15/.npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
@sentry:registry=http://127.0.0.1:4873
@sentry-internal:registry=http://127.0.0.1:4873
public-hoist-pattern[]=*import-in-the-middle*
public-hoist-pattern[]=*require-in-the-middle*
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
"clean": "npx rimraf node_modules pnpm-lock.yaml",
"test:prod": "TEST_ENV=production playwright test",
"test:dev": "TEST_ENV=development playwright test",
"test:dev-turbo": "TEST_ENV=dev-turbopack playwright test",
"test:build": "pnpm install && pnpm build",
"test:build-canary": "pnpm install && pnpm add next@canary && pnpm add react@beta && pnpm add react-dom@beta && pnpm build",
"//": "15.0.0-canary.194 is the canary release attached to Next.js RC 1. We need to use the canary version instead of the RC because PPR will not work without. The specific react version is also attached to RC 1.",
"test:build-latest": "pnpm install && pnpm add next@15.0.0-canary.194 && pnpm add react@19.0.0-rc-cd22717c-20241013 && pnpm add react-dom@19.0.0-rc-cd22717c-20241013 && pnpm build",
"test:build-turbo": "pnpm install && pnpm add next@15.4.2-canary.1 && next build --turbopack",
"test:assert": "pnpm test:prod && pnpm test:dev"
},
"dependencies": {
Expand All @@ -19,7 +21,7 @@
"@types/react": "18.0.26",
"@types/react-dom": "18.0.9",
"ai": "^3.0.0",
"next": "15.3.0-canary.33",
"next": "15.4.2-canary.1",
"react": "beta",
"react-dom": "beta",
"typescript": "~5.0.0",
Expand All @@ -41,6 +43,11 @@
{
"build-command": "test:build-latest",
"label": "nextjs-15 (latest)"
},
{
"build-command": "test:build-turbo",
"assert-command": "pnpm test:prod && pnpm test:dev-turbo",
"label": "nextjs-15 (turbo)"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,24 @@ if (!testEnv) {
throw new Error('No test env defined');
}

const getStartCommand = () => {
if (testEnv === 'dev-turbopack') {
return 'pnpm next dev -p 3030 --turbopack';
}

if (testEnv === 'development') {
return 'pnpm next dev -p 3030';
}

if (testEnv === 'production') {
return 'pnpm next start -p 3030';
}

throw new Error(`Unknown test env: ${testEnv}`);
};

const config = getPlaywrightConfig({
startCommand: testEnv === 'development' ? 'pnpm next dev -p 3030' : 'pnpm next start -p 3030',
startCommand: getStartCommand(),
port: 3030,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { expect, test } from '@playwright/test';
import { waitForTransaction } from '@sentry-internal/test-utils';

test('Prefetch client spans should have a http.request.prefetch attribute', async ({ page }) => {
test.skip(process.env.TEST_ENV === 'development', "Prefetch requests don't have the prefetch header in dev mode");
test.skip(
process.env.TEST_ENV === 'development' || process.env.TEST_ENV === 'dev-turbopack',
"Prefetch requests don't have the prefetch header in dev mode",
);

const pageloadTransactionPromise = waitForTransaction('nextjs-15', async transactionEvent => {
return transactionEvent?.transaction === '/prefetching';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
"test:dev": "TEST_ENV=development playwright test",
"test:build": "pnpm install && pnpm build",
"test:build-canary": "pnpm install && pnpm add next@canary && pnpm add react@canary && pnpm add react-dom@canary && pnpm build",
"test:build-latest": "pnpm install && pnpm add next@latest && pnpm add react@rc && pnpm add react-dom@rc && pnpm build",
"test:build-latest": "pnpm install && pnpm add next@latest && pnpm build",
"test:assert": "pnpm test:prod && pnpm test:dev"
},
"dependencies": {
"@sentry/nextjs": "latest || *",
"@types/node": "^18.19.1",
"@types/react": "18.0.26",
"@types/react-dom": "18.0.9",
"@types/react": "^19",
"@types/react-dom": "^19",
"next": "^15.3.5",
"react": "rc",
"react-dom": "rc",
"react": "^19",
"react-dom": "^19",
"typescript": "~5.0.0"
},
"devDependencies": {
Expand Down
Loading