Skip to content

Commit ed4bb53

Browse files
authored
Merge pull request #1386 from cisagov/fixture_update_CRASM_3482
Update page fixtures and remove skipping tests CRASM-3482
2 parents 6365979 + 1dcaf05 commit ed4bb53

12 files changed

Lines changed: 870 additions & 1165 deletions

playwright/e2e/global-admin/detected-host-widget.spec.ts

Lines changed: 0 additions & 460 deletions
This file was deleted.

playwright/e2e/global-admin/detected-hosts-widget.spec.ts

Lines changed: 450 additions & 33 deletions
Large diffs are not rendered by default.

playwright/e2e/global-admin/detected-vulnerabilities-widget.spec.ts

Lines changed: 79 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { expect } from '@playwright/test';
33
import { ROUTES } from '../../../frontend/src/constants/routes';
44

55
test.describe('Known Exploited and Other Detected Vulnerabilities Widget', () => {
6-
test.beforeEach(async ({ page: pageAsGlobalAdmin }) => {
6+
test.beforeEach(async ({ pageAsGlobalAdmin }) => {
77
// Navigate to the dashboard page before each test
88
await pageAsGlobalAdmin.goto(ROUTES.VSDASHBOARD);
99
});
1010

11-
test.skip('should display main widget heading and tooltip', async ({
12-
page: pageAsGlobalAdmin
11+
test('should display main widget heading and tooltip', async ({
12+
pageAsGlobalAdmin
1313
}) => {
1414
// Check that the main widget heading is visible
1515
const heading = pageAsGlobalAdmin.getByRole('heading', {
@@ -24,8 +24,8 @@ test.describe('Known Exploited and Other Detected Vulnerabilities Widget', () =>
2424
await tooltipButton.click();
2525
});
2626

27-
test.skip('should navigate to details page when clicking "View Details"', async ({
28-
page: pageAsGlobalAdmin
27+
test('should navigate to details page when clicking "View Details"', async ({
28+
pageAsGlobalAdmin
2929
}) => {
3030
// Verify "View Details" link is visible and navigates correctly
3131
const detailsLink = pageAsGlobalAdmin
@@ -38,8 +38,8 @@ test.describe('Known Exploited and Other Detected Vulnerabilities Widget', () =>
3838

3939
//========= Severity by Prominenece ==========
4040

41-
test.skip('should toggle severity by prominence graph data using KEV, Distinct, All buttons', async ({
42-
page: pageAsGlobalAdmin
41+
test('should toggle severity by prominence graph data using KEV, Distinct, All buttons', async ({
42+
pageAsGlobalAdmin
4343
}) => {
4444
// Scope radios to the "Severity by Prominence" section
4545
const heading = pageAsGlobalAdmin.getByRole('heading', {
@@ -63,8 +63,8 @@ test.describe('Known Exploited and Other Detected Vulnerabilities Widget', () =>
6363
await expect(allBtn).toHaveAttribute('aria-checked', 'true');
6464
});
6565

66-
test.skip('should render severity bars with correct labels', async ({
67-
page: pageAsGlobalAdmin
66+
test('should render severity bars with correct labels', async ({
67+
pageAsGlobalAdmin
6868
}) => {
6969
// Locate all bars on the graph with aria-labels
7070
const bars = pageAsGlobalAdmin.locator(
@@ -79,8 +79,8 @@ test.describe('Known Exploited and Other Detected Vulnerabilities Widget', () =>
7979
await expect(bars.nth(3)).toHaveAttribute('aria-label', /low/i);
8080
});
8181

82-
test.skip(' severity chart bar colors are correct for KEV, Distinct, and All', async ({
83-
page: pageAsGlobalAdmin
82+
test(' severity chart bar colors are correct for KEV, Distinct, and All', async ({
83+
pageAsGlobalAdmin
8484
}) => {
8585
const bars = pageAsGlobalAdmin.locator('svg .MuiBarElement-root');
8686
//await expect(bars).toHaveCount(4);
@@ -106,29 +106,31 @@ test.describe('Known Exploited and Other Detected Vulnerabilities Widget', () =>
106106

107107
// ====== Top Vulnerability by Occurrence =======
108108

109-
test.skip('should toggle occurrence table data using KEV and All buttons', async ({
110-
page: pageAsGlobalAdmin
111-
}) => {
112-
// Scope radios to the "Top Vulnerabilities by Occurrence" section
113-
const heading = pageAsGlobalAdmin.getByRole('heading', {
114-
name: /top vulnerabilities by occurrence/i
115-
});
116-
const group = heading.locator(
117-
'xpath=following::div[@role="radiogroup"][1]'
118-
);
109+
// TODO CRASM-3487 Update tests to match current UI behavior
119110

120-
const kevBtn = group.getByRole('radio', { name: 'KEV' });
121-
const allBtn = group.getByRole('radio', { name: 'All' });
111+
// test('should toggle occurrence table data using KEV and All buttons', async ({
112+
// pageAsGlobalAdmin
113+
// }) => {
114+
// // Scope radios to the "Top Vulnerabilities by Occurrence" section
115+
// const heading = pageAsGlobalAdmin.getByRole('heading', {
116+
// name: /top vulnerabilities by occurrence/i
117+
// });
118+
// const group = heading.locator(
119+
// 'xpath=following::div[@role="radiogroup"][1]'
120+
// );
122121

123-
await kevBtn.isVisible();
124-
await expect(kevBtn).toHaveAttribute('aria-checked', 'true');
122+
// const kevBtn = group.getByRole('radio', { name: 'KEV' });
123+
// const allBtn = group.getByRole('radio', { name: 'All' });
125124

126-
await allBtn.click();
127-
await expect(allBtn).toHaveAttribute('aria-checked', 'true');
128-
});
125+
// await kevBtn.isVisible();
126+
// await expect(kevBtn).toHaveAttribute('aria-checked', 'true');
129127

130-
test.skip('should display vulnerability occurrunce table with correct columns and data', async ({
131-
page: pageAsGlobalAdmin
128+
// await allBtn.click();
129+
// await expect(allBtn).toHaveAttribute('aria-checked', 'true');
130+
// });
131+
132+
test('should display vulnerability occurrunce table with correct columns and data', async ({
133+
pageAsGlobalAdmin
132134
}) => {
133135
// Assert the table headers are visible
134136
const table = pageAsGlobalAdmin.locator('table');
@@ -153,49 +155,51 @@ test.describe('Known Exploited and Other Detected Vulnerabilities Widget', () =>
153155
await firstCell.click();
154156
});
155157

156-
test.skip('hover tooltips show text for all info icons', async ({
157-
page: pageAsGlobalAdmin
158-
}) => {
159-
// Small helper to reduce flakiness with MUI’s show/leave delays
160-
const resetHover = async () => {
161-
await pageAsGlobalAdmin.mouse.move(0, 0);
162-
await pageAsGlobalAdmin.waitForTimeout(80); // give Popper time to close the prior tooltip
163-
};
164-
165-
// 1) Main widget info icon
166-
await resetHover();
167-
const mainInfo = pageAsGlobalAdmin.getByRole('button', {
168-
name: /more information about known exploited and other detected vulnerabilities/i
169-
});
170-
const mainTooltip = pageAsGlobalAdmin
171-
.getByRole('tooltip')
172-
.filter({ hasText: /known exploited and other/i }); // use a stable substring
173-
await mainInfo.hover();
174-
await expect(mainTooltip).toBeVisible();
175-
await expect(mainTooltip).not.toHaveText('');
176-
177-
// 2) Severity by Prominence info icon
178-
await resetHover();
179-
const sevInfo = pageAsGlobalAdmin.getByRole('button', {
180-
name: /more information about severity by prominence/i
181-
});
182-
const sevTooltip = pageAsGlobalAdmin
183-
.getByRole('tooltip')
184-
.filter({ hasText: /severity by prominence/i });
185-
await sevInfo.hover();
186-
await expect(sevTooltip).toBeVisible();
187-
await expect(sevTooltip).not.toHaveText('');
188-
189-
// 3) Top Vulnerabilities by Occurrence info icon
190-
await resetHover();
191-
const topInfo = pageAsGlobalAdmin.getByRole('button', {
192-
name: /more information about top vulnerabilities by occurrence/i
193-
});
194-
const topTooltip = pageAsGlobalAdmin
195-
.getByRole('tooltip')
196-
.filter({ hasText: /top vulnerabilities by occurrence/i });
197-
await topInfo.hover();
198-
await expect(topTooltip).toBeVisible();
199-
await expect(topTooltip).not.toHaveText('');
200-
});
158+
// TODO CRASM-3487 Update tests to match current UI behavior
159+
160+
// test('hover tooltips show text for all info icons', async ({
161+
// pageAsGlobalAdmin
162+
// }) => {
163+
// // Small helper to reduce flakiness with MUI’s show/leave delays
164+
// const resetHover = async () => {
165+
// await pageAsGlobalAdmin.mouse.move(0, 0);
166+
// await pageAsGlobalAdmin.waitForTimeout(80); // give Popper time to close the prior tooltip
167+
// };
168+
169+
// // 1) Main widget info icon
170+
// await resetHover();
171+
// const mainInfo = pageAsGlobalAdmin.getByRole('button', {
172+
// name: /more information about known exploited and other detected vulnerabilities/i
173+
// });
174+
// const mainTooltip = pageAsGlobalAdmin
175+
// .getByRole('tooltip')
176+
// .filter({ hasText: /known exploited and other/i }); // use a stable substring
177+
// await mainInfo.hover();
178+
// await expect(mainTooltip).toBeVisible();
179+
// await expect(mainTooltip).not.toHaveText('');
180+
181+
// // 2) Severity by Prominence info icon
182+
// await resetHover();
183+
// const sevInfo = pageAsGlobalAdmin.getByRole('button', {
184+
// name: /more information about severity by prominence/i
185+
// });
186+
// const sevTooltip = pageAsGlobalAdmin
187+
// .getByRole('tooltip')
188+
// .filter({ hasText: /severity by prominence/i });
189+
// await sevInfo.hover();
190+
// await expect(sevTooltip).toBeVisible();
191+
// await expect(sevTooltip).not.toHaveText('');
192+
193+
// // 3) Top Vulnerabilities by Occurrence info icon
194+
// await resetHover();
195+
// const topInfo = pageAsGlobalAdmin.getByRole('button', {
196+
// name: /more information about top vulnerabilities by occurrence/i
197+
// });
198+
// const topTooltip = pageAsGlobalAdmin
199+
// .getByRole('tooltip')
200+
// .filter({ hasText: /top vulnerabilities by occurrence/i });
201+
// await topInfo.hover();
202+
// await expect(topTooltip).toBeVisible();
203+
// await expect(topTooltip).not.toHaveText('');
204+
// });
201205
});

playwright/e2e/global-admin/domains-table-sorting.spec.ts

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,26 @@ function validateDomainSorting(domains: string[]): boolean {
5151
}
5252

5353
test.describe('domains-table', () => {
54-
test.skip('IP column sorts with server-side sorting', async ({
55-
page,
54+
test('IP column sorts with server-side sorting', async ({
55+
pageAsGlobalAdmin,
5656
makeAxeBuilder
5757
}, testInfo: TestInfo) => {
58-
await page.goto(ROUTES.DOMAINS);
59-
await page.waitForSelector('[aria-label="Domains Table"]');
58+
await pageAsGlobalAdmin.goto(ROUTES.DOMAINS);
59+
await pageAsGlobalAdmin.waitForSelector('[aria-label="Domains Table"]');
6060

6161
// Click IP column header to sor
62-
await page.getByRole('columnheader', { name: /IP/i }).click();
62+
await pageAsGlobalAdmin.getByRole('columnheader', { name: /IP/i }).click();
6363

6464
// Wait for the table to update after server-side sor
65-
await page.waitForLoadState('networkidle');
65+
await pageAsGlobalAdmin.waitForLoadState('networkidle');
6666

6767
// Get sorted IP values using the correct selector
68-
const sortedIpCells = await page
68+
const sortedIpCells = await pageAsGlobalAdmin
6969
.getByRole('gridcell', { name: /IP Address for Domain/ })
7070
.allTextContents();
7171

7272
// Accessibility scan scoped to the domains table only
73-
const results = await makeAxeBuilder(page)
73+
const results = await makeAxeBuilder(pageAsGlobalAdmin)
7474
.include('[aria-label="Domains Table"]')
7575
.analyze();
7676
await testInfo.attach('accessibility-scan-results-ip', {
@@ -92,44 +92,48 @@ test.describe('domains-table', () => {
9292
expect(results.violations).toHaveLength(0);
9393
});
9494

95-
test.skip('Domain column sorts with server-side sorting', async ({
96-
page,
97-
makeAxeBuilder
98-
}, testInfo: TestInfo) => {
99-
await page.goto(ROUTES.DOMAINS);
100-
await page.waitForSelector('[aria-label="Domains Table"]');
101-
102-
// Click Domain column header to sor
103-
await page.getByRole('columnheader', { name: /Domain/i }).click();
104-
105-
// Wait for the table to update after server-side sor
106-
await page.waitForLoadState('networkidle');
107-
108-
// Get sorted domain values using the correct selector
109-
const sortedDomainCells = await page
110-
.getByRole('gridcell', { name: /Domain Name:/ })
111-
.allTextContents();
112-
113-
// Accessibility scan scoped to the domains table only
114-
const results = await makeAxeBuilder(page)
115-
.include('[aria-label="Domains Table"]')
116-
.analyze();
117-
await testInfo.attach('accessibility-scan-results-domain', {
118-
body: JSON.stringify(results, null, 2),
119-
contentType: 'application/json'
120-
});
121-
122-
// Verify that sorting actually occurred
123-
expect(sortedDomainCells).toBeDefined();
124-
expect(sortedDomainCells.length).toBeGreaterThan(0);
125-
126-
// Validate that domains are in natural sorted order (ascending)
127-
const isDomainSortingValid = validateDomainSorting(sortedDomainCells);
128-
expect(isDomainSortingValid).toBe(true);
129-
130-
// Log the sorted domains for debugging
131-
console.log('Sorted domain names:', sortedDomainCells);
132-
133-
expect(results.violations).toHaveLength(0);
134-
});
95+
// TODO CRASM-3488 Update tests to match current UI behavior
96+
97+
// test('Domain column sorts with server-side sorting', async ({
98+
// pageAsGlobalAdmin,
99+
// makeAxeBuilder
100+
// }, testInfo: TestInfo) => {
101+
// await pageAsGlobalAdmin.goto(ROUTES.DOMAINS);
102+
// await pageAsGlobalAdmin.waitForSelector('[aria-label="Domains Table"]');
103+
104+
// // Click Domain column header to sor
105+
// await pageAsGlobalAdmin
106+
// .getByRole('columnheader', { name: /Domain/i })
107+
// .click();
108+
109+
// // Wait for the table to update after server-side sor
110+
// await pageAsGlobalAdmin.waitForLoadState('networkidle');
111+
112+
// // Get sorted domain values using the correct selector
113+
// const sortedDomainCells = await pageAsGlobalAdmin
114+
// .getByRole('gridcell', { name: /Domain Name:/ })
115+
// .allTextContents();
116+
117+
// // Accessibility scan scoped to the domains table only
118+
// const results = await makeAxeBuilder(pageAsGlobalAdmin)
119+
// .include('[aria-label="Domains Table"]')
120+
// .analyze();
121+
// await testInfo.attach('accessibility-scan-results-domain', {
122+
// body: JSON.stringify(results, null, 2),
123+
// contentType: 'application/json'
124+
// });
125+
126+
// // Verify that sorting actually occurred
127+
// expect(sortedDomainCells).toBeDefined();
128+
// expect(sortedDomainCells.length).toBeGreaterThan(0);
129+
130+
// // Validate that domains are in natural sorted order (ascending)
131+
// const isDomainSortingValid = validateDomainSorting(sortedDomainCells);
132+
// expect(isDomainSortingValid).toBe(true);
133+
134+
// // Log the sorted domains for debugging
135+
// console.log('Sorted domain names:', sortedDomainCells);
136+
137+
// expect(results.violations).toHaveLength(0);
138+
// });
135139
});

playwright/e2e/global-admin/global-admin_navigation.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ test.describe('Home — Global Admin: Learning Center nav', () => {
235235
test('Learning Center → CISA Resources links to cisa.gov', async ({
236236
pageAsGlobalAdmin
237237
}) => {
238-
const CISA_RX = /^https:\/\/(www\.)?cisa\.gov\/?$/;
238+
const CISA_RX = /^https:\/\/(www\.)?cisa\.gov(\/.*)?$/;
239+
239240
await assertLearningCenterExternalLink(
240241
pageAsGlobalAdmin,
241242
/cisa resources/i,

0 commit comments

Comments
 (0)