55 * 2.0.
66 */
77
8- import type { Locator , ScoutPage } from '@kbn/scout' ;
8+ import type { Locator , ScoutPage , ScoutTestConfig } from '@kbn/scout' ;
99
1010const PAGE_URL = 'securitySolutionUI' ;
11- const ALERTS_NAV_ITEM_SELECTOR = 'solutionSideNavItemLink-alerts' ;
12- const DETECTIONS_NAV_ITEM_SELECTOR = 'solutionSideNavItemLink-alert_detections' ;
13- const DETECTIONS_NAV_ITEM_BUTTON_SELECTOR = 'solutionSideNavItemButton-alert_detections' ;
14- const ATTACKS_NAV_PANEL_ITEM_SELECTOR = 'solutionSideNavPanelLink-attacks' ;
15- const ALERTS_NAV_PANEL_ITEM_SELECTOR = 'solutionSideNavPanelLink-alerts' ;
11+ const STATEFUL_ALERTS_NAV_ITEM_SELECTOR = 'solutionSideNavItemLink-alerts' ;
12+ const STATEFUL_DETECTIONS_NAV_ITEM_SELECTOR = 'solutionSideNavItemLink-alert_detections' ;
13+ const STATEFUL_DETECTIONS_NAV_ITEM_BUTTON_SELECTOR = 'solutionSideNavItemButton-alert_detections' ;
14+ const STATEFUL_ATTACKS_NAV_PANEL_ITEM_SELECTOR = 'solutionSideNavPanelLink-attacks' ;
15+ const STATEFUL_ALERTS_NAV_PANEL_ITEM_SELECTOR = 'solutionSideNavPanelLink-alerts' ;
16+
17+ const SERVERLESS_ALERTS_NAV_ITEM_DEEP_LINK_ID = 'securitySolutionUI:alerts' ;
18+ const SERVERLESS_DETECTIONS_NAV_ITEM_ID = 'securityGroup:alertDetections' ;
19+ const SERVERLESS_ATTACKS_NAV_PANEL_ITEM_DEEP_LINK_ID = 'securitySolutionUI:attacks' ;
20+ const SERVERLESS_ALERTS_NAV_PANEL_ITEM_DEEP_LINK_ID = 'securitySolutionUI:alerts' ;
1621
1722export class DetectionsAttackDiscoveryPage {
1823 public standaloneAlertsNavItem : Locator ;
@@ -21,14 +26,37 @@ export class DetectionsAttackDiscoveryPage {
2126 public detectionsPanelAttacksNavItem : Locator ;
2227 public detectionsNavItemButton : Locator ;
2328
24- constructor ( private readonly page : ScoutPage ) {
25- this . standaloneAlertsNavItem = this . page . testSubj . locator ( ALERTS_NAV_ITEM_SELECTOR ) ;
26- this . detectionsNavItem = this . page . testSubj . locator ( DETECTIONS_NAV_ITEM_SELECTOR ) ;
27- this . detectionsPanelAlertsNavItem = this . page . testSubj . locator ( ALERTS_NAV_PANEL_ITEM_SELECTOR ) ;
29+ constructor ( private readonly page : ScoutPage , _config : ScoutTestConfig ) {
30+ if ( _config . serverless ) {
31+ this . standaloneAlertsNavItem = this . page . testSubj . locator (
32+ `~nav-item-deepLinkId-${ SERVERLESS_ALERTS_NAV_ITEM_DEEP_LINK_ID } `
33+ ) ;
34+ this . detectionsNavItem = this . page . testSubj . locator (
35+ `~nav-item-id-${ SERVERLESS_DETECTIONS_NAV_ITEM_ID } `
36+ ) ;
37+ this . detectionsPanelAlertsNavItem = this . page . testSubj . locator (
38+ `~nav-item-deepLinkId-${ SERVERLESS_ALERTS_NAV_PANEL_ITEM_DEEP_LINK_ID } `
39+ ) ;
40+ this . detectionsPanelAttacksNavItem = this . page . testSubj . locator (
41+ `~nav-item-deepLinkId-${ SERVERLESS_ATTACKS_NAV_PANEL_ITEM_DEEP_LINK_ID } `
42+ ) ;
43+ this . detectionsNavItemButton = this . page . testSubj . locator (
44+ `~nav-item-id-${ SERVERLESS_DETECTIONS_NAV_ITEM_ID } `
45+ ) ;
46+ return ;
47+ }
48+
49+ this . standaloneAlertsNavItem = this . page . testSubj . locator ( STATEFUL_ALERTS_NAV_ITEM_SELECTOR ) ;
50+ this . detectionsNavItem = this . page . testSubj . locator ( STATEFUL_DETECTIONS_NAV_ITEM_SELECTOR ) ;
51+ this . detectionsPanelAlertsNavItem = this . page . testSubj . locator (
52+ STATEFUL_ALERTS_NAV_PANEL_ITEM_SELECTOR
53+ ) ;
2854 this . detectionsPanelAttacksNavItem = this . page . testSubj . locator (
29- ATTACKS_NAV_PANEL_ITEM_SELECTOR
55+ STATEFUL_ATTACKS_NAV_PANEL_ITEM_SELECTOR
56+ ) ;
57+ this . detectionsNavItemButton = this . page . testSubj . locator (
58+ STATEFUL_DETECTIONS_NAV_ITEM_BUTTON_SELECTOR
3059 ) ;
31- this . detectionsNavItemButton = this . page . testSubj . locator ( DETECTIONS_NAV_ITEM_BUTTON_SELECTOR ) ;
3260 }
3361
3462 async navigate ( ) {
0 commit comments