diff --git a/frontend/integration-tests/test-cypress.sh b/frontend/integration-tests/test-cypress.sh index c0089710227..191c76e0a2e 100755 --- a/frontend/integration-tests/test-cypress.sh +++ b/frontend/integration-tests/test-cypress.sh @@ -76,7 +76,7 @@ if [ -n "${nightly-}" ] && [ -z "${pkg-}" ]; then yarn run test-cypress-dev-console-nightly yarn run test-cypress-helm-nightly - # yarn run test-cypress-knative-nightly + yarn run test-cypress-knative-nightly exit $err; fi @@ -85,7 +85,7 @@ if [ -n "${headless-}" ] && [ -z "${pkg-}" ]; then yarn run test-cypress-dev-console-headless yarn run test-cypress-olm-headless yarn run test-cypress-helm-headless - # yarn run test-cypress-knative-headless + yarn run test-cypress-knative-headless exit; fi diff --git a/frontend/packages/integration-tests/support/admin.ts b/frontend/packages/integration-tests/support/admin.ts index 60dba7804f0..f1ed50ab406 100644 --- a/frontend/packages/integration-tests/support/admin.ts +++ b/frontend/packages/integration-tests/support/admin.ts @@ -16,6 +16,9 @@ Cypress.Commands.add('initAdmin', () => { cy.visit('/'); cy.byTestID('loading-indicator').should('not.exist'); cy.document().its('readyState').should('eq', 'complete'); + // Wait for perspective switcher to be rendered - this requires React to finish + // loading the NavHeader component and the perspective extensions + cy.byLegacyTestID('perspective-switcher-toggle', { timeout: 60000 }).should('be.visible'); cy.log('ensure perspective switcher is set to Core platform'); nav.sidenav.switcher.changePerspectiveTo('Core platform'); nav.sidenav.switcher.shouldHaveText('Core platform'); @@ -26,6 +29,9 @@ Cypress.Commands.add('initDeveloper', () => { cy.visit('/add'); cy.byTestID('loading-indicator').should('not.exist'); cy.document().its('readyState').should('eq', 'complete'); + // Wait for perspective switcher to be rendered - this requires React to finish + // loading the NavHeader component and the perspective extensions + cy.byLegacyTestID('perspective-switcher-toggle', { timeout: 60000 }).should('be.visible'); cy.log('ensure perspective switcher is set to Developer'); nav.sidenav.switcher.changePerspectiveTo('Developer'); cy.log('switched perspective to Developer'); diff --git a/frontend/packages/integration-tests/views/nav.ts b/frontend/packages/integration-tests/views/nav.ts index 623a8f0f8e9..9cfe43e32e2 100644 --- a/frontend/packages/integration-tests/views/nav.ts +++ b/frontend/packages/integration-tests/views/nav.ts @@ -57,15 +57,14 @@ export const nav = { 'have.attr', 'aria-expanded', 'true', - { timeout: 5000 }, + { timeout: 10000 }, ); - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1000); // wait for the menu options to render - - cy.byLegacyTestID('perspective-switcher-menu-option') + // Wait for menu options to be visible instead of fixed delay + cy.byLegacyTestID('perspective-switcher-menu-option', { timeout: 10000 }) + .should('be.visible') .contains(newPerspective) - .click({ force: true }); + .click(); } }); break; @@ -103,14 +102,11 @@ export const nav = { { timeout: 10000 }, ); - // Wait a bit for portal to render - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1500); - - // Click Developer option - cy.contains('[data-test-id="perspective-switcher-menu-option"]', 'Developer', { - timeout: 10000, - }).click(); + // Wait for menu options to be visible instead of fixed delay + cy.byLegacyTestID('perspective-switcher-menu-option', { timeout: 10000 }) + .should('be.visible') + .contains('Developer') + .click(); } }); @@ -120,11 +116,11 @@ export const nav = { .should('contain.text', 'Developer'); break; default: - cy.byLegacyTestID('perspective-switcher-toggle') - .click() - .byLegacyTestID('perspective-switcher-menu-option') + cy.byLegacyTestID('perspective-switcher-toggle').click(); + cy.byLegacyTestID('perspective-switcher-menu-option', { timeout: 10000 }) + .should('be.visible') .contains(newPerspective) - .click({ force: true }); + .click(); } }, }, diff --git a/test-prow-e2e.sh b/test-prow-e2e.sh index 5aba89af480..93003ab1e92 100755 --- a/test-prow-e2e.sh +++ b/test-prow-e2e.sh @@ -32,9 +32,8 @@ elif [ "$SCENARIO" == "dev-console" ]; then ./integration-tests/test-cypress.sh -p dev-console -h true elif [ "$SCENARIO" == "pipelines" ]; then ./integration-tests/test-cypress.sh -p pipelines -h true -# Disabled: knative-ci.feature failing in CI (OCPBUGS-82512) -# elif [ "$SCENARIO" == "knative" ]; then -# ./integration-tests/test-cypress.sh -p knative -h true +elif [ "$SCENARIO" == "knative" ]; then + ./integration-tests/test-cypress.sh -p knative -h true fi env NO_SANDBOX=true yarn test-puppeteer-csp