@@ -4,6 +4,8 @@ import { BasePage } from './BasePage';
44/**
55 * Utility page object for navigating to detection pages with socket extensions
66 *
7+ * Uses menu-based navigation to ensure reliability when URLs change.
8+ *
79 * Supports testing Foundry extensions that appear in detection sockets:
810 * - activity.detections.details (Endpoint Detections)
911 * - xdr.detections.panel (XDR Detections)
@@ -15,26 +17,48 @@ export class SocketNavigationPage extends BasePage {
1517 }
1618
1719 protected getPagePath ( ) : string {
18- throw new Error ( 'Socket navigation does not have a direct path' ) ;
20+ throw new Error ( 'Socket navigation does not have a direct path - use menu navigation ' ) ;
1921 }
2022
2123 protected async verifyPageLoaded ( ) : Promise < void > {
2224 }
2325
24- /** Navigate to Endpoint Detections page (activity.detections.details socket) */
26+ /**
27+ * Navigate to Endpoint Detections page (activity.detections.details socket)
28+ * Uses menu navigation: Menu → Endpoint security → Monitor → Endpoint detections
29+ */
2530 async navigateToEndpointDetections ( ) : Promise < void > {
2631 return this . withTiming (
2732 async ( ) => {
2833 this . logger . info ( 'Navigating to Endpoint Detections page' ) ;
2934
30- // Navigate to endpoint detections
31- await this . navigateToPath ( '/activity/detections' , 'Endpoint Detections page' ) ;
35+ // Open the hamburger menu
36+ const menuButton = this . page . getByRole ( 'button' , { name : 'Menu' } ) ;
37+ await menuButton . click ( ) ;
38+ await this . page . waitForLoadState ( 'networkidle' ) ;
39+
40+ // Click "Endpoint security"
41+ const endpointSecurityButton = this . page . getByRole ( 'button' , { name : / E n d p o i n t s e c u r i t y / i } ) ;
42+ await endpointSecurityButton . click ( ) ;
43+ await this . waiter . delay ( 500 ) ;
44+
45+ // Click "Monitor" to expand submenu (if not already expanded)
46+ const monitorButton = this . page . getByRole ( 'button' , { name : / ^ M o n i t o r $ / i } ) ;
47+ const isExpanded = await monitorButton . getAttribute ( 'aria-expanded' ) ;
48+ if ( isExpanded !== 'true' ) {
49+ await monitorButton . click ( ) ;
50+ await this . waiter . delay ( 500 ) ;
51+ }
52+
53+ // Click "Endpoint detections" link
54+ const endpointDetectionsLink = this . page . getByRole ( 'link' , { name : / E n d p o i n t d e t e c t i o n s / i } ) ;
55+ await endpointDetectionsLink . click ( ) ;
3256
3357 // Wait for page to load
3458 await this . page . waitForLoadState ( 'networkidle' ) ;
3559
36- // Verify we're on the detections page
37- const pageTitle = this . page . locator ( 'h1, [role="heading"]' ) . first ( ) ;
60+ // Verify we're on the detections page by looking for the page heading
61+ const pageTitle = this . page . locator ( 'h1, h2' ) . filter ( { hasText : / D e t e c t i o n s / i } ) . first ( ) ;
3862 await expect ( pageTitle ) . toBeVisible ( { timeout : 10000 } ) ;
3963
4064 this . logger . success ( 'Navigated to Endpoint Detections page' ) ;
@@ -43,13 +67,31 @@ export class SocketNavigationPage extends BasePage {
4367 ) ;
4468 }
4569
46- /** Navigate to XDR Detections page (xdr.detections.panel socket) */
70+ /**
71+ * Navigate to XDR Detections page (xdr.detections.panel socket)
72+ * Uses menu navigation: Menu → Next-Gen SIEM → appropriate submenu → XDR detections
73+ * Note: Requires XDR SKU - may not be available in all environments
74+ */
4775 async navigateToXDRDetections ( ) : Promise < void > {
4876 return this . withTiming (
4977 async ( ) => {
5078 this . logger . info ( 'Navigating to XDR Detections page' ) ;
5179
52- await this . navigateToPath ( '/ngsiem/detections' , 'XDR Detections page' ) ;
80+ // Open the hamburger menu
81+ const menuButton = this . page . getByRole ( 'button' , { name : 'Menu' } ) ;
82+ await menuButton . click ( ) ;
83+ await this . page . waitForLoadState ( 'networkidle' ) ;
84+
85+ // Click "Next-Gen SIEM"
86+ const ngsiemButton = this . page . getByRole ( 'button' , { name : / N e x t - G e n S I E M / i } ) ;
87+ await ngsiemButton . click ( ) ;
88+ await this . waiter . delay ( 500 ) ;
89+
90+ // Look for XDR-related navigation items
91+ // Note: This may vary based on environment configuration
92+ const xdrLink = this . page . getByRole ( 'link' , { name : / X D R .* [ D d ] e t e c t i o n s ? / i } ) ;
93+ await xdrLink . click ( ) ;
94+
5395 await this . page . waitForLoadState ( 'networkidle' ) ;
5496
5597 const pageTitle = this . page . locator ( 'h1, [role="heading"]' ) . first ( ) ;
@@ -61,13 +103,30 @@ export class SocketNavigationPage extends BasePage {
61103 ) ;
62104 }
63105
64- /** Navigate to NGSIEM Incidents page (ngsiem.workbench.details socket) */
106+ /**
107+ * Navigate to NGSIEM Incidents page (ngsiem.workbench.details socket)
108+ * Uses menu navigation: Menu → Next-Gen SIEM → appropriate submenu → Incidents
109+ * Note: Requires NGSIEM SKU - may not be available in all environments
110+ */
65111 async navigateToNGSIEMIncidents ( ) : Promise < void > {
66112 return this . withTiming (
67113 async ( ) => {
68114 this . logger . info ( 'Navigating to NGSIEM Incidents page' ) ;
69115
70- await this . navigateToPath ( '/ngsiem/workbench/incidents' , 'NGSIEM Incidents page' ) ;
116+ // Open the hamburger menu
117+ const menuButton = this . page . getByRole ( 'button' , { name : 'Menu' } ) ;
118+ await menuButton . click ( ) ;
119+ await this . page . waitForLoadState ( 'networkidle' ) ;
120+
121+ // Click "Next-Gen SIEM"
122+ const ngsiemButton = this . page . getByRole ( 'button' , { name : / N e x t - G e n S I E M / i } ) ;
123+ await ngsiemButton . click ( ) ;
124+ await this . waiter . delay ( 500 ) ;
125+
126+ // Look for Incidents navigation
127+ const incidentsLink = this . page . getByRole ( 'link' , { name : / I n c i d e n t s / i } ) ;
128+ await incidentsLink . click ( ) ;
129+
71130 await this . page . waitForLoadState ( 'networkidle' ) ;
72131
73132 const pageTitle = this . page . locator ( 'h1, [role="heading"]' ) . first ( ) ;
@@ -84,8 +143,8 @@ export class SocketNavigationPage extends BasePage {
84143 async ( ) => {
85144 await this . page . waitForLoadState ( 'networkidle' ) ;
86145
87- // Click on the first detection - look for buttons with process/host information
88- // Based on the structure seen: gridcell with buttons like "REVIL.EXE on SE-MRA-WIN10-BL by demo"
146+ // In the new Endpoint Detections UI, detections are represented as buttons in the table
147+ // Look for process/host information buttons
89148 const firstDetectionButton = this . page . locator ( '[role="gridcell"] button' ) . first ( ) ;
90149 await firstDetectionButton . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
91150 await firstDetectionButton . click ( ) ;
0 commit comments