@@ -31,33 +31,48 @@ export class HelloExtensionPage extends SocketNavigationPage {
3131 async verifyExtensionRenders ( ) : Promise < void > {
3232 return this . withTiming (
3333 async ( ) => {
34- this . logger . info ( 'Verifying Hello extension renders' ) ;
34+ this . logger . info ( 'Verifying hello extension renders' ) ;
3535
36- // Look for the "hello" extension tab
37- await this . verifyExtensionInSocket ( 'hello' ) ;
36+ // Wait for detection details panel to load
37+ await this . page . waitForLoadState ( 'networkidle' ) ;
38+
39+ // Extensions in detection details are expandable buttons at the bottom
40+ // Just look for a button named "hello" (it may or may not have aria-expanded)
41+ const extensionButton = this . page . getByRole ( 'button' , { name : 'hello' , exact : true } ) ;
42+
43+ // Scroll the button into view if needed
44+ await extensionButton . scrollIntoViewIfNeeded ( { timeout : 10000 } ) ;
45+ this . logger . info ( 'Scrolled to hello extension button' ) ;
46+
47+ // Wait for button to be visible
48+ await expect ( extensionButton ) . toBeVisible ( { timeout : 10000 } ) ;
49+ this . logger . info ( 'Found hello extension button' ) ;
3850
39- // Click on the hello extension tab
40- await this . clickExtensionTab ( 'hello' ) ;
51+ // Check if already expanded, if not click to expand
52+ const isExpanded = await extensionButton . getAttribute ( 'aria-expanded' ) ;
53+ if ( isExpanded === 'false' ) {
54+ await extensionButton . click ( ) ;
55+ this . logger . info ( 'Clicked to expand hello extension' ) ;
56+ } else {
57+ this . logger . info ( 'hello extension already expanded' ) ;
58+ }
4159
4260 // Verify iframe loads
4361 await expect ( this . page . locator ( 'iframe' ) ) . toBeVisible ( { timeout : 15000 } ) ;
44- this . logger . success ( 'Extension iframe is visible ' ) ;
62+ this . logger . info ( 'Extension iframe loaded ' ) ;
4563
64+ // Verify iframe content
4665 const iframe : FrameLocator = this . page . frameLocator ( 'iframe' ) ;
4766
48- try {
49- const hasContent = await iframe . locator ( 'body' ) . isVisible ( { timeout : 10000 } ) ;
50- if ( hasContent ) {
51- this . logger . success ( 'Hello extension content is visible' ) ;
52- } else {
53- this . logger . warn ( 'Extension iframe loaded but content not detected' ) ;
54- }
55- } catch ( error ) {
56- this . logger . warn ( `Extension content verification had issues: ${ error . message } ` ) ;
57- this . logger . info ( 'This is acceptable for E2E - extension infrastructure is working' ) ;
58- }
67+ // Check for "Foundry Functions Demo" text
68+ await expect ( iframe . getByText ( / F o u n d r y F u n c t i o n s D e m o / i) ) . toBeVisible ( { timeout : 10000 } ) ;
69+
70+ // Check for Hello greeting - use .first() to handle multiple matches
71+ await expect ( iframe . getByText ( / H e l l o .* @ / i) . first ( ) ) . toBeVisible ( ) ;
72+
73+ this . logger . success ( 'hello extension renders correctly with expected content' ) ;
5974 } ,
60- 'Verify Hello Extension Renders '
75+ 'Verify hello extension renders '
6176 ) ;
6277 }
6378}
0 commit comments