Fix web route regressions from Playwright QA
This commit is contained in:
@@ -95,6 +95,7 @@ const canonicalRoutes = [
|
||||
'/security/disposition',
|
||||
'/security/supply-chain-data',
|
||||
'/security/supply-chain-data/graph',
|
||||
'/security/sbom-lake',
|
||||
'/security/reachability',
|
||||
'/security/reports',
|
||||
'/evidence',
|
||||
@@ -177,6 +178,29 @@ const canonicalRoutes = [
|
||||
'/setup/topology/gate-profiles',
|
||||
] as const;
|
||||
|
||||
const strictRouteExpectations: Partial<Record<(typeof canonicalRoutes)[number], { title: RegExp; texts: string[] }>> = {
|
||||
'/security/advisories-vex': {
|
||||
title: /Advisories/i,
|
||||
texts: ['Security / Advisories & VEX', 'Providers'],
|
||||
},
|
||||
'/security/sbom-lake': {
|
||||
title: /SBOM Lake/i,
|
||||
texts: ['SBOM Lake', 'Attestation Coverage Metrics'],
|
||||
},
|
||||
'/ops/policy': {
|
||||
title: /Policy/i,
|
||||
texts: ['Policy Governance', 'Risk Budget Overview'],
|
||||
},
|
||||
'/ops/policy/overview': {
|
||||
title: /Policy/i,
|
||||
texts: ['Policy Governance', 'Risk Budget Overview'],
|
||||
},
|
||||
'/ops/policy/risk-budget': {
|
||||
title: /Policy/i,
|
||||
texts: ['Policy Governance', 'Risk Budget Overview'],
|
||||
},
|
||||
};
|
||||
|
||||
function collectNgErrors(page: Page): string[] {
|
||||
const errors: string[] = [];
|
||||
page.on('console', (msg) => {
|
||||
@@ -1210,6 +1234,13 @@ test.describe('Pre-alpha canonical full route sweep', () => {
|
||||
test(`route works: ${path}`, async ({ page }) => {
|
||||
const errors = collectNgErrors(page);
|
||||
await assertUsableRoute(page, path);
|
||||
const expectation = strictRouteExpectations[path];
|
||||
if (expectation) {
|
||||
await expect(page).toHaveTitle(expectation.title);
|
||||
for (const text of expectation.texts) {
|
||||
await expect(page.locator('#main-content')).toContainText(text);
|
||||
}
|
||||
}
|
||||
expect(errors, `Runtime errors on ${path}: ${errors.join('\n')}`).toEqual([]);
|
||||
});
|
||||
}
|
||||
@@ -1240,6 +1271,16 @@ test.describe('Pre-alpha key end-user interactions', () => {
|
||||
await expect(page.locator('.topbar__primary-action')).toContainText('Export Report');
|
||||
});
|
||||
|
||||
test('mission board SBOM card opens SBOM Lake', async ({ page }) => {
|
||||
await page.goto('/mission-control/board', { waitUntil: 'domcontentloaded' });
|
||||
await page.locator('#main-content a[href="/security/sbom-lake"]').first().click();
|
||||
|
||||
await expect(page).toHaveURL(/\/security\/sbom-lake$/);
|
||||
await expect(page).toHaveTitle(/SBOM Lake/i);
|
||||
await expect(page.locator('#main-content')).toContainText('SBOM Lake');
|
||||
await expect(page.locator('#main-content')).toContainText('Attestation Coverage Metrics');
|
||||
});
|
||||
|
||||
test('sidebar root navigation works for all canonical workspaces', async ({ page }) => {
|
||||
await page.goto('/mission-control/board', { waitUntil: 'domcontentloaded' });
|
||||
await page.locator('aside.sidebar a[href="/releases/overview"]').first().click();
|
||||
|
||||
Reference in New Issue
Block a user