Fix notifications surface ownership and frontdoor contracts
This commit is contained in:
@@ -85,6 +85,45 @@ async function clickLinkAndVerify(page, route, linkName, expectedPath) {
|
||||
};
|
||||
}
|
||||
|
||||
async function locateNav(page, label) {
|
||||
const candidates = [
|
||||
page.getByRole('link', { name: label }).first(),
|
||||
page.getByRole('tab', { name: label }).first(),
|
||||
page.getByRole('button', { name: label }).first(),
|
||||
];
|
||||
|
||||
for (const locator of candidates) {
|
||||
if ((await locator.count()) > 0) {
|
||||
return locator;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
async function clickNavAndVerify(page, route, label, expectedPath) {
|
||||
await navigate(page, route);
|
||||
const locator = await locateNav(page, label);
|
||||
if (!locator) {
|
||||
return {
|
||||
action: `nav:${label}`,
|
||||
ok: false,
|
||||
reason: 'missing-nav',
|
||||
snapshot: await captureSnapshot(page, `missing-nav:${label}`),
|
||||
};
|
||||
}
|
||||
|
||||
await locator.click({ timeout: 10_000 });
|
||||
await page.waitForURL((url) => url.pathname.includes(expectedPath), { timeout: 15_000 });
|
||||
await settle(page);
|
||||
|
||||
return {
|
||||
action: `nav:${label}`,
|
||||
ok: page.url().includes(expectedPath),
|
||||
snapshot: await captureSnapshot(page, `after-nav:${label}`),
|
||||
};
|
||||
}
|
||||
|
||||
async function main() {
|
||||
await mkdir(outputDir, { recursive: true });
|
||||
|
||||
@@ -146,6 +185,12 @@ async function main() {
|
||||
});
|
||||
|
||||
const results = [];
|
||||
await navigate(page, '/ops/operations/notifications');
|
||||
results.push({
|
||||
action: 'route:/ops/operations/notifications',
|
||||
ok: (await headingText(page)) === 'Notify control plane',
|
||||
snapshot: await captureSnapshot(page, 'ops-notifications'),
|
||||
});
|
||||
results.push(await clickLinkAndVerify(
|
||||
page,
|
||||
'/ops/operations/notifications',
|
||||
@@ -158,6 +203,24 @@ async function main() {
|
||||
'Review watchlist alerts',
|
||||
'/setup/trust-signing/watchlist/alerts',
|
||||
));
|
||||
await navigate(page, '/setup/notifications');
|
||||
const setupSnapshot = await captureSnapshot(page, 'setup-notifications');
|
||||
results.push({
|
||||
action: 'route:/setup/notifications',
|
||||
ok:
|
||||
setupSnapshot.heading === 'Notification Administration' &&
|
||||
!setupSnapshot.alerts.some((text) => text.toLowerCase().includes('items is not iterable')),
|
||||
snapshot: setupSnapshot,
|
||||
});
|
||||
results.push(await clickNavAndVerify(page, '/setup/notifications', 'Rules', '/setup/notifications/rules'));
|
||||
results.push(await clickNavAndVerify(page, '/setup/notifications', 'Channels', '/setup/notifications/channels'));
|
||||
results.push(await clickNavAndVerify(page, '/setup/notifications', 'Delivery', '/setup/notifications/delivery'));
|
||||
results.push(await clickNavAndVerify(page, '/setup/notifications', 'Simulator', '/setup/notifications/simulator'));
|
||||
results.push(await clickNavAndVerify(page, '/setup/notifications', 'Config', '/setup/notifications/config'));
|
||||
results.push(await clickNavAndVerify(page, '/setup/notifications/config', 'Quiet Hours', '/setup/notifications/config/quiet-hours'));
|
||||
results.push(await clickNavAndVerify(page, '/setup/notifications/config', 'Overrides', '/setup/notifications/config/overrides'));
|
||||
results.push(await clickNavAndVerify(page, '/setup/notifications/config', 'Escalation', '/setup/notifications/config/escalation'));
|
||||
results.push(await clickNavAndVerify(page, '/setup/notifications/config', 'Throttle', '/setup/notifications/config/throttle'));
|
||||
|
||||
const summary = {
|
||||
generatedAtUtc: new Date().toISOString(),
|
||||
|
||||
Reference in New Issue
Block a user