Skip to content

Commit 020c447

Browse files
committed
Add install/uninstall status verification to AppCatalogPage
1 parent 2349611 commit 020c447

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

e2e/src/pages/AppCatalogPage.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,35 @@ export class AppCatalogPage extends BasePage {
235235
}
236236
throw new Error(`Installation status unclear for app '${appName}' - timed out waiting for "installed" or "error" message after 60 seconds`);
237237
}
238+
// Additional wait: toast appears before app is fully installed in backend
239+
// Verify installation status by checking app catalog
240+
this.logger.info('Verifying installation status in app catalog...');
241+
242+
// Navigate directly to app catalog with search query
243+
const baseUrl = new URL(this.page.url()).origin;
244+
await this.page.goto(`${baseUrl}/foundry/app-catalog?q=${appName}`);
245+
await this.page.waitForLoadState('networkidle');
246+
247+
// Poll for status every 5 seconds (up to 60 seconds)
248+
const statusText = this.page.locator('[data-test-selector="status-text"]').filter({ hasText: /installed/i });
249+
const maxAttempts = 12; // 12 attempts = up to 60 seconds
250+
251+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
252+
const isVisible = await statusText.isVisible().catch(() => false);
253+
254+
if (isVisible) {
255+
this.logger.success('Installation verified - app status shows Installed in catalog');
256+
return;
257+
}
258+
259+
if (attempt < maxAttempts - 1) {
260+
this.logger.info(`Status not yet updated, waiting 5s before refresh (attempt ${attempt + 1}/${maxAttempts})...`);
261+
await this.waiter.delay(5000);
262+
await this.page.reload({ waitUntil: 'domcontentloaded' });
263+
}
264+
}
265+
266+
throw new Error(`Installation verification failed - status did not show 'Installed' after ${maxAttempts * 5} seconds`);
238267
}
239268

240269
/**

0 commit comments

Comments
 (0)