fix(e2e): keep localhost baseUrl; bind dev server to 0.0.0.0

This commit is contained in:
Kunal
2026-02-07 19:02:17 +00:00
parent f2f1ac5bb2
commit 388402b834
2 changed files with 3 additions and 7 deletions

View File

@@ -110,9 +110,9 @@ jobs:
CLERK_JWKS_URL: ${{ vars.CLERK_JWKS_URL }}
run: |
cd frontend
npm run dev -- --hostname 127.0.0.1 --port 3000 &
npm run dev -- --hostname 0.0.0.0 --port 3000 &
for i in {1..60}; do
if curl -sf http://127.0.0.1:3000/ > /dev/null; then exit 0; fi
if curl -sf http://localhost:3000/ > /dev/null; then exit 0; fi
sleep 2
done
echo "Frontend did not start"
@@ -121,10 +121,6 @@ jobs:
- name: Run Cypress E2E
env:
NEXT_TELEMETRY_DISABLED: "1"
# Prefer IPv4 to avoid localhost -> ::1 issues when Next binds only to 127.0.0.1.
NODE_OPTIONS: "--dns-result-order=ipv4first"
# Force Cypress to use 127.0.0.1 as baseUrl (Cypress only auto-loads CYPRESS_* into Cypress.env()).
CYPRESS_baseUrl: "http://127.0.0.1:3000"
# Vars for shared Clerk OTP helper (frontend/cypress/support/commands.ts)
CYPRESS_CLERK_ORIGIN: ${{ vars.CYPRESS_CLERK_ORIGIN }}
CYPRESS_CLERK_TEST_EMAIL: ${{ vars.CYPRESS_CLERK_TEST_EMAIL }}

View File

@@ -2,7 +2,7 @@ import { defineConfig } from "cypress";
export default defineConfig({
e2e: {
baseUrl: "http://127.0.0.1:3000",
baseUrl: "http://localhost:3000",
video: false,
screenshotOnRunFailure: true,
specPattern: "cypress/e2e/**/*.cy.{ts,tsx,js,jsx}",