fix(e2e): keep localhost baseUrl; bind dev server to 0.0.0.0
This commit is contained in:
8
.github/workflows/ci.yml
vendored
8
.github/workflows/ci.yml
vendored
@@ -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 }}
|
||||
|
||||
@@ -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}",
|
||||
|
||||
Reference in New Issue
Block a user