Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix: Update e2e command to run webserver rather than asking devs to manaully start it (#40398)

Ali Waseemc76723c90920
diff --git a/e2e/studio/.env.local.example b/e2e/studio/.env.local.example
index 400bfc19a61..578b8354cc2 100644
--- a/e2e/studio/.env.local.example
+++ b/e2e/studio/.env.local.example
@@ -1,8 +1,8 @@
# Copy and paste this file and rename it to .env.local
-STUDIO_URL=http://127.0.0.1:54323
-API_URL=http://127.0.0.1:54323
+STUDIO_URL=http://localhost:8082
+API_URL=http://127.0.0.1:54321
IS_PLATFORM=false
# Used to run e2e tests against vercel previews
diff --git a/e2e/studio/README.md b/e2e/studio/README.md
index b3d031623e4..c59cf163e9c 100644
--- a/e2e/studio/README.md
+++ b/e2e/studio/README.md
@@ -16,16 +16,6 @@ cd e2e/studio
pnpm exec playwright install
```
-### Run a local Supabase instance
-
-Make sure you have Supabase CLI installed
-
-```bash
-cd e2e/studio
-
-supabase start
-```
-
---
## Running the tests
diff --git a/e2e/studio/playwright.config.ts b/e2e/studio/playwright.config.ts
index eec7e9d939d..dfb75c6ef29 100644
--- a/e2e/studio/playwright.config.ts
+++ b/e2e/studio/playwright.config.ts
@@ -3,10 +3,20 @@ import { env, STORAGE_STATE_PATH } from './env.config'
import dotenv from 'dotenv'
import path from 'path'
-dotenv.config({ path: path.resolve(__dirname, '.env.local') })
+dotenv.config({
+ path: path.resolve(__dirname, '.env.local'),
+})
const IS_CI = !!process.env.CI
+const webServerConfig = IS_CI
+ ? undefined
+ : {
+ command: 'pnpm -w run e2e:setup',
+ port: 8082,
+ timeout: 5 * 60 * 1000,
+ }
+
export default defineConfig({
timeout: 90 * 1000,
testDir: './features',
@@ -51,4 +61,5 @@ export default defineConfig({
['html', { open: 'never' }],
['json', { outputFile: 'test-results/test-results.json' }],
],
+ webServer: webServerConfig,
})
diff --git a/package.json b/package.json
index ab856099955..1ad7ff51243 100644
--- a/package.json
+++ b/package.json
@@ -29,15 +29,8 @@
"test:ui-patterns": "turbo run test --filter=ui-patterns",
"test:studio": "turbo run test --filter=studio",
"test:studio:watch": "turbo run test --filter=studio -- watch",
+ "e2e:setup": "pnpm setup:cli && NODE_ENV=test NODE_OPTIONS=\"--max-old-space-size=4096\" pnpm run build:studio && NODE_ENV=test pnpm --prefix ./apps/studio start --port 8082",
"e2e": "pnpm --prefix e2e/studio run e2e",
- "e2e:dev-hosted": "pnpm --prefix e2e/studio run e2e:dev-hosted",
- "e2e:dev-selfhosted": "pnpm --prefix e2e/studio run e2e:dev-selfhosted",
- "e2e:selfhosted": "pnpm --prefix e2e/studio run e2e:selfhosted",
- "e2e:staging": "pnpm --prefix e2e/studio run e2e:staging",
- "e2e:prod": "pnpm --prefix e2e/studio run e2e:prod",
- "e2e:ci": "pnpm --prefix e2e/studio run e2e:ci",
- "e2e:supabase:start": "pnpm --prefix e2e/studio run supabase:start",
- "e2e:supabase:stop": "pnpm --prefix e2e/studio run supabase:stop",
"perf:kong": "ab -t 5 -c 20 -T application/json http://localhost:8000/",
"perf:meta": "ab -t 5 -c 20 -T application/json http://localhost:5555/tables",
"setup:cli": "supabase start -x studio && supabase status --output json > keys.json && node scripts/generateLocalEnv.js",