test(redesign): accept Phase 4 foundations with migration gates
This commit is contained in:
@@ -58,6 +58,21 @@ async function capture(page: Page, info: TestInfo, name: string) {
|
||||
}
|
||||
|
||||
async function loadedContrast(page: Page, info: TestInfo, state: string) {
|
||||
// Scan the loaded state after finite entry/focus transitions finish. Sampling
|
||||
// MUI's Fade/Grow mid-frame measures composited, partially transparent text.
|
||||
// Keep normal motion enabled, retain every axe rule and record what we waited for.
|
||||
const transitions = await page.evaluate(async () => {
|
||||
await new Promise(resolve => requestAnimationFrame(() => requestAnimationFrame(resolve)));
|
||||
const active = document.getAnimations().filter(animation =>
|
||||
animation.playState === "running" && Number.isFinite(animation.effect?.getComputedTiming().endTime));
|
||||
const evidence = active.map(animation => {
|
||||
const target = (animation.effect as KeyframeEffect | null)?.target;
|
||||
return { type: animation.constructor.name, opacity: target instanceof Element ? getComputedStyle(target).opacity : null };
|
||||
});
|
||||
await Promise.all(active.map(animation => animation.finished.catch(() => undefined)));
|
||||
return evidence;
|
||||
});
|
||||
await info.attach(`${state}-transitions`, { body: JSON.stringify(transitions), contentType: "application/json" });
|
||||
const result = await new AxeBuilder({ page }).withTags(["wcag2a", "wcag2aa", "wcag21a", "wcag21aa"]).analyze();
|
||||
// This slice gates color contrast. Preserve the full scan (including naming and
|
||||
// preview-scroll findings) for P4-02/03; this is not a full accessibility pass.
|
||||
|
||||
Reference in New Issue
Block a user