Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ODC-7735: Edit ci tests to have step to enable developer perspective #14684

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { quickStartSidebarPO } from '../pageObjects/quickStarts-po';
import { checkDeveloperPerspective } from '../pages/functions/checkDeveloperPerspective';

// To ignore the resizeObserverLoopErrors on CI, adding below code
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/;
Expand All @@ -19,7 +20,14 @@ before(() => {
const bridgePasswordPassword: string = Cypress.env('BRIDGE_HTPASSWD_PASSWORD') || 'test';
cy.login(bridgePasswordIDP, bridgePasswordUsername, bridgePasswordPassword);
cy.document().its('readyState').should('eq', 'complete');
cy.exec(
`oc patch console.operator.openshift.io/cluster --type='merge' -p '{"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'`,
{ failOnNonZeroExit: false },
);
cy.reload(true);
cy.document().its('readyState').should('eq', 'complete');
guidedTour.close();
checkDeveloperPerspective();
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const checkDeveloperPerspective = (tries: number = 5) => {
if (tries < 1) {
return;
}
cy.get('body').then(($body) => {
cy.byLegacyTestID('perspective-switcher-toggle').click();
if ($body.find('[data-tour-id="perspective-switcher-menu-option"]').length !== 0) {
cy.byLegacyTestID('perspective-switcher-menu-option').contains('Developer');
} else {
cy.reload();
cy.document().its('readyState').should('eq', 'complete');
checkDeveloperPerspective(tries - 1);
}
});
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';

// To ignore the resizeObserverLoopErrors on CI, adding below code
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/;
/* eslint-disable consistent-return */
Expand All @@ -16,6 +19,14 @@ before(() => {
cy.login(bridgePasswordIDP, bridgePasswordUsername, bridgePasswordPassword);
cy.document().its('readyState').should('eq', 'complete');
// set the user settings location to local storage, so that no need of deleting config map from openshift-console-user-settings namespace
cy.exec(
`oc patch console.operator.openshift.io/cluster --type='merge' -p '{"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'`,
{ failOnNonZeroExit: false },
);
cy.reload(true);
cy.document().its('readyState').should('eq', 'complete');
guidedTour.close();
checkDeveloperPerspective();
cy.window().then((win: any) => {
win.SERVER_FLAGS.userSettingsLocation = 'localstorage';
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { checkErrors } from '@console/cypress-integration-tests/support';
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { installKnativeOperatorUsingCLI } from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';

before(() => {
cy.exec('../../../../contrib/create-user.sh');
Expand All @@ -9,6 +10,14 @@ before(() => {
const bridgePasswordPassword: string = Cypress.env('BRIDGE_HTPASSWD_PASSWORD') || 'test';
cy.login(bridgePasswordIDP, bridgePasswordUsername, bridgePasswordPassword);
cy.document().its('readyState').should('eq', 'complete');
cy.exec(
`oc patch console.operator.openshift.io/cluster --type='merge' -p '{"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'`,
{ failOnNonZeroExit: false },
);
cy.reload(true);
cy.document().its('readyState').should('eq', 'complete');
guidedTour.close();
checkDeveloperPerspective();
installKnativeOperatorUsingCLI();
// To ignore the resizeObserverLoopErrors on CI, adding below code
const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
import { checkErrors } from '@console/cypress-integration-tests/support';
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { installPipelinesOperatorUsingCLI } from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';

before(() => {
const bridgePasswordIDP: string = Cypress.env('BRIDGE_HTPASSWD_IDP') || 'test';
const bridgePasswordUsername: string = Cypress.env('BRIDGE_HTPASSWD_USERNAME') || 'test';
const bridgePasswordPassword: string = Cypress.env('BRIDGE_HTPASSWD_PASSWORD') || 'test';
cy.login(bridgePasswordIDP, bridgePasswordUsername, bridgePasswordPassword);
cy.document().its('readyState').should('eq', 'complete');
cy.exec(
`oc patch console.operator.openshift.io/cluster --type='merge' -p '{"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'`,
{ failOnNonZeroExit: false },
);
cy.reload(true);
cy.document().its('readyState').should('eq', 'complete');
guidedTour.close();
checkDeveloperPerspective();
installPipelinesOperatorUsingCLI();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';
import { installShipwrightOperatorUsingCLI } from '@console/dev-console/integration-tests/support/pages/functions/installOperatorOnClusterUsingCLI';

// To ignore the resizeObserverLoopErrors on CI, adding below code
Expand All @@ -16,7 +17,14 @@ before(() => {
cy.exec('../../../../contrib/create-user.sh');
cy.login();
cy.document().its('readyState').should('eq', 'complete');
cy.exec(
`oc patch console.operator.openshift.io/cluster --type='merge' -p '{"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'`,
{ failOnNonZeroExit: false },
);
cy.reload(true);
cy.document().its('readyState').should('eq', 'complete');
guidedTour.close();
checkDeveloperPerspective();
installShipwrightOperatorUsingCLI();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { checkErrors } from '@console/cypress-integration-tests/support';
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';

/* eslint-disable no-console, promise/catch-or-return */
before(() => {
Expand All @@ -9,7 +10,14 @@ before(() => {
const bridgePasswordPassword: string = Cypress.env('BRIDGE_HTPASSWD_PASSWORD') || 'test';
cy.login(bridgePasswordIDP, bridgePasswordUsername, bridgePasswordPassword);
cy.document().its('readyState').should('eq', 'complete');
cy.exec(
`oc patch console.operator.openshift.io/cluster --type='merge' -p '{"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'`,
{ failOnNonZeroExit: false },
);
cy.reload(true);
cy.document().its('readyState').should('eq', 'complete');
guidedTour.close();
checkDeveloperPerspective();
});

after(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
import { checkErrors } from '@console/cypress-integration-tests/support';
import { guidedTour } from '@console/cypress-integration-tests/views/guided-tour';
import { installWebterminalOperatorUsingCLI } from '@console/dev-console/integration-tests/support/pages';
import { checkDeveloperPerspective } from '@console/dev-console/integration-tests/support/pages/functions/checkDeveloperPerspective';

before(() => {
cy.login();
cy.document().its('readyState').should('eq', 'complete');
cy.exec(
`oc patch console.operator.openshift.io/cluster --type='merge' -p '{"spec":{"customization":{"perspectives":[{"id":"dev","visibility":{"state":"Enabled"}}]}}}'`,
{ failOnNonZeroExit: false },
);
cy.reload(true);
cy.document().its('readyState').should('eq', 'complete');
guidedTour.close();
checkDeveloperPerspective();
installWebterminalOperatorUsingCLI();
});

Expand Down