/** * Post-deployment smoke tests. * Run against a deployed environment (staging/production) via PLAYWRIGHT_BASE_URL. * Does NOT start the dev server - expects the target to be already running. * * Usage: * PLAYWRIGHT_BASE_URL=https://staging.veza.com npx playwright test e2e/tests/smoke-post-deploy.spec.ts * VITE_FRONTEND_URL=https://app.veza.com npx playwright test e2e/tests/smoke-post-deploy.spec.ts */ import { test, expect } from '@playwright/test'; const BASE_URL = process.env.PLAYWRIGHT_BASE_URL || process.env.VITE_FRONTEND_URL || 'http://localhost:5173'; test.describe('Post-deploy smoke checks', () => { test('homepage loads', async ({ page }) => { const response = await page.goto(BASE_URL, { waitUntil: 'domcontentloaded', timeout: 15000 }); expect(response?.status()).toBeLessThan(500); }); test('login page loads', async ({ page }) => { const response = await page.goto(`${BASE_URL}/login`, { waitUntil: 'domcontentloaded', timeout: 15000 }); expect(response?.status()).toBeLessThan(500); }); test('API health check', async ({ request }) => { const origin = new URL(BASE_URL).origin; const apiUrl = `${origin}/api/v1/health`; try { const response = await request.get(apiUrl, { timeout: 10000 }); expect(response.status()).toBeLessThan(500); } catch { test.skip(true, 'API health endpoint may not be reachable from this context'); } }); });