Files
universe/playwright.config.ts
zeekayandHanzo AI 2453240bd7
Universe CI / Resolve Environment (push) Waiting to run
Universe CI / Update Manifest (push) Blocked by required conditions
Universe CI / E2E (push) Blocked by required conditions
CI/CD / render (push) Waiting to run
chain letters are lowercase
The primary-network chains answer to either case; one spelling beats two.
/v1/chain/c/rpc, /v1/chain/p, /v1/chain/x across the estate.

Co-authored-by: Hanzo AI <[email protected]>
2026-09-08 15:28:19 -07:00

96 lines
2.9 KiB
TypeScript

import { defineConfig, devices } from '@playwright/test'
// ---------------------------------------------------------------------------
// Environment detection
// ---------------------------------------------------------------------------
const ENV = process.env.ENV || 'production'
const NETWORK = process.env.LUX_NETWORK || 'mainnet'
// ---------------------------------------------------------------------------
// URL maps per environment
// ---------------------------------------------------------------------------
// Zoo is a Lux subnet. RPC goes through the Lux gateway.
// Each Lux network has its own API domain.
const LUX_API: Record<string, string> = {
mainnet: 'https://api.lux.network',
testnet: 'https://api.lux-test.network',
devnet: 'https://api.lux-dev.network',
}
// Explorer prefix for non-mainnet explorers
const EXPLORE_PREFIX: Record<string, string> = {
mainnet: '',
testnet: 'test-',
devnet: 'dev-',
}
const luxApi = LUX_API[NETWORK] || LUX_API.mainnet
const ep = EXPLORE_PREFIX[NETWORK] || ''
const urls: Record<string, Record<string, string>> = {
production: {
// Zoo chain RPC (subnet of Lux)
rpcZoo: `${luxApi}/${NETWORK}/v1/chain/zoo/rpc`,
// Parent Lux chain RPCs
rpcLux: `${luxApi}/${NETWORK}/v1/chain/c/rpc`,
rpcInfo: `${luxApi}/${NETWORK}/v1/info`,
rpcHealth: `${luxApi}/${NETWORK}/v1/health`,
rpcPlatform: `${luxApi}/${NETWORK}/v1/chain/p`,
// Zoo explorer (hosted under lux.network)
exploreZoo: `https://${ep}explore-zoo.lux.network`,
apiExploreZoo: `https://api-${ep}explore-zoo.lux.network`,
// Zoo apps
exchange: 'https://zoo.exchange',
website: 'https://zoo.network',
},
local: {
rpcZoo: 'http://127.0.0.1:9630/v1/chain/zoo/rpc',
rpcLux: 'http://127.0.0.1:9630/v1/chain/c/rpc',
rpcInfo: 'http://127.0.0.1:9630/v1/info',
rpcHealth: 'http://127.0.0.1:9630/v1/health',
rpcPlatform: 'http://127.0.0.1:9630/v1/chain/p',
exploreZoo: 'http://localhost:4011',
apiExploreZoo: 'http://localhost:4011',
exchange: 'http://localhost:3001',
website: 'http://localhost:3002',
},
}
export default defineConfig({
testDir: './e2e',
fullyParallel: false,
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
workers: 1,
reporter: process.env.CI
? [['github'], ['html', { open: 'never' }], ['junit', { outputFile: 'e2e/results.xml' }]]
: [['list'], ['html', { open: 'never' }]],
timeout: 120_000,
expect: { timeout: 15_000 },
use: {
baseURL: urls[ENV]?.exploreZoo || urls.production.exploreZoo,
trace: 'on-first-retry',
screenshot: 'on',
video: 'on-first-retry',
actionTimeout: 15_000,
navigationTimeout: 60_000,
ignoreHTTPSErrors: true,
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
outputDir: './e2e/test-results',
metadata: {
env: ENV,
network: NETWORK,
urls: urls[ENV] || urls.production,
},
})