Skip to content

Commit ac7a451

Browse files
committed
fix: retry application launcher check after plugin registration
After page reload, dynamic plugins (like Troubleshooting Panel) may not be registered immediately in the OpenShift Console. Replace the single click-and-assert with a waitUntil loop that closes and re-opens the Application Launcher dropdown until the "Signal Correlation" item appears, up to 60 seconds. Made-with: Cursor
1 parent f939493 commit ac7a451

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

web/cypress/support/commands/dashboards-commands.ts

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'cypress-wait-until';
12
import { DataTestIDs, LegacyTestIDs } from '../../../src/components/data-test';
23
import { waitForPodsReady, waitForResourceCondition } from './wait-utils';
34

@@ -89,8 +90,30 @@ export const dashboardsUtils = {
8990
cy.log(`Korrel8r pod is now running in namespace: ${MCP.namespace}`);
9091

9192
cy.reload(true);
92-
cy.byLegacyTestID(LegacyTestIDs.ApplicationLauncher, { timeout: 30000 }).should('be.visible').click();
93-
cy.byTestID(DataTestIDs.MastHeadApplicationItem).contains('Signal Correlation').should('be.visible');
93+
94+
// Dynamic plugins may take time to register after reload.
95+
// Retry by closing/re-opening the launcher until the item appears.
96+
cy.waitUntil(
97+
() =>
98+
cy.byLegacyTestID(LegacyTestIDs.ApplicationLauncher, { timeout: 10000 })
99+
.should('be.visible')
100+
.click()
101+
.then(() =>
102+
cy.get(`[data-test="${DataTestIDs.MastHeadApplicationItem}"]`, { timeout: 5000 })
103+
.then(($items) => $items.filter(':contains("Signal Correlation")').length > 0)
104+
.then((found) => {
105+
if (!found) {
106+
cy.byLegacyTestID(LegacyTestIDs.ApplicationLauncher).click();
107+
}
108+
return found;
109+
}),
110+
),
111+
{
112+
timeout: 60000,
113+
interval: 5000,
114+
errorMsg: 'Signal Correlation not found in application launcher after 60s',
115+
},
116+
);
94117
},
95118

96119
cleanupTroubleshootingPanel(MCP: { namespace: string; config1?: { kind: string; name: string } }): void {

0 commit comments

Comments
 (0)