Files
supabase/e2e/studio/env.config.ts
Ali WaseemandCharis 22cfd2be14 feat: Run E2E tests aganist Platform Pt.1 (#41032)
* added packages for creating projects

* updated scripts

* remove ami version

* cleaned up common

* updated tests

* refactored helpers

* updated env

* updated config

* updated to reference env

* updated global setup

* updated type logic and scripts

* added mocking of hcaptcha

* added log statements

* updated local env

* update env file

* updated env vars

* updated logging

* updated to remove check

* updated print and project names

* updated helpers

* updated url

* updated setup

* updated storage helpers to account for listing files

* updated setup and tests

* updated timeout only for setup

* updated helper to account for different api response

* added ignores for tests

* updated lock file

* updated database spec to add exact

* updated timeouts

* removed check for table grid footer

* updated test runner

* updated is_platform

* updated playwright config

* updated worker settings

* removed dotenvx

* updated README

* updated to remove comment

* Update e2e/studio/scripts/common/retriedFetch.ts

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2025-12-05 10:50:16 -07:00

40 lines
1.3 KiB
TypeScript

import dotenv from 'dotenv'
import path from 'path'
// Load .env.local before reading process.env
dotenv.config({
path: path.resolve(import.meta.dirname, '.env.local'),
override: true,
})
const toBoolean = (value?: string) => {
if (value == null) return false
const normalized = value.trim().toLowerCase()
return normalized === 'true'
}
export const env = {
STUDIO_URL: process.env.STUDIO_URL || 'http://localhost:8082',
API_URL: process.env.API_URL || 'https://localhost:8080',
IS_PLATFORM: toBoolean(process.env.IS_PLATFORM || 'false'),
EMAIL: process.env.EMAIL,
PASSWORD: process.env.PASSWORD,
PROJECT_REF: process.env.PROJECT_REF || undefined,
VERCEL_AUTOMATION_BYPASS_SELFHOSTED_STUDIO:
process.env.VERCEL_AUTOMATION_BYPASS_SELFHOSTED_STUDIO || 'false',
ORG_SLUG: process.env.ORG_SLUG || 'default',
SUPA_REGION: process.env.SUPA_REGION || 'us-east-1',
SUPA_PAT: process.env.SUPA_PAT || 'test',
BRANCH_NAME: process.env.BRANCH_NAME || `e2e-test-local`,
AUTHENTICATION: Boolean(process.env.EMAIL && process.env.PASSWORD),
IS_APP_RUNNING_ON_LOCALHOST:
process.env.STUDIO_URL?.includes('localhost') || process.env.STUDIO_URL?.includes('127.0.0.1'),
}
export const STORAGE_STATE_PATH = path.join(import.meta.dirname, './playwright/.auth/user.json')