diff --git a/frontend/packages/operator-lifecycle-manager/integration-tests/tests/create-namespace.cy.ts b/frontend/packages/operator-lifecycle-manager/integration-tests/tests/create-namespace.cy.ts index 07699ec83c8..45aa28f0f2b 100644 --- a/frontend/packages/operator-lifecycle-manager/integration-tests/tests/create-namespace.cy.ts +++ b/frontend/packages/operator-lifecycle-manager/integration-tests/tests/create-namespace.cy.ts @@ -26,13 +26,19 @@ describe('Create namespace from install operators', () => { cy.byTestID('search-catalog').type(operatorName); cy.url().should('include', 'keyword'); cy.byTestID(operatorSelector).click(); - cy.byTestID('catalog-details-modal-cta').click({ force: true }); + // Wait for the Install button to be visible and have a valid href before clicking. + // The button is conditionally rendered based on useCtaLink hook, which processes + // the CTA href asynchronously. Clicking before href is set causes navigation to fail. + cy.byTestID('catalog-details-modal-cta').should('be.visible').and('have.attr', 'href'); + cy.byTestID('catalog-details-modal-cta').click(); // 3scale 2.11 supports only installation mode 'A specific namespace', // so it was automatically selected. // But starting with 2.12 it also supports 'All namespaces'. // So it is required to select this radio option to specify the namespace. - cy.byTestID('A specific namespace on the cluster-radio-input').click(); + // Regression test: Wait for radio button to be visible before clicking to avoid race conditions + // where the form re-renders asynchronously after the channel/version selectors load. + cy.byTestID('A specific namespace on the cluster-radio-input').should('be.visible').click(); // configure operator install ("^=Create_"" will match "Create_Namespace" and "Create_Project") cy.byTestID('dropdown-selectbox').click().get('[data-test-dropdown-menu^="Create_"]').click(); diff --git a/frontend/packages/operator-lifecycle-manager/integration-tests/views/operator.view.ts b/frontend/packages/operator-lifecycle-manager/integration-tests/views/operator.view.ts index 9e368aefa4d..6ff8ca66408 100644 --- a/frontend/packages/operator-lifecycle-manager/integration-tests/views/operator.view.ts +++ b/frontend/packages/operator-lifecycle-manager/integration-tests/views/operator.view.ts @@ -22,7 +22,13 @@ export const operator = { cy.log('go to operator overview panel'); cy.byTestID(operatorCardTestID).click(); cy.log('go to the install form'); - cy.byTestID('catalog-details-modal-cta').click({ force: true }); + // Wait for the Install button to be visible and have a valid href before clicking. + // The button is conditionally rendered based on useCtaLink hook, which processes + // the CTA href asynchronously. Clicking before href is set causes navigation to fail. + cy.byTestID('catalog-details-modal-cta') + .should('be.visible') + .should('have.attr', 'href') + .click(); cy.log('verify the channel selection is displayed'); cy.byTestID('operator-channel-select-toggle').should('exist'); cy.log('verify the version selection is displayed'); @@ -39,7 +45,8 @@ export const operator = { */ if (installToNamespace !== GlobalInstalledNamespace) { cy.log('configure Operator install for single namespace'); - cy.byTestID('A specific namespace on the cluster-radio-input').check(); + // Wait for radio button to be visible before checking to avoid race conditions + cy.byTestID('A specific namespace on the cluster-radio-input').should('be.visible').check(); if (useOperatorRecommendedNamespace) { cy.log('configure Operator install for operator recommended namespace'); cy.byTestID('Operator recommended Namespace:-radio-input').check();