Skip to content

Commit

Permalink
Fix e2e tests close guided tour modal before running tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vikram-raj committed Mar 4, 2025
1 parent ecfd7f9 commit 97dab3d
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion integration-tests/tests/example-page.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ const PLUGIN_TEMPLATE_NAME = 'console-plugin-template';
const PLUGIN_TEMPLATE_PULL_SPEC = Cypress.env('PLUGIN_TEMPLATE_PULL_SPEC');
export const isLocalDevEnvironment = Cypress.config('baseUrl').includes('localhost');

export const guidedTour = {
close: () => {
cy.get('body').then(($body) => {
if ($body.find(`[data-test="guided-tour-modal"]`).length > 0) {
cy.get(`[data-test="tour-step-footer-secondary"]`).contains('Skip tour').click();
}
});
},
isOpen: () => {
cy.get('body').then(($body) => {
if ($body.find(`[data-test="guided-tour-modal"]`).length > 0) {
cy.get(`[data-test="guided-tour-modal"]`).should('be.visible');
}
});
},
};

const installHelmChart = (path: string) => {
cy.exec(
`cd ../../console-plugin-template && ${path} upgrade -i ${PLUGIN_TEMPLATE_NAME} charts/openshift-console-plugin -n ${PLUGIN_TEMPLATE_NAME} --create-namespace --set plugin.image=${PLUGIN_TEMPLATE_PULL_SPEC}`,
Expand Down Expand Up @@ -35,7 +52,8 @@ const deleteHelmChart = (path: string) => {
describe('Console plugin template test', () => {
before(() => {
cy.login();

guidedTour.isOpen();
guidedTour.close();
if (!isLocalDevEnvironment) {
console.log('this is not a local env, installig helm');

Expand Down

0 comments on commit 97dab3d

Please sign in to comment.