CI / skip-ci-check (pull_request) Successful in 4s
CI / docker-ci (pull_request) Successful in 6s
CI / secret-scan (pull_request) Successful in 11s
CI / viewer-unit (pull_request) Failing after 1m3s
CI / admin-unit (pull_request) Failing after 1m1s
CI / e2e (pull_request) Failing after 59s
- upload.smoke.spec.ts / gallery.search-filters.spec.ts: replace
waitForResponse/text-scrape with typed interceptNetworkCall spies (status
+ JSON shape) on the real upload POST and the filtered /api/search GET.
- api.fastapi-login.spec.ts: Zod-validate the FastAPI TokenResponse and
/auth/me UserResponse instead of loose casts. gallery.search-filters.spec.ts
gets the same treatment for the Prisma-backed SearchResponse.
- prod.smoke.spec.ts: opt-in (PROD_BASE_URL) health + login-page check on a
real PROD host; skips as a no-op until the PROD LXC exists (none does yet
per `pct list` — see ROADMAP).
- viewer.write-gates.spec.ts: NextAuth (browser-session) hasWriteAccess gate
on POST /api/faces/{id}/identify — viewer 403s, admin passes through.
Provisioned a third, independent auth-DB user (e2e-viewer@levkine.ca,
hasWriteAccess=false) for this via ansible's provision-punimtag-e2e-user.py
(see that repo for the vault/Infisical/Gitea/Vaultwarden side).
61 lines
2.3 KiB
TypeScript
61 lines
2.3 KiB
TypeScript
import { test as base, expect } from '@playwright/test';
|
|
import {
|
|
createPlaykitRuntime,
|
|
createMailInbox,
|
|
type PlaykitFixtures,
|
|
type MailInbox,
|
|
} from '@levkin/playkit';
|
|
import { playkitEnvFromProcess } from './env-defaults';
|
|
import { LoginPage } from './pages/LoginPage';
|
|
import { AccountMenu } from './pages/AccountMenu';
|
|
import { RegisterPage } from './pages/RegisterPage';
|
|
import { ManageUsersPanel } from './pages/ManageUsersPanel';
|
|
|
|
const runtime = createPlaykitRuntime(playkitEnvFromProcess());
|
|
|
|
type PunimtagFixtures = PlaykitFixtures & {
|
|
loginPage: LoginPage;
|
|
accountMenu: AccountMenu;
|
|
registerPage: RegisterPage;
|
|
manageUsersPanel: ManageUsersPanel;
|
|
e2eCredentials: { email: string; password: string } | null;
|
|
e2eViewerCredentials: { email: string; password: string } | null;
|
|
mail: MailInbox | null;
|
|
};
|
|
|
|
export const test = base.extend<PunimtagFixtures>({
|
|
playkitConfig: async ({}, use) => use(runtime.playkitConfig),
|
|
playkitLog: async ({}, use) => use(runtime.playkitLog),
|
|
api: async ({}, use) => use(runtime.api),
|
|
timings: async ({}, use) => use(runtime.timings),
|
|
|
|
loginPage: async ({ page, playkitConfig }, use) =>
|
|
use(new LoginPage(page, playkitConfig.baseUrl)),
|
|
accountMenu: async ({ page, playkitConfig }, use) =>
|
|
use(new AccountMenu(page, playkitConfig.baseUrl)),
|
|
registerPage: async ({ page, playkitConfig }, use) =>
|
|
use(new RegisterPage(page, playkitConfig.baseUrl)),
|
|
manageUsersPanel: async ({ page, playkitConfig }, use) =>
|
|
use(new ManageUsersPanel(page, playkitConfig.baseUrl)),
|
|
|
|
e2eCredentials: async ({}, use) => {
|
|
const email = process.env.E2E_ADMIN_EMAIL || process.env.E2E_EMAIL || '';
|
|
const password = process.env.E2E_ADMIN_PASSWORD || process.env.E2E_PASSWORD || '';
|
|
await use(email && password ? { email, password } : null);
|
|
},
|
|
|
|
// NextAuth auth-DB viewer (hasWriteAccess=false) — distinct from
|
|
// E2E_API_VIEWER_* (FastAPI bearer). See docs/hardening/SECRETS.md (ansible).
|
|
e2eViewerCredentials: async ({}, use) => {
|
|
const email = process.env.E2E_VIEWER_EMAIL || '';
|
|
const password = process.env.E2E_VIEWER_PASSWORD || '';
|
|
await use(email && password ? { email, password } : null);
|
|
},
|
|
|
|
mail: async ({ playkitLog }, use) => {
|
|
await use(createMailInbox(process.env, playkitLog.child({ component: 'mail' })));
|
|
},
|
|
});
|
|
|
|
export { expect };
|