CI / skip-ci-check (pull_request) Successful in 29s
CI / docker-ci (pull_request) Successful in 32s
CI / python-lint (pull_request) Successful in 34s
CI / secret-scan (pull_request) Successful in 39s
CI / viewer-unit (pull_request) Successful in 1m45s
CI / admin-unit (pull_request) Successful in 1m58s
CI / e2e (pull_request) Failing after 2m21s
Heading-only check on Approve Identified avoids API timing flakes; longer login timeout for admin review e2e.
63 lines
2.4 KiB
TypeScript
63 lines
2.4 KiB
TypeScript
import { test, expect } from '../fixtures';
|
|
import { AdminLoginPage } from '../pages/AdminLoginPage';
|
|
import { BUDGET_MS, expectWithinBudget } from '../timing-budgets';
|
|
import { DEFAULT_ADMIN_BASE_URL } from '../env-defaults';
|
|
|
|
/**
|
|
* FastAPI-admin UI smoke: core review workflows load without error.
|
|
* Uses E2E_API_USERNAME/PASSWORD (admin FastAPI user — not NextAuth viewer creds).
|
|
*/
|
|
test.describe('admin review pages @smoke', () => {
|
|
const adminBaseUrl = process.env.PLAYKIT_ADMIN_BASE_URL || DEFAULT_ADMIN_BASE_URL;
|
|
|
|
test('identify, auto-match, and approve pages load for admin', async ({
|
|
page,
|
|
timings,
|
|
}) => {
|
|
const username = process.env.E2E_API_USERNAME || '';
|
|
const password = process.env.E2E_API_PASSWORD || '';
|
|
test.skip(!username || !password, 'E2E_API_USERNAME/PASSWORD required for admin UI');
|
|
|
|
const login = new AdminLoginPage(page, adminBaseUrl);
|
|
|
|
await timings.measure('admin_login', async () => {
|
|
await login.openLogin();
|
|
await login.signIn(username, password);
|
|
await expect(page.getByRole('heading', { name: /Home Page/i })).toBeVisible({
|
|
timeout: 30_000,
|
|
});
|
|
});
|
|
expectWithinBudget(timings, 'admin_login', BUDGET_MS.uiLogin);
|
|
|
|
await timings.measure('admin_identify', async () => {
|
|
await page.goto(`${adminBaseUrl}/identify`);
|
|
await expect(page.getByRole('heading', { name: /Identify/i })).toBeVisible({
|
|
timeout: 20_000,
|
|
});
|
|
await expect(page.getByRole('button', { name: /Identify Faces/i }).first()).toBeVisible();
|
|
});
|
|
expectWithinBudget(timings, 'admin_identify', BUDGET_MS.uiAction);
|
|
|
|
await timings.measure('admin_auto_match', async () => {
|
|
await page.goto(`${adminBaseUrl}/auto-match`);
|
|
await expect(page.getByRole('heading', { name: /Auto-Match/i })).toBeVisible({
|
|
timeout: 20_000,
|
|
});
|
|
await expect(
|
|
page.getByRole('button', {
|
|
name: /Run Auto-Match|No Matches Available|Processing/i,
|
|
}),
|
|
).toBeVisible();
|
|
});
|
|
expectWithinBudget(timings, 'admin_auto_match', BUDGET_MS.uiAction);
|
|
|
|
await timings.measure('admin_approve', async () => {
|
|
await page.goto(`${adminBaseUrl}/approve-identified`);
|
|
await expect(page.getByRole('heading', { name: /Approve Identified/i })).toBeVisible({
|
|
timeout: 20_000,
|
|
});
|
|
});
|
|
expectWithinBudget(timings, 'admin_approve', BUDGET_MS.uiAction);
|
|
});
|
|
});
|