11import { Page , expect , FrameLocator } from '@playwright/test' ;
2- import { SocketNavigationPage } from '@crowdstrike/foundry-playwright' ;
2+ import { SocketNavigationPage , config } from '@crowdstrike/foundry-playwright' ;
33
44/**
55 * Base page object for testing UI extensions in hosts.host.panel socket
@@ -17,14 +17,14 @@ export abstract class HostPanelExtensionPage extends SocketNavigationPage {
1717
1818 // Click second column to avoid checkbox in first column
1919 const firstRowCell = this . page . locator ( 'table tbody tr:first-child td:nth-child(2)' ) ;
20- await firstRowCell . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
20+ await firstRowCell . waitFor ( { state : 'visible' , timeout : config . extensionTimeout } ) ;
2121 await firstRowCell . click ( ) ;
2222
2323 this . logger . info ( 'Clicked on first row to open Host Information panel' ) ;
2424 await this . page . waitForLoadState ( 'networkidle' ) ;
2525
2626 const sidePanelHeader = this . page . locator ( 'h2:has-text("Host information")' ) . first ( ) ;
27- await sidePanelHeader . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
27+ await sidePanelHeader . waitFor ( { state : 'visible' , timeout : config . extensionTimeout } ) ;
2828
2929 this . logger . success ( `Navigated to host with ${ this . extensionName } extension` ) ;
3030 } ,
@@ -39,24 +39,22 @@ export abstract class HostPanelExtensionPage extends SocketNavigationPage {
3939 await this . page . waitForLoadState ( 'networkidle' ) ;
4040
4141 const hostInfoPanel = this . page . locator ( 'h2:has-text("Host information")' ) . first ( ) ;
42- await hostInfoPanel . waitFor ( { state : 'visible' , timeout : 10000 } ) ;
42+ await hostInfoPanel . waitFor ( { state : 'visible' , timeout : config . extensionTimeout } ) ;
4343 this . logger . info ( 'Host Information panel is visible' ) ;
4444
4545 // Scroll to bottom to reveal extensions
4646 await this . page . keyboard . press ( 'End' ) ;
4747 await this . page . keyboard . press ( 'End' ) ;
4848 this . logger . info ( 'Scrolled to bottom of page' ) ;
4949
50- await this . page . waitForTimeout ( 1000 ) ;
51-
5250 const extensionHeading = this . page . locator ( `h1:has-text("${ this . extensionName } ")` ) . first ( ) ;
53- await extensionHeading . waitFor ( { state : 'visible' , timeout : 15000 } ) ;
51+ await extensionHeading . waitFor ( { state : 'visible' , timeout : config . extensionTimeout } ) ;
5452 this . logger . info ( `Found ${ this . extensionName } heading` ) ;
5553
5654 await extensionHeading . click ( ) ;
5755 this . logger . info ( `Clicked to expand ${ this . extensionName } extension` ) ;
5856
59- await expect ( this . page . locator ( 'iframe[name="portal"]' ) ) . toBeVisible ( { timeout : 15000 } ) ;
57+ await expect ( this . page . locator ( 'iframe[name="portal"]' ) ) . toBeVisible ( { timeout : config . extensionTimeout } ) ;
6058 this . logger . info ( 'Extension iframe loaded' ) ;
6159
6260 const iframe : FrameLocator = this . page . frameLocator ( 'iframe[name="portal"]' ) ;
0 commit comments