Skip to content

Commit 119ed2f

Browse files
committed
Add E2E test scripts and related fixes
- Add test:e2e and test:e2e:build scripts to package.json - Fix baseURL in auth test helper for Docker environment - Ignore apps/api/temp directory - Update Next.js route types path
1 parent b48cf1c commit 119ed2f

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ uploads/
5858
*.lcov
5959
apps/web/auth-debug.png
6060
test-results/.last-run.json
61+
/apps/api/temp

apps/web/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/types/routes.d.ts";
3+
import "./.next/dev/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/web/tests/helpers/auth.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ export async function loginViaUI(page: Page, email: string, password: string, na
9393
role: email === TEST_ADMIN.email ? 'admin' : 'user',
9494
});
9595

96-
await page.goto('/sign-in');
96+
// Use baseURL from page or fall back to localhost
97+
const baseUrl = process.env.BASE_URL || 'http://localhost:3000';
98+
await page.goto(`${baseUrl}/sign-in`);
9799
await page.waitForLoadState('networkidle');
98100

99101
// Fill in credentials

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"dev": "turbo dev",
88
"lint": "turbo lint",
99
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
10-
"knip": "knip"
10+
"knip": "knip",
11+
"test:e2e": "docker-compose -f docker-compose.e2e.yml up --abort-on-container-exit --build",
12+
"test:e2e:build": "docker build -f Dockerfile.e2e -t crackhouse-e2e ."
1113
},
1214
"devDependencies": {
1315
"@eslint/js": "^9.38.0",

0 commit comments

Comments
 (0)