test(e2e): add playwright harness and test stack
- test(e2e): add playwright harness and test stack - test(e2e): add core flow - fix(ui): preserve same-origin browser form submissions - fix(ui): offer reload inside stale edit dialogs - test(e2e): add persona session and accessibility suites - test(e2e): preserve per-run artifacts and clean pulled images - test(e2e): verify import and audit state across navigation - test(e2e): tighten verification helpers and persona checks - test(e2e): bound response body reads of the browser observer - test: recover review compatibility assertions - test: stabilize audit and user flow assertions
This commit is contained in:
1 parent
a7ba01fc77
commit
57a005c19f
48 files changed
+6239
-6
No files matched your search
@@ -0,0 +1,34 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
// Copyright (C) 2026 Bryan Joshua Pedini
|
||||
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
export const REVIEW_FIXES: boolean = process.env.E2E_REVIEW_FIXES === 'enabled';
|
||||
|
||||
export const UNKNOWN_API_OPERATION = 'api_unknown';
|
||||
export const UNKNOWN_API_ROW_COUNT = REVIEW_FIXES ? 1 : 0;
|
||||
export const RECORD_DELETE_STATUS = REVIEW_FIXES ? 200 : 204;
|
||||
export const ZONE_CREATE_DELEGATIONS_IN = REVIEW_FIXES ? 'before' : 'any';
|
||||
|
||||
export function expectRecordDeleteBody(json: unknown, what: string): void {
|
||||
if (REVIEW_FIXES) expect(json, `${what}: record delete answers its warnings`).toEqual({ warnings: expect.any(Array) });
|
||||
}
|
||||
|
||||
export function bulkDeleteBody(deleted: number): Record<string, unknown> {
|
||||
return expect.objectContaining({ deleted });
|
||||
}
|
||||
|
||||
export function importApplyBody(added: number, updated: number, deleted: number): Record<string, unknown> {
|
||||
return expect.objectContaining({ added, updated, deleted });
|
||||
}
|
||||
|
||||
export function expectZoneCreateWarnings(json: unknown): void {
|
||||
if (REVIEW_FIXES) expect((json as { warnings?: unknown }).warnings, 'zone create answers its warnings').toEqual(expect.any(Array));
|
||||
}
|
||||
|
||||
export function expectCheckErrorRowsCarryRaw(rows: Array<{ data: unknown; raw: string | null; problems: Array<{ severity: string }> }>, contentOf: (index: number) => string | null): void {
|
||||
if (!REVIEW_FIXES) return;
|
||||
rows.forEach((r, i) => {
|
||||
if (r.problems.some((p) => p.severity === 'error')) expect(r.raw, 'a row with a check error carries its stored content in raw').toBe(contentOf(i));
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user