Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions frontend/integration-tests/test-cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
6 changes: 6 additions & 0 deletions frontend/packages/integration-tests/support/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand Down
32 changes: 14 additions & 18 deletions frontend/packages/integration-tests/views/nav.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
}
});

Expand All @@ -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();
}
},
},
Expand Down
5 changes: 2 additions & 3 deletions test-prow-e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down