From 961b06376a637f8d883af76628d53e0b9523fff0 Mon Sep 17 00:00:00 2001 From: David Rajnoha Date: Wed, 10 Dec 2025 13:46:54 +0100 Subject: [PATCH] fix(cypress): Operator and Monitoring Plugin Setup Commands Fixes Add 'cy.visit('/') needed for the correct flow of session reconstruction. Fix failure on MCP delete when no resource exists yet. --- web/cypress/support/commands/auth-commands.ts | 1 + web/cypress/support/commands/operator-commands.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/web/cypress/support/commands/auth-commands.ts b/web/cypress/support/commands/auth-commands.ts index af43f4b9..5ff65156 100644 --- a/web/cypress/support/commands/auth-commands.ts +++ b/web/cypress/support/commands/auth-commands.ts @@ -81,6 +81,7 @@ declare global { } Cypress.Commands.add('validateLogin', () => { + cy.visit('/'); cy.wait(2000); cy.byTestID("username", {timeout: 120000}).should('be.visible'); guidedTour.close(); diff --git a/web/cypress/support/commands/operator-commands.ts b/web/cypress/support/commands/operator-commands.ts index afbb3d90..5af50bb9 100644 --- a/web/cypress/support/commands/operator-commands.ts +++ b/web/cypress/support/commands/operator-commands.ts @@ -420,11 +420,16 @@ const operatorUtils = { `sleep 15 && oc wait --for=condition=Ready pods --selector=app.kubernetes.io/name=monitoring-plugin -n ${MP.namespace} --timeout=60s --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`, { timeout: readyTimeoutMilliseconds, - failOnNonZeroExit: true + failOnNonZeroExit: false } ).then((result) => { - expect(result.code).to.eq(0); - cy.log(`Monitoring plugin pod is now running in namespace: ${MP.namespace}`); + if (result.code === 0) { + cy.log(`Monitoring plugin pod is now running in namespace: ${MP.namespace}`); + } else if (result.stderr.includes('no matching resources found')) { + cy.log(`No monitoring-plugin pods found in namespace ${MP.namespace} - this is expected on fresh clusters`); + } else { + throw new Error(`Failed to wait for monitoring-plugin pods: ${result.stderr}`); + } }); cy.reload(true);