File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 : / i n s t a l l e d / 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 /**
You can’t perform that action at this time.
0 commit comments