Skip to content

fix: Playwright config baseURL hardcoded to localhost — cannot run against staging #373

@thewealthyplace

Description

@thewealthyplace

Bug

frontend/playwright.config.ts has:

baseURL: 'http://localhost:3000',

This makes it impossible to run E2E tests against a staging environment, CI testnet deployment, or any other URL without modifying the config file itself.

Fix

Read baseURL from an environment variable with a localhost fallback:

const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? 'http://localhost:3000';

export default defineConfig({
  use: { baseURL },
});

Add to frontend/.env.example:

# For running E2E tests against a remote environment
PLAYWRIGHT_BASE_URL=https://staging.astera.io

Update CI to pass the variable when running against testnet:

- name: Run E2E tests
  run: npm run test:e2e
  env:
    PLAYWRIGHT_BASE_URL: ${{ steps.deploy.outputs.frontend_url }}

Acceptance Criteria

  • baseURL reads from PLAYWRIGHT_BASE_URL env variable
  • Falls back to http://localhost:3000 when not set
  • .env.example documents the variable
  • CI sets the variable when running against deployed frontend

References

  • frontend/playwright.config.ts
  • .github/workflows/ci.yml — E2E test job

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions