Files
punimtag/e2e/tests/prod.smoke.spec.ts
T
ilia 96351288f0
CI / skip-ci-check (push) Successful in 4s
CI / docker-ci (push) Successful in 6s
CI / secret-scan (push) Successful in 11s
CI / admin-unit (push) Successful in 1m23s
CI / viewer-unit (push) Successful in 2m2s
CI / e2e (push) Successful in 2m43s
test: playkit v0.3.1 adoption, Zod widening, PROD smoke, NextAuth write gates (#68)
2026-07-14 22:24:07 -05:00

37 lines
1.5 KiB
TypeScript

import { test as base, expect } from '@playwright/test';
import { assertPublicHost } from '@levkin/playkit';
/**
* PROD smoke: health + public login page only — no mutating actions, no
* login attempt, no LAN-only FastAPI dependency. Deliberately does NOT use
* the shared `fixtures.ts` (`api`/`playkitConfig` there resolve to DEV via
* `env-defaults.json`); PROD has its own base URL, set only when the PROD
* LXC actually exists (`vault_punimtag_nextauth_url_prod` is unset today —
* LXC 9103 hasn't been provisioned, see ROADMAP "Ops / docs debt").
*
* Set `PROD_BASE_URL` (e.g. `https://punimtag.levkin.ca`) to enable; skips
* otherwise so this spec is a no-op until PROD ships.
*/
const prodBaseUrl = process.env.PROD_BASE_URL || '';
base.describe('PROD smoke @prod', () => {
base.skip(!prodBaseUrl, 'PROD_BASE_URL not set — PROD LXC not provisioned yet');
base('health endpoint reports ok', async ({ request }) => {
assertPublicHost(prodBaseUrl);
const res = await request.get(`${prodBaseUrl}/api/health`);
expect(res.ok()).toBeTruthy();
const body = await res.json();
expect(body.status).toBe('ok');
});
base('login page loads on the public host', async ({ page }) => {
assertPublicHost(prodBaseUrl);
await page.goto(`${prodBaseUrl}/login`);
expect(new URL(page.url()).hostname).toBe(new URL(prodBaseUrl).hostname);
await expect(page.getByRole('button', { name: /Sign in/i })).toBeVisible({
timeout: 20_000,
});
});
});