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);