From 8c83f4d890c4e80624b2cd19d4a4cc453215da20 Mon Sep 17 00:00:00 2001 From: Ishwar Kanse Date: Tue, 13 May 2025 17:26:14 +0530 Subject: [PATCH] Update tests to work on OCP 4.19 --- tests/cypress/support/commands.ts | 4 +++- tests/tests/dt-plugin-tests.cy.ts | 4 ++-- tests/views/tour.ts | 9 +++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 tests/views/tour.ts diff --git a/tests/cypress/support/commands.ts b/tests/cypress/support/commands.ts index e1c4995..dbcd791 100644 --- a/tests/cypress/support/commands.ts +++ b/tests/cypress/support/commands.ts @@ -3,6 +3,7 @@ import Loggable = Cypress.Loggable; import Timeoutable = Cypress.Timeoutable; import Withinable = Cypress.Withinable; import Shadow = Cypress.Shadow; +import { guidedTour } from '../../views/tour'; export {}; declare global { @@ -160,7 +161,8 @@ Cypress.Commands.add( { cacheAcrossSpecs: true, validate() { - cy.byTestID('user-dropdown').should('exist'); + cy.byTestID("username", {timeout: 120000}).should('be.visible'); + guidedTour.close(); }, }, ); diff --git a/tests/tests/dt-plugin-tests.cy.ts b/tests/tests/dt-plugin-tests.cy.ts index b9572cf..c8d0dcb 100644 --- a/tests/tests/dt-plugin-tests.cy.ts +++ b/tests/tests/dt-plugin-tests.cy.ts @@ -149,7 +149,7 @@ describe('OpenShift Distributed Tracing UI Plugin tests', () => { DTP_NAMESPACE: `${DTP.namespace}` }, timeout: 120000, - failOnNonZeroExit: true + failOnNonZeroExit: false } ) .then((result) => { // The command has completed @@ -165,7 +165,7 @@ describe('OpenShift Distributed Tracing UI Plugin tests', () => { cy.log('Create Distributed Tracing UI Plugin instance.'); cy.exec(`oc apply -f ./fixtures/tracing-ui-plugin.yaml --kubeconfig ${Cypress.env('KUBECONFIG_PATH')}`); - cy.get('.pf-v5-c-alert', { timeout: 2 * 60 * 1000 }) + cy.get('.pf-v5-c-alert, .pf-v6-c-alert', { timeout: 2 * 60 * 1000 }) .contains('Web console update is available') .then(($alert) => { // If the alert is found, assert that it exists diff --git a/tests/views/tour.ts b/tests/views/tour.ts new file mode 100644 index 0000000..7b5bb4d --- /dev/null +++ b/tests/views/tour.ts @@ -0,0 +1,9 @@ +export const guidedTour = { + close: () => { + cy.get('body').then(($body) => { + if ($body.find(`[data-test="guided-tour-modal"]`).length > 0) { + cy.byTestID('tour-step-footer-secondary').contains('Skip tour').click(); + } + }); + }, +};