Skip to content

Commit 8865773

Browse files
committed
fix: Update Hello extension test to use expandable button pattern
1 parent 337069e commit 8865773

File tree

2 files changed

+35
-20
lines changed

2 files changed

+35
-20
lines changed

e2e/src/pages/HelloExtensionPage.ts

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -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(/Foundry Functions Demo/i)).toBeVisible({ timeout: 10000 });
69+
70+
// Check for Hello greeting - use .first() to handle multiple matches
71+
await expect(iframe.getByText(/Hello.*@/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
}

e2e/tests/foundry.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ test.describe.configure({ mode: 'serial' });
44

55
test.describe('Functions with Python - E2E Tests', () => {
66
test('should render Hello UI extension', async ({ helloExtensionPage }) => {
7-
// Skip - extension tab structure needs further investigation
8-
test.skip(true, 'Skipping: Hello extension tab structure needs investigation');
7+
await helloExtensionPage.navigateToExtension();
8+
await helloExtensionPage.verifyExtensionRenders();
99
});
1010

1111
test('should execute Test hello function workflow', async ({ workflowsPage }) => {

0 commit comments

Comments
 (0)