Files
supabase/tests/studio-tests/base.ts
Joshen Lim ca37f16f58 Chore/refactor e2e tests (#33647)
* Set up E2E tests for staging

* update

* Update

* Update .env.staging.example

* Fix node modules

* Fix

* Attempt to swap local-studio-tests to use the new studio-tests directory

* Omit storage state if running tests for local self host

* Fix test:local command

* Deprecate local-studio-test folder

* Rename local studio tests GH action to E2E test
2025-02-20 12:02:41 +08:00

26 lines
582 B
TypeScript

import { test as base } from '@playwright/test'
import dotenv from 'dotenv'
import path from 'path'
dotenv.config({
path: path.resolve(__dirname, process.env.ENV === 'staging' ? '../.env.staging' : ''),
override: true,
})
export interface TestOptions {
env: string
ref: string
apiUrl: string
}
export const test = base.extend<TestOptions>({
env: process.env.ENV,
ref: process.env.PROJECT_REF,
apiUrl:
process.env.ENV === 'local'
? 'http://localhost:8082/api'
: process.env.ENV === 'staging'
? 'https://api.supabase.green'
: '',
})