@@ -3,13 +3,13 @@ import { expect } from '@playwright/test';
33import { ROUTES } from '../../../frontend/src/constants/routes' ;
44
55test . 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' , / l o w / 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 : / t o p v u l n e r a b i l i t i e s b y o c c u r r e n c e / 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 : / m o r e i n f o r m a t i o n a b o u t k n o w n e x p l o i t e d a n d o t h e r d e t e c t e d v u l n e r a b i l i t i e s / i
169- } ) ;
170- const mainTooltip = pageAsGlobalAdmin
171- . getByRole ( 'tooltip' )
172- . filter ( { hasText : / k n o w n e x p l o i t e d a n d o t h e r / 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 : / m o r e i n f o r m a t i o n a b o u t s e v e r i t y b y p r o m i n e n c e / i
181- } ) ;
182- const sevTooltip = pageAsGlobalAdmin
183- . getByRole ( 'tooltip' )
184- . filter ( { hasText : / s e v e r i t y b y p r o m i n e n c e / 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 : / m o r e i n f o r m a t i o n a b o u t t o p v u l n e r a b i l i t i e s b y o c c u r r e n c e / i
193- } ) ;
194- const topTooltip = pageAsGlobalAdmin
195- . getByRole ( 'tooltip' )
196- . filter ( { hasText : / t o p v u l n e r a b i l i t i e s b y o c c u r r e n c e / 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} ) ;
0 commit comments