Expanded solutions (10 new industries) and products (Compliance & Data section) to cover full docs.lux.financial capability surface.
98 lines
4.3 KiB
TypeScript
98 lines
4.3 KiB
TypeScript
import { test, expect } from '@playwright/test'
|
|
import { httpStatus, snap } from './helpers'
|
|
|
|
// ── Lux Cloud Subdomains — All Live ────────────────────────────────
|
|
const LUX_CLOUD_HOSTS = [
|
|
{ url: 'https://lux.cloud', expectTitle: /Lux Cloud/i, brand: 'Lux Cloud' },
|
|
{ url: 'https://www.lux.cloud', expectTitle: /Lux Cloud/i, brand: 'Lux Cloud' },
|
|
{ url: 'https://api.lux.cloud', expectStatus: [200, 404] },
|
|
{ url: 'https://console.lux.cloud', expectTitle: /./ },
|
|
{ url: 'https://id.lux.cloud', expectTitle: /./, brand: 'Login / IAM' },
|
|
{ url: 'https://kms.lux.cloud', expectStatus: [200, 401, 403] },
|
|
{ url: 'https://mpc.lux.cloud', expectTitle: /Lux MPC/i, brand: 'Lux MPC' },
|
|
{ url: 'https://nodes.lux.cloud', expectTitle: /./ },
|
|
]
|
|
|
|
test.describe('Lux Cloud — Reach', () => {
|
|
for (const h of LUX_CLOUD_HOSTS) {
|
|
test(`${h.url} HTTP`, async ({ request }) => {
|
|
const s = await httpStatus(request, h.url)
|
|
console.log(` ${h.url}: ${s}`)
|
|
const ok = h.expectStatus ?? [200, 301, 302, 307, 308]
|
|
expect(ok).toContain(s)
|
|
})
|
|
}
|
|
})
|
|
|
|
test.describe('Lux Cloud — Branding', () => {
|
|
for (const h of LUX_CLOUD_HOSTS.filter(x => x.expectTitle)) {
|
|
test(`${h.url} renders`, async ({ page }) => {
|
|
await page.goto(h.url, { timeout: 30_000, waitUntil: 'domcontentloaded' })
|
|
await page.waitForTimeout(2000)
|
|
const title = await page.title()
|
|
console.log(` ${h.url}: "${title}"`)
|
|
if (h.expectTitle) expect(title).toMatch(h.expectTitle)
|
|
await snap(page, `sites-${h.url.replace(/[^a-z0-9]/gi, '-')}`)
|
|
})
|
|
}
|
|
})
|
|
|
|
test.describe('Lux Cloud — Dark Monochrome Theme', () => {
|
|
test('lux.cloud body is #000 bg', async ({ page }) => {
|
|
await page.goto('https://lux.cloud', { waitUntil: 'networkidle', timeout: 30_000 })
|
|
const bg = await page.evaluate(() => window.getComputedStyle(document.body).backgroundColor)
|
|
console.log(` bg: ${bg}`)
|
|
expect(bg).toMatch(/rgb\(0,\s*0,\s*0\)|#000|oklch\(0\s+0\s+0\)/i)
|
|
})
|
|
|
|
test('lux.cloud has Try Lux dropdown', async ({ page }) => {
|
|
await page.goto('https://lux.cloud', { waitUntil: 'networkidle', timeout: 30_000 })
|
|
await page.waitForTimeout(2000)
|
|
const tryLux = page.locator('text=/Try Lux/i').first()
|
|
await expect(tryLux).toBeVisible({ timeout: 5000 })
|
|
})
|
|
})
|
|
|
|
// ── Lux Ecosystem — lux.network + siblings ──────────────────────────
|
|
const ECOSYSTEM = [
|
|
{ url: 'https://lux.network', name: 'Lux Network' },
|
|
{ url: 'https://lux.id', name: 'Lux ID (IAM)' },
|
|
{ url: 'https://hanzo.id', name: 'Hanzo ID' },
|
|
{ url: 'https://bootno.de', name: 'Bootnode' },
|
|
{ url: 'https://web3.hanzo.ai', name: 'Hanzo Web3' },
|
|
{ url: 'https://status.lux.network', name: 'Status' },
|
|
]
|
|
|
|
test.describe('Lux Ecosystem — Reach', () => {
|
|
for (const h of ECOSYSTEM) {
|
|
test(`${h.url} (${h.name})`, async ({ request }) => {
|
|
const s = await httpStatus(request, h.url)
|
|
console.log(` ${h.name}: ${s}`)
|
|
expect([200, 301, 302, 307, 308]).toContain(s)
|
|
})
|
|
}
|
|
})
|
|
|
|
// ── Console Runtime Errors ──────────────────────────────────────────
|
|
test.describe('No Console Errors', () => {
|
|
for (const url of ['https://lux.cloud', 'https://mpc.lux.cloud', 'https://id.lux.cloud']) {
|
|
test(`${url} has no critical console errors`, async ({ page }) => {
|
|
const errors: string[] = []
|
|
page.on('pageerror', (err) => errors.push(err.message))
|
|
page.on('console', (msg) => {
|
|
if (msg.type() === 'error') {
|
|
const text = msg.text()
|
|
// Filter known benign: favicon, CSP preload, analytics
|
|
if (!/favicon|preload|\.well-known|gtag|analytics|ERR_ABORTED/i.test(text)) {
|
|
errors.push(text)
|
|
}
|
|
}
|
|
})
|
|
await page.goto(url, { waitUntil: 'networkidle', timeout: 30_000 })
|
|
await page.waitForTimeout(2000)
|
|
if (errors.length > 0) console.log(` errors on ${url}:\n ${errors.join('\n ')}`)
|
|
expect(errors.length).toBeLessThanOrEqual(2) // tolerate up to 2 third-party errors
|
|
})
|
|
}
|
|
})
|